library/Makefile

35 lines
585 B
Makefile
Raw Normal View History

.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
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
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
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:
docker-compose up -d
2021-06-26 18:08:35 +00:00
down:
docker-compose down