-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
43 lines (30 loc) · 866 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
CMD = snyk-to-md
BIN = bin/$(CMD)
BIN_DARWIN = $(BIN)-darwin
BIN_LINUX = $(BIN)-linux
SOURCES = $(shell find . -type f -iname "*.go")
CMD_SRC = ./main.go
.PHONY: all build vet fmt clean
$(BIN_DARWIN): $(SOURCES)
GOOS=darwin go build -o $(BIN_DARWIN) $(CMD_SRC)
$(BIN_LINUX): $(SOURCES)
GOOS=linux CGO_ENABLED=0 go build -o $(BIN_LINUX) $(CMD_SRC)
build: $(BIN_DARWIN) $(BIN_LINUX)
vet:
go vet ./...
fmt:
go fmt ./...
run: fmt vet build
${BIN_DARWIN}
test:
go test ./...
clean:
rm -rf bin/
test-input: fmt vet build
${BIN_DARWIN} -i test-data/test-report-1-vuln.json
test-input-debug: fmt vet build
${BIN_DARWIN} -d -i test-data/test-report-1-vuln.json
test-input-pipe: fmt vet build
cat test-data/test-report-1-vuln.json | ${BIN_DARWIN}
test-output-file: fmt vet build
cat test-data/test-report-1-vuln.json | ${BIN_DARWIN} -o ./test-output.md