-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
54 lines (40 loc) · 1.06 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
GO_BIN_FILES=csqconv.go
GO_BIN_CMDS=github.com/lukaszgryglicki/csqconv
GO_ENV=CGO_ENABLED=0
GO_BUILD=go build -ldflags '-s -w'
GO_INSTALL=go install -ldflags '-s'
GO_FMT=gofmt -s -w
GO_LINT=golint -set_exit_status
GO_VET=go vet
GO_CONST=goconst
GO_IMPORTS=goimports -w
GO_USEDEXPORTS=usedexports
GO_ERRCHECK=errcheck -asserts -ignore '[FS]?[Pp]rint*'
BINARIES=csqconv
STRIP=strip
all: check ${BINARIES}
csqconv: csqconv.go
${GO_ENV} ${GO_BUILD} -o csqconv csqconv.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}"
const: ${GO_BIN_FILES}
${GO_CONST} ./...
usedexports: ${GO_BIN_FILES}
${GO_USEDEXPORTS} ./...
errcheck: ${GO_BIN_FILES}
${GO_ERRCHECK} ./...
check: fmt lint imports vet usedexports errcheck
install: check ${BINARIES}
${GO_INSTALL} ${GO_BIN_CMDS}
strip: ${BINARIES}
${STRIP} ${BINARIES}
clean:
-rm -f ${BINARIES}
-rm -f *.jpegls *.jpg *.raw *.png *.hint
.PHONY: all