-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (33 loc) · 888 Bytes
/
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
GOCMD=go
GOTEST=$(GOCMD) test -v -count 1
GOVET=$(GOCMD) vet
GOBUILD=$(GOCMD) build
GOFMT=gofmt
PACKAGES = ./checker ./badge
CMDS = ./cmd/checker ./cmd/badge
TARGETS = $(PACKAGES) $(CMDS)
PREFLAGS += GOOS=linux GOARCH=amd64
LDFLAGS = "-s -w"
override CC := /usr/bin/gcc
all:
@echo "No default operation"
checker: bin Makefile
$(PREFLAGS) $(GOBUILD) -ldflags $(LDFLAGS) -o bin/$@ ./$@
badge: bin Makefile
$(PREFLAGS) $(GOBUILD) -ldflags $(LDFLAGS) -o bin/$@ ./$@
cmd: Makefile
$(PREFLAGS) $(GOBUILD) -ldflags $(LDFLAGS) -o bin/cmd/checker ./cmd/checker
$(PREFLAGS) $(GOBUILD) -ldflags $(LDFLAGS) -o bin/cmd/badge ./cmd/badge
fmt:
find . -type f -name "*.go" | xargs -i $(GOCMD) fmt {}
lint:
bash ./scripts/lint-check
vet:
$(GOVET) $(TARGETS)
test:
$(GOTEST) $(PACKAGES)
bin:
mkdir -p $@
clean: bin
rm -rf ./bin/*
.PHONY: fmt vet bin test clean all checker badge cmd