-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
61 lines (54 loc) · 1.29 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
ifeq ($(OS),Windows_NT)
CCFLAGS += -D WIN32
SWAGGER = ./scripts/swagger.exe
ifeq ($(PROCESSOR_ARCHITEW6432),AMD64)
CCFLAGS += -D AMD64
else
ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
CCFLAGS += -D AMD64
endif
ifeq ($(PROCESSOR_ARCHITECTURE),x86)
CCFLAGS += -D IA32
endif
endif
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
CCFLAGS += -D LINUX
SWAGGER = ./scripts/swagger-Linux
endif
ifeq ($(UNAME_S),Darwin)
CCFLAGS += -D OSX
SWAGGER = ./scripts/swagger-Darwin
endif
UNAME_P := $(shell uname -p)
ifeq ($(UNAME_P),x86_64)
CCFLAGS += -D AMD64
endif
ifneq ($(filter %86,$(UNAME_P)),)
CCFLAGS += -D IA32
endif
ifneq ($(filter arm%,$(UNAME_P)),)
CCFLAGS += -D ARM
endif
endif
help:
@echo "build run build"
.PHONY: build
build:
gofmt -s -w .
golint .
go vet
go build
version :
./scripts/version.sh VERSION ./cmd/version.go ./server/server.go README.md
test :
go test `go list ./... | grep -v /vendor/`
clean :
-rm cmdb
doc : doc-only
$(SWAGGER) serve ./docs/swagger.json -p 8888
publish : release
git commit -a -m "publish version `cat VERSION`."
# git push
echo "publish version `cat VERSION` success."