-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
93 lines (71 loc) · 1.68 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
.DEFAULT_GOAL := build-all
export PROJECT := "coreapi"
export PACKAGE := "github.com/FlagBrew/CoreAPI"
VERSION=$(shell git describe --tags --always --abbrev=0 --match=v* 2> /dev/null | sed -r "s:^v::g" || echo 0)
VERSION_FULL=$(shell git describe --tags --always --dirty --match=v* 2> /dev/null | sed -r "s:^v::g" || echo 0)
build-all: cs-build-release go-build
# General
clean: cs-clean
/bin/rm -rfv ${PROJECT}
# Docker
docker:
docker compose \
--project-name ${COMPOSE_PROJECT} \
--file docker-compose.yaml \
up \
--remove-orphans \
--build \
--timeout 0 ${COMPOSE_ARGS}
docker-clean:
docker compose \
--project-name ${COMPOSE_PROJECT} \
--file docker-compose.yaml \
down \
--volumes \
--remove-orphans \
--rmi local --timeout 1
docker-build:
docker build \
--tag ${PROJECT} \
--force-rm .
# CSharp
cs-build-release:
cd coreconsole && \
dotnet build coreconsole.csproj -c Release -o ../cc && \
cp data ../cc/data -r
cs-build-debug:
cd coreconsole && \
dotnet build coreconsole.csproj -c Debug -o ../cc && \
cp data ../cc/data -r
cs-clean:
/bin/rm -rfv cc
# Go
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-fetch
dlv debug \
--headless --listen=:2345 \
--api-version=2 --log \
--allow-non-terminal-interactive \
${PACKAGE} -- --debug
go-debug: go-fetch
go run ${PACKAGE} --debug
go-debug-fast:
go run ${PACKAGE} --debug
go-build: 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}