Update Makefile

This commit is contained in:
Moritz Poldrack 2023-09-20 23:12:19 +02:00 committed by GitHub
parent e013e591e2
commit cebc9fc6e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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