Add correct dependency on job.db in Makefile

This commit is contained in:
Jan Eitzinger 2023-02-25 08:17:58 +01:00
parent 1e3e2ab222
commit 252ec3909a

View File

@ -1,5 +1,6 @@
TARGET = ./cc-backend TARGET = ./cc-backend
VAR = ./var VAR = ./var
DB = ./var/job.db
FRONTEND = ./web/frontend FRONTEND = ./web/frontend
VERSION = 0.1 VERSION = 0.1
GIT_HASH := $(shell git rev-parse --short HEAD || echo 'development') GIT_HASH := $(shell git rev-parse --short HEAD || echo 'development')
@ -27,10 +28,9 @@ SVELTE_SRC = $(wildcard $(FRONTEND)/src/*.svelte) \
.NOTPARALLEL: .NOTPARALLEL:
$(TARGET): $(VAR) $(SVELTE_TARGETS) $(TARGET): $(VAR) $(DB) $(SVELTE_TARGETS)
$(info ===> BUILD cc-backend) $(info ===> BUILD cc-backend)
@go build -ldflags=${LD_FLAGS} ./cmd/cc-backend @go build -ldflags=${LD_FLAGS} ./cmd/cc-backend
./cc-backend --migrate-db
clean: clean:
$(info ===> CLEAN) $(info ===> CLEAN)
@ -43,10 +43,13 @@ test:
@go vet ./... @go vet ./...
@go test ./... @go test ./...
$(SVELTE_TARGETS): $(SVELTE_SRC)
$(info ===> BUILD frontend)
cd web/frontend && yarn build
$(VAR): $(VAR):
@mkdir $(VAR) @mkdir $(VAR)
cd web/frontend && yarn install cd web/frontend && yarn install
$(DB):
./cc-backend --migrate-db
$(SVELTE_TARGETS): $(SVELTE_SRC)
$(info ===> BUILD frontend)
cd web/frontend && yarn build