sindri/tools/makefile
Christian Fraß 910028908f [res]
2023-07-23 19:34:15 +02:00

37 lines
854 B
Makefile

## commands
cmd_create_directory := mkdir --parents
cmd_typescript_compile := tsc
cmd_concatenate := cat
cmd_chmod := chmod
cmd_echo := echo -e
cmd_echox := echo
cmd_log := echo -e "--"
## rules
.PHONY: all
all: build/sindri
temp/sindri-unlinked.js: \
lib/plankton/plankton.d.ts \
source/types.ts \
source/outputs/jsonschema.ts \
source/outputs/database_sqlite.ts \
source/outputs/database_mysql.ts \
source/outputs/backend_typescript.ts \
source/conf.ts \
source/main.ts
@ ${cmd_log} "compiling …"
@ ${cmd_create_directory} temp
@ ${cmd_typescript_compile} $^ --lib es2020 --target es6 --outFile $@
build/sindri: lib/plankton/plankton.js temp/sindri-unlinked.js
@ ${cmd_log} "linking …"
@ ${cmd_create_directory} build
@ ${cmd_echo} "#!/usr/bin/env node" > temp/head.js
@ ${cmd_concatenate} temp/head.js $^ > $@
@ ${cmd_chmod} +x $@