-
Notifications
You must be signed in to change notification settings - Fork 50
/
Makefile
48 lines (35 loc) · 1.3 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
SHELL := $(shell which bash)
all: build
# include the golang makefile content
include golang.mk
# include the glide makefile content
include glide.mk
# a list of this package's Go sources and Go sources
# for packages on which this package depends
SRCS := $(shell \
go list -f \
'{{with $$p := .}}{{if not $$p.Standard}}{{range $$f := $$p.GoFiles}}{{printf "%s/%s\n" $$p.Dir $$f }}{{end}}{{end}}{{end}}' \
. \
$$(go list -f '{{if not .Standard}}{{join .Deps "\n"}}{{end}}') 2> /dev/null)
# define a list of the generated source files and a target
# for generating the files if missing
GENERATED_SRCS := ./api/api_version_generated.go \
./api/utils/schema/schema_generated.go
$(GENERATED_SRCS):
$(MAKE) -C $(@D) $(@F)
# the target to build
PROG := $(shell go list -f '{{.Target}}')
$(PROG): $(SRCS) $(GENERATED_SRCS) $(GLIDE_LOCK) | $(VENDOR)
go install -v .
build: $(PROG)
# include the test.mk file for testing targets
include test.mk
# include the codecov.mk file for coverage targets
include codecov.mk
################################################################################
## CLEAN ##
################################################################################
clean:
go clean -i -x
$(MAKE) -C api clean
.PHONY: clean