-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
53 lines (44 loc) · 1.17 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
# NOTE: Make sure all indentations use tabs
# DEFAULT_GOAL specifies the default target
# This is run when no target is provided during the call
.DEFAULT_GOAL := try
# Target definitions
# .PHONY helps avoid possible name-collisions with other directory or file names on the computer
.PHONY: fmt vet build build-release run run-release try
# Target
fmt:
# Task: Format all source files
cd src
go fmt ./...
cd ..
# Target
vet: fmt
# Task: Verify any possible errors
cd src
go vet ./...
cd ..
# Target
build: vet
# Task: Build module
go build -o bin/debug/Functions src/main.go
# Target
build-release: vet
# Task: Build module for release, strip symbols
go build -ldflags="-s -w" -o bin/release/Functions src/main.go
# Target
run: build
# Task: Build module then run
bin/debug/Functions $(ARGS)
# Target
run-release: build-release
# Task: Build module for release then run
bin/release/Functions $(ARGS)
# Target
try: vet
# Task: Build module, run, then remove built binary
if test -f bin/debug/Functions-Temp; then \
rm -f bin/debug/Functions-Temp; \
fi
go build -o bin/debug/Functions-Temp src/main.go
bin/debug/Functions-Temp $(ARGS)
rm -f bin/debug/Functions-Temp