2024-01-06 21:38:13 +00:00
|
|
|
.PHONY: up down run-server run-cli test
|
2021-06-26 18:08:35 +00:00
|
|
|
|
|
|
|
GOFILES=$(shell find . -name '*.go' -o -name 'go.*')
|
|
|
|
STATICFILES=$(shell find . -name '*.js' -o -name '*.css' -o -name '*.html')
|
|
|
|
SQLFILES=$(shell find . -name '*.sql')
|
|
|
|
|
2021-07-02 22:47:14 +00:00
|
|
|
ifneq (,$(wildcard ./local.properties))
|
|
|
|
include local.properties
|
|
|
|
export
|
|
|
|
endif
|
|
|
|
|
2024-01-06 21:38:13 +00:00
|
|
|
build: server cli
|
2021-06-26 18:08:35 +00:00
|
|
|
|
2021-07-07 01:40:12 +00:00
|
|
|
run-server: build
|
2021-07-02 22:47:14 +00:00
|
|
|
./server
|
|
|
|
|
2024-01-06 21:38:13 +00:00
|
|
|
run-cli: build
|
|
|
|
./cli
|
2021-07-07 01:40:12 +00:00
|
|
|
|
2021-06-26 18:08:35 +00:00
|
|
|
server: $(GOFILES) $(STATICFILES)
|
|
|
|
go build -o server ./cmd/serve
|
|
|
|
|
2024-01-06 21:38:13 +00:00
|
|
|
cli: $(GOFILES) $(SQLFILES)
|
|
|
|
go build -o cli ./cmd/cli
|
2021-06-26 18:08:35 +00:00
|
|
|
|
2021-07-13 22:32:01 +00:00
|
|
|
test:
|
|
|
|
go test ./... -cover
|
|
|
|
|
2021-07-02 22:47:14 +00:00
|
|
|
# dev dependencies
|
2021-06-26 18:08:35 +00:00
|
|
|
up:
|
2024-01-06 21:38:13 +00:00
|
|
|
docker-compose up -d
|
2021-06-26 18:08:35 +00:00
|
|
|
|
|
|
|
down:
|
2024-01-06 21:38:13 +00:00
|
|
|
docker-compose down
|