forked from hr3lxphr6j/bililive-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (34 loc) · 933 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
33
34
35
36
37
38
39
40
41
42
UPX_ENABLE ?= 0
PLATFORM ?= $(shell go env GOHOSTOS)
ARCH ?= $(shell go env GOHOSTARCH)
.PHONY: $(notdir $(abspath $(wildcard src/cmd/*/)))
local_go_version := $(shell go version | cut -d' ' -f3 | sed -e 's/go//g')
$(notdir $(abspath $(wildcard src/cmd/*/))):
@echo "building $@ (Platform: $(PLATFORM), Arch: $(ARCH), GoVersion: $(local_go_version))"
@GOOS=$(PLATFORM) \
GOARCH=$(ARCH) \
CGO_ENABLED=0 \
UPX_ENABLE=$(UPX_ENABLE) \
./src/hack/build.sh $@
.PHONY: release
release: build-web generate
@./src/hack/release.sh
.PHONY: release-docker
release-docker:
@./src/hack/release-docker.sh
.PHONY: test
test:
@go test --cover -coverprofile=coverage.txt ./src/...
.PHONY: clean
clean:
@rm -rf bin ./src/webapp/build
@echo "All clean"
.PHONY: generate
generate:
go generate ./...
.PHONY: build-web
build-web:
cd ./src/webapp && yarn install && yarn build && cd ../../
.PHONY: run
run:
foreman start || exit 0