2022-09-26 11:22:34 +02:00
|
|
|
TARGET = ./cc-backend
|
|
|
|
VAR = ./var
|
2023-02-25 08:17:58 +01:00
|
|
|
DB = ./var/job.db
|
2022-09-26 11:22:34 +02:00
|
|
|
FRONTEND = ./web/frontend
|
2022-09-26 13:16:04 +02:00
|
|
|
VERSION = 0.1
|
|
|
|
GIT_HASH := $(shell git rev-parse --short HEAD || echo 'development')
|
|
|
|
CURRENT_TIME = $(shell date +"%Y-%m-%d:T%H:%M:%S")
|
|
|
|
LD_FLAGS = '-s -X main.buildTime=${CURRENT_TIME} -X main.version=${VERSION} -X main.hash=${GIT_HASH}'
|
2022-09-26 11:22:34 +02:00
|
|
|
|
|
|
|
SVELTE_COMPONENTS = status \
|
|
|
|
analysis \
|
|
|
|
node \
|
|
|
|
systems \
|
|
|
|
job \
|
|
|
|
list \
|
|
|
|
user \
|
|
|
|
jobs \
|
|
|
|
header
|
|
|
|
|
|
|
|
SVELTE_TARGETS = $(addprefix $(FRONTEND)/public/build/,$(addsuffix .js, $(SVELTE_COMPONENTS)))
|
|
|
|
SVELTE_SRC = $(wildcard $(FRONTEND)/src/*.svelte) \
|
|
|
|
$(wildcard $(FRONTEND)/src/*.js) \
|
|
|
|
$(wildcard $(FRONTEND)/src/filters/*.svelte) \
|
|
|
|
$(wildcard $(FRONTEND)/src/plots/*.svelte) \
|
|
|
|
$(wildcard $(FRONTEND)/src/joblist/*.svelte)
|
|
|
|
|
2023-03-02 14:11:06 +01:00
|
|
|
.PHONY: clean test tags $(TARGET)
|
2022-09-26 11:22:34 +02:00
|
|
|
|
|
|
|
.NOTPARALLEL:
|
|
|
|
|
2023-02-25 08:17:58 +01:00
|
|
|
$(TARGET): $(VAR) $(DB) $(SVELTE_TARGETS)
|
2022-09-26 11:22:34 +02:00
|
|
|
$(info ===> BUILD cc-backend)
|
2022-09-26 13:16:04 +02:00
|
|
|
@go build -ldflags=${LD_FLAGS} ./cmd/cc-backend
|
2022-09-26 11:22:34 +02:00
|
|
|
|
|
|
|
clean:
|
|
|
|
$(info ===> CLEAN)
|
|
|
|
@go clean
|
|
|
|
@rm $(TARGET)
|
|
|
|
|
|
|
|
test:
|
|
|
|
$(info ===> TESTING)
|
|
|
|
@go build ./...
|
|
|
|
@go vet ./...
|
|
|
|
@go test ./...
|
|
|
|
|
2023-03-02 14:11:06 +01:00
|
|
|
tags:
|
|
|
|
$(info ===> TAGS)
|
|
|
|
@ctags -R
|
|
|
|
|
2022-09-26 11:22:34 +02:00
|
|
|
$(VAR):
|
|
|
|
@mkdir $(VAR)
|
|
|
|
cd web/frontend && yarn install
|
2023-02-25 08:17:58 +01:00
|
|
|
|
|
|
|
$(DB):
|
|
|
|
./cc-backend --migrate-db
|
|
|
|
|
|
|
|
$(SVELTE_TARGETS): $(SVELTE_SRC)
|
|
|
|
$(info ===> BUILD frontend)
|
|
|
|
cd web/frontend && yarn build
|