sindri/tools/makefile

45 lines
1.1 KiB
Makefile
Raw Permalink 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
2023-07-11 20:40:04 +02:00
cmd_echox := echo
2023-02-20 14:46:28 +01:00
cmd_log := echo -e "--"
2023-07-24 13:09:39 +02:00
cmd_copy := cp -r -u -v
2023-02-20 14:46:28 +01:00
## rules
.PHONY: all
all: build/sindri templates
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/base.ts \
source/outputs/other/jsonschema/logic.ts \
source/outputs/database/sqlite/logic.ts \
source/outputs/database/mysql/logic.ts \
2024-06-03 09:15:52 +02:00
source/outputs/database/postgresql/logic.ts \
source/outputs/backend/typescript/logic.ts \
source/outputs/frontend/typescript/logic.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
2023-07-24 13:09:39 +02:00
@ ${cmd_echox} "#!/usr/bin/env node" > temp/head.js
2023-02-20 14:46:28 +01:00
@ ${cmd_concatenate} temp/head.js $^ > $@
2023-02-20 15:18:53 +01:00
@ ${cmd_chmod} +x $@
.PHONY: templates
templates: \
source/outputs/frontend/typescript/templates/core.ts.tpl
@ ${cmd_log} "placing templates …"
@ tools/place-templates