Skip to content

Commit

Permalink
chore: refactor tasks in GNUmakefile
Browse files Browse the repository at this point in the history
  • Loading branch information
MaineK00n committed Apr 5, 2022
1 parent 1a483e2 commit 01552c4
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions GNUmakefile
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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'
Expand Down

0 comments on commit 01552c4

Please sign in to comment.