forked from cruise-automation/fwanalyzer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (34 loc) · 711 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
44
45
46
.PHONY: build
ifeq ($(GOOS),)
GOOS := "linux"
endif
PWD := $(shell pwd)
all: build
.PHONY: build
build:
go mod verify
mkdir -p build
GOOS=$(GOOS) go build -a -ldflags '-w -s' -o build/fwanalyzer ./cmd/fwanalyzer
.PHONY: test
test: lint build
gunzip -c test/test.img.gz >test/test.img
gunzip -c test/ubifs.img.gz >test/ubifs.img
PATH=$(PWD)/scripts:$(PWD)/test:$(PATH) go test -count=3 -cover ./...
PATH=$(PWD)/scripts:$(PWD)/test:$(PWD)/build:$(PATH) ./test/test.py
.PHONY: modules
modules:
go mod tidy
.PHONY: lint
lint:
golangci-lint run
.PHONY: deploy
deploy: build
.PHONY: clean
clean:
rm -rf build
.PHONY: distclean
distclean: clean
rm -rf vendor
.PHONY: deps
deps:
go mod download