sindri/tools/makefile
Christian Fraß e1d2344e69 [ini]
2023-02-20 14:46:28 +01:00

31 lines
710 B
Makefile

## commands
cmd_create_directory := mkdir --parents
cmd_typescript_compile := tsc
cmd_concatenate := cat
cmd_echo := echo -e
cmd_log := echo -e "--"
## rules
.PHONY: all
all: build/datamodel.js
temp/datamodel-unlinked.js: \
lib/plankton/plankton.d.ts \
source/types.ts \
source/outputs/sqlite.ts \
source/outputs/mysql.ts \
source/main.ts
@ ${cmd_log} "compiling …"
@ ${cmd_create_directory} temp
@ ${cmd_typescript_compile} $^ --lib es2020 --target es6 --outFile $@
build/datamodel.js: lib/plankton/plankton.js temp/datamodel-unlinked.js
@ ${cmd_log} "linking …"
@ ${cmd_create_directory} build
@ ${cmd_echo} "#!/usr/bin/env node\n" > temp/head.js
@ ${cmd_concatenate} temp/head.js $^ > $@