-
Notifications
You must be signed in to change notification settings - Fork 203
Expand file tree
/
Copy pathMakefile
More file actions
25 lines (18 loc) · 1.04 KB
/
Copy pathMakefile
File metadata and controls
25 lines (18 loc) · 1.04 KB
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
.PHONY: frontend frontend-mobile backend single dev clean
VERSION ?= $(shell git describe --tags --abbrev=0 2>/dev/null || echo dev)
BUILD_TIME ?= $(shell date "+%Y-%m-%d %H:%M:%S")
GIT_COMMIT ?= $(shell git rev-parse --short=7 HEAD 2>/dev/null || echo unknown)
LDFLAGS = -s -w -X 'github.com/likaia/nginxpulse/internal/version.Version=$(VERSION)' -X 'github.com/likaia/nginxpulse/internal/version.BuildTime=$(BUILD_TIME)' -X 'github.com/likaia/nginxpulse/internal/version.GitCommit=$(GIT_COMMIT)'
frontend:
cd webapp && pnpm install --frozen-lockfile && pnpm run build
cd webapp_mobile && pnpm install --frozen-lockfile && pnpm run build
frontend-mobile:
cd webapp_mobile && pnpm install --frozen-lockfile && pnpm run build
backend:
go build -ldflags="$(LDFLAGS)" -o bin/nginxpulse ./cmd/nginxpulse/main.go
single:
VERSION="$(VERSION)" BUILD_TIME="$(BUILD_TIME)" GIT_COMMIT="$(GIT_COMMIT)" ./scripts/build_single.sh
dev:
./scripts/dev_local.sh
clean:
rm -rf bin/nginxpulse internal/webui/dist internal/webui/dist_mobile webapp/dist webapp_mobile/dist