-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
52 lines (40 loc) · 1.03 KB
/
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
43
44
45
46
47
48
49
50
51
52
.DEFAULT_GOAL := build-all
export PROJECT := "links"
export PACKAGE := "github.com/lrstanley/links"
license:
curl -sL https://liam.sh/-/gh/g/license-header.sh | bash -s
build-all: clean go-fetch go-build
@echo
up: go-upgrade-deps
@echo
clean:
/bin/rm -rfv "dist/" "${PROJECT}"
go-prepare: license go-fetch
go generate -x ./...
go-fetch:
go mod download
go mod tidy
go-upgrade-deps:
go get -u ./...
go mod tidy
go-upgrade-deps-patch:
go get -u=patch ./...
go mod tidy
go-dlv: go-prepare
dlv debug \
--headless --listen=:2345 \
--api-version=2 --log \
--allow-non-terminal-interactive \
${PACKAGE} -- --site-name "http://localhost:8080" --debug --http ":8080" --prom.enabled
go-debug: go-prepare
go run ${PACKAGE} --site-name "http://localhost:8080" --debug --http ":8080" --prom.enabled
go-build: go-prepare go-fetch
CGO_ENABLED=0 \
go build \
-ldflags '-d -s -w -extldflags=-static' \
-tags=netgo,osusergo,static_build \
-installsuffix netgo \
-buildvcs=false \
-trimpath \
-o ${PROJECT} \
${PACKAGE}