sindri/tools/makefile

36 lines
812 B
Makefile
Raw Normal View History

2023-02-20 14:46:28 +01:00
## commands
cmd_create_directory := mkdir --parents
cmd_typescript_compile := tsc
cmd_concatenate := cat
2023-02-20 15:18:53 +01:00
cmd_chmod := chmod
2023-02-20 14:46:28 +01:00
cmd_echo := echo -e
cmd_log := echo -e "--"
## rules
.PHONY: all
2023-02-20 15:18:53 +01:00
all: build/sindri
2023-02-20 14:46:28 +01:00
2023-02-20 15:18:53 +01:00
temp/sindri-unlinked.js: \
2023-02-20 14:46:28 +01:00
lib/plankton/plankton.d.ts \
source/types.ts \
source/outputs/sqlite.ts \
source/outputs/mysql.ts \
source/outputs/jsonschema.ts \
2023-07-13 21:57:56 +02:00
source/outputs/typescript.ts \
2023-02-20 15:18:53 +01:00
source/conf.ts \
2023-02-20 14:46:28 +01:00
source/main.ts
@ ${cmd_log} "compiling …"
@ ${cmd_create_directory} temp
@ ${cmd_typescript_compile} $^ --lib es2020 --target es6 --outFile $@
2023-02-20 15:18:53 +01:00
build/sindri: lib/plankton/plankton.js temp/sindri-unlinked.js
2023-02-20 14:46:28 +01:00
@ ${cmd_log} "linking …"
@ ${cmd_create_directory} build
@ ${cmd_echo} "#!/usr/bin/env node\n" > temp/head.js
@ ${cmd_concatenate} temp/head.js $^ > $@
2023-02-20 15:18:53 +01:00
@ ${cmd_chmod} +x $@
2023-02-20 14:46:28 +01:00