-
Notifications
You must be signed in to change notification settings - Fork 39
/
Makefile
51 lines (37 loc) · 1.11 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
#! /usr/bin/make
DESIGN_PKG="beam/cmd/segments/design"
.PHONY: all test build gen
TARGET_GOOS?=linux
TARGET_GOARCH?=amd64
TARGET_SUFFIX?=
export TARGET_GOOS TARGET_GOARCH TARGET_SUFFIX
all: clean build
build: gen build-only
build-only:
go build -o segments
clean:
@rm -rf app
@rm -rf client
@rm -rf tool
@rm -rf public/swagger
@rm -f segments
gen:
set -e
go install goa.design/goa/v3/cmd/goa@v3
goa gen $(DESIGN_PKG) --output .
build-static: gen
CGO_ENABLED=0 GOOS=$(TARGET_GOOS) GOARCH=$(TARGET_GOARCH) go build -a -installsuffix cgo -o segments$(TARGET_SUFFIX)
docker-build:
set -e; \
docker build -t remp-beam_segments_builder builder; \
docker run -e TARGET_GOOS -e TARGET_GOARCH -e TARGET_SUFFIX --rm -v $$PWD/../../:/src/build remp-beam_segments_builder > segments.tar;
docker-run: docker-build
docker build -t remp-beam-segments .
install: gen
go install
lint:
set -e; \
for package in $$(go list ./... | grep -vE '(/app|/design|/swagger|/client|/tool|/test)'); \
do golint -set_exit_status=true $$package; done
vet:
go vet $$(go list ./... | grep -vE '(/app|/design|/swagger|/client|/tool|/test)')