From cebc9fc6e9dd4f700fab07f9efa6f7bd893381fa Mon Sep 17 00:00:00 2001 From: Moritz Poldrack <33086936+mpldr@users.noreply.github.com> Date: Wed, 20 Sep 2023 23:12:19 +0200 Subject: [PATCH] Update Makefile --- Makefile | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index a406825..8c120d8 100644 --- a/Makefile +++ b/Makefile @@ -1,22 +1,27 @@ -all: sqlc elm build +GOSRC!=find * -type f \( -name '*.go' -and -not -name '*_test.go' \) +GOSRC+=go.mod go.sum +gostart: $(GO_SRC) go.mod go.sum data + go build -trimpath -o $@ + +assets/main.min.js: src/Main.elm + elm make $< --optimize --output=assets/main.js + uglifyjs assets/main.js --compress 'pure_funcs=[F2,F3,F4,F5,F6,F7,F8,F9,A2,A3,A4,A5,A6,A7,A8,A9],pure_getters,keep_fargs=false,unsafe_comps,unsafe' | uglifyjs --mangle --output $@ + rm -f assets/main.js + +data: queries.sql schema.sql + sqlc generate + touch data + +.PHONY: check check: go vet ./... staticcheck ./... -elm: src/Main.elm - elm make src/Main.elm --optimize --output=assets/main.js - uglifyjs assets/main.js --compress 'pure_funcs=[F2,F3,F4,F5,F6,F7,F8,F9,A2,A3,A4,A5,A6,A7,A8,A9],pure_getters,keep_fargs=false,unsafe_comps,unsafe' | uglifyjs --mangle --output assets/main.min.js - rm -f assets/main.js - -sqlc: queries.sql schema.sql - sqlc generate - -build: - go build - +.PHONY: watch watch: echo src/Main.elm | entr -r make elm -run: sqlc build +.PHONY: run +run: gostart ./gostart -name startdev -db ./test.db -dev