Improve config (json) file creation

This commit is contained in:
Tobias Reisinger 2024-03-28 03:19:15 +01:00
parent 1d4e9efa15
commit 525eb21649
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
6 changed files with 91 additions and 84 deletions

View file

@ -1,5 +1,13 @@
ifneq (,$(wildcard ./.env))
include .env
export
endif
DATABASE_URL ?= sqlite://emgauwa-dev.sqlite
export DATABASE_URL
sqlx:
cargo sqlx database drop
cargo sqlx database drop -y
cargo sqlx database create
cargo sqlx migrate run
cargo sqlx prepare --workspace
@ -7,9 +15,16 @@ sqlx:
build-rpi:
cross build --target arm-unknown-linux-gnueabihf
emgauwa-%.json: config/emgauwa-%.pkl config/lib/%.pkl config/lib/common.pkl
emgauwa-%.json: config/emgauwa-%.pkl config/lib/%.pkl config/lib/common.pkl $(wildcard .env)
pkl eval -f json -o $@ $<
configs:
$(MAKE) emgauwa-core.json
$(MAKE) emgauwa-controller.json
clean:
rm -f emgauwa-controller.json
rm -f emgauwa-controller.sqlite
rm -f emgauwa-core.json
rm -f emgauwa-core.sqlite
rm -f emgauwa-dev.sqlite