From 01552c4deed7ef055d3e91946f410f76c406d8e9 Mon Sep 17 00:00:00 2001 From: MaineK00n Date: Wed, 6 Apr 2022 06:15:32 +0900 Subject: [PATCH] chore: refactor tasks in GNUmakefile --- GNUmakefile | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index ff05cb99fb..72b1308752 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -23,12 +23,9 @@ CGO_UNABLED := CGO_ENABLED=0 go GO_OFF := GO111MODULE=off go -all: b +all: build test -build: ./cmd/vuls/main.go pretest fmt - $(GO) build -a -ldflags "$(LDFLAGS)" -o vuls ./cmd/vuls - -b: ./cmd/vuls/main.go +build: ./cmd/vuls/main.go $(GO) build -a -ldflags "$(LDFLAGS)" -o vuls ./cmd/vuls install: ./cmd/vuls/main.go @@ -59,9 +56,9 @@ mlint: fmtcheck: $(foreach file,$(SRCS),gofmt -s -d $(file);) -pretest: lint vet fmtcheck golangci +pretest: lint vet fmtcheck -test: +test: pretest $(GO) test -cover -v ./... || exit; unused: @@ -76,13 +73,12 @@ clean: echo $(PKGS) | xargs go clean || exit; # trivy-to-vuls -build-trivy-to-vuls: pretest fmt - $(GO) build -a -ldflags "$(LDFLAGS)" -o trivy-to-vuls contrib/trivy/cmd/*.go +build-trivy-to-vuls: ./contrib/trivy/cmd/main.go + $(GO) build -a -ldflags "$(LDFLAGS)" -o trivy-to-vuls ./contrib/trivy/cmd # future-vuls -build-future-vuls: pretest fmt - $(GO) build -a -ldflags "$(LDFLAGS)" -o future-vuls contrib/future-vuls/cmd/*.go - +build-future-vuls: ./contrib/future-vuls/cmd/main.go + $(GO) build -a -ldflags "$(LDFLAGS)" -o future-vuls ./contrib/future-vuls/cmd # integration-test BASE_DIR := '${PWD}/integration/results'