-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
32 lines (23 loc) · 737 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
.PHONY: build run
BIN := bin/gullak.bin
LAST_COMMIT := $(shell git rev-parse --short HEAD)
LAST_COMMIT_DATE := $(shell git show -s --format=%ci ${LAST_COMMIT})
VERSION := $(shell git describe --tags)
BUILDSTR := ${VERSION} (Commit: ${LAST_COMMIT_DATE} (${LAST_COMMIT}), Build: $(shell date +"%Y-%m-%d% %H:%M:%S %z"))
.PHONY: build-ui
build-ui:
cd ui && yarn install && yarn build
.PHONY: build
build: build-ui
CGO_ENABLED=0 go build -o ${BIN} -ldflags="-X 'main.buildString=${BUILDSTR}'" .
.PHONY: run
run: build ## Run binary.
./${BIN}
.PHONY: clean
clean: ## Remove temporary files and the `bin` folder.
rm -rf bin
.PHONY: fresh
fresh: build run
.PHONY: gen-sql
gen-sql: ## Generate SQL queries using sqlc.
sqlc generate