2022-01-29 02:29:34 +00:00
|
|
|
LIBFILES=$(wildcard src/*.ts)
|
|
|
|
TSFILES=$(wildcard *.ts)
|
|
|
|
ENTRIES=$(subst .ts,.js,$(TSFILES))
|
|
|
|
|
2022-03-03 08:35:39 +00:00
|
|
|
BAREJS=04_base64.js 51_xlsxmeta.js 51_xlsbmeta.js 59_vba.js 64_ftab.js
|
2022-02-05 13:59:25 +00:00
|
|
|
|
2022-01-29 02:29:34 +00:00
|
|
|
.PHONY: all
|
2022-03-03 08:35:39 +00:00
|
|
|
all: $(ENTRIES) 51_xlmeta.js
|
|
|
|
|
|
|
|
51_xlmeta.js: 51_xlsxmeta.js 51_xlsbmeta.js
|
|
|
|
cat $^ > $@
|
2022-01-29 02:29:34 +00:00
|
|
|
|
2022-02-05 13:59:25 +00:00
|
|
|
$(BAREJS): %.js: %.ts $(LIBFILES)
|
2022-02-04 20:57:47 +00:00
|
|
|
npx esbuild $< --outfile=$@ --platform=browser --target=es5
|
|
|
|
|
2022-01-29 02:29:34 +00:00
|
|
|
83_numbers.js: 83_numbers.ts $(LIBFILES)
|
|
|
|
npx esbuild $< --bundle --outfile=$@ --platform=browser --format=iife --global-name=NUMBERS --target=es5
|
2022-02-10 12:40:50 +00:00
|
|
|
sed -i '' 's/NUMBERS = /NUMBERS = !Object.defineProperty ? (void 0) :/g' $@
|
2022-01-29 02:29:34 +00:00
|
|
|
|
|
|
|
%.node.js: %.node.ts $(LIBFILES)
|
|
|
|
npx esbuild $< --bundle --external:xlsx --outfile=$@ --minify --platform=node
|
|
|
|
sed -i '' 's/ts-node/node/g' $@
|
|
|
|
|
|
|
|
%.js: %.ts $(LIBFILES)
|
|
|
|
npx esbuild $< --bundle --outfile=$@ --platform=browser --format=iife --global-name=$* --target=es5
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm $(ENTRIES)
|