forked from cncf/gitdm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
59 lines (44 loc) · 1.63 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
GO_BIN_FILES=cmd/check_spell/check_spell.go cmd/mtp/mtp.go cmd/check_shas/check_shas.go cmd/map_orgs/map_orgs.go cmd/get_aff_files/get_aff_files.go
# GO_ENV=CGO_ENABLED=0
GO_ENV=CGO_ENABLED=1
GO_BUILD=go build -ldflags '-s -w'
# GO_BUILD=go build -ldflags '-s -w' -race
GO_FMT=gofmt -s -w
GO_LINT=golint -set_exit_status
GO_VET=go vet
GO_IMPORTS=goimports -w
GO_USEDEXPORTS=usedexports
GO_ERRCHECK=errcheck -asserts -ignore '[FS]?[Pp]rint*'
BINARIES=check_spell mtp check_shas map_orgs get_aff_files
STRIP=strip
all: check ${BINARIES}
check_spell: cmd/check_spell/check_spell.go
${GO_ENV} ${GO_BUILD} -o check_spell cmd/check_spell/check_spell.go
mtp: cmd/mtp/mtp.go
${GO_ENV} ${GO_BUILD} -o mtp cmd/mtp/mtp.go
check_shas: cmd/check_shas/check_shas.go
${GO_ENV} ${GO_BUILD} -o check_shas cmd/check_shas/check_shas.go
map_orgs: cmd/map_orgs/map_orgs.go
${GO_ENV} ${GO_BUILD} -o map_orgs cmd/map_orgs/map_orgs.go
get_aff_files: cmd/get_aff_files/get_aff_files.go
${GO_ENV} ${GO_BUILD} -o get_aff_files cmd/get_aff_files/get_aff_files.go
fmt: ${GO_BIN_FILES}
./for_each_go_file.sh "${GO_FMT}"
lint: ${GO_BIN_FILES}
./for_each_go_file.sh "${GO_LINT}"
vet: ${GO_BIN_FILES}
./for_each_go_file.sh "${GO_VET}"
imports: ${GO_BIN_FILES}
./for_each_go_file.sh "${GO_IMPORTS}"
usedexports: ${GO_BIN_FILES}
${GO_USEDEXPORTS} ./...
errcheck: ${GO_BIN_FILES}
${GO_ERRCHECK} cmd/check_spell/check_spell.go
${GO_ERRCHECK} cmd/check_shas/check_shas.go
${GO_ERRCHECK} cmd/map_orgs/map_orgs.go
${GO_ERRCHECK} cmd/get_aff_files/get_aff_files.go
check: fmt lint imports vet usedexports errcheck
strip: ${BINARIES}
${STRIP} ${BINARIES}
clean:
rm -f ${BINARIES}