-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
31 lines (25 loc) · 863 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
# See: https://gist.github.com/asukakenji/f15ba7e588ac42795f421b48b8aede63
# For a list of valid GOOS and GOARCH values
# Note: these can be overriden on the command line e.g. `make PLATFORM=<platform> ARCH=<arch>`
PLATFORM=$(shell go env GOOS)
ARCH=$(shell go env GOARCH)
ifeq ("$(PLATFORM)", "windows")
bin=code-security-report.exe
else
bin=code-security-report
endif
dist := dist
image := oscarzhou/code-security-report:latest
.PHONY: binary build image clean
binary:
@echo "Building code security report binary for $(PLATFORM)/$(ARCH)..."
GOOS="$(PLATFORM)" GOARCH="$(ARCH)" CGO_ENABLED=0 go build -a --installsuffix cgo --ldflags '-s' -o dist/$(bin)
build: binary
mkdir -p dist/templates
cp templates/*.tmpl dist/templates
@echo "done."
image: build
docker build -f build/$(PLATFORM)/Dockerfile -t $(image) .
clean:
rm -rf $(dist)
rm -rf .tmp