Skip to content

Commit

Permalink
chore: faster make build (knative#1937)
Browse files Browse the repository at this point in the history
Signed-off-by: Matej Vasek <[email protected]>
  • Loading branch information
matejvasek authored Aug 22, 2023
1 parent d0fe80c commit 9224134
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,6 @@ endif

MAKEFILE_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))

# All Code prerequisites, including generated files, etc.
CODE := $(shell find . -name '*.go') \
generate/zz_filesystem_generated.go \
schema/func_yaml-schema.json \
templates/certs/ca-certificates.crt \
go.mod

.PHONY: test docs

# Default Targets
Expand All @@ -66,10 +59,12 @@ help:

build: $(BIN) ## (default) Build binary for current OS

$(BIN): $(CODE)
.PHONY: $(BIN)
$(BIN): generate/zz_filesystem_generated.go
env CGO_ENABLED=0 go build -ldflags "$(LDFLAGS)" ./cmd/$(BIN)

test: $(CODE) ## Run core unit tests
.PHONY: test
test: generate/zz_filesystem_generated.go ## Run core unit tests
go test -ldflags "$(LDFLAGS)" -race -cover -coverprofile=coverage.txt ./...

.PHONY: check
Expand All @@ -81,7 +76,7 @@ $(BIN_GOLANGCI_LINT):
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./bin v1.53.2

.PHONY: generate/zz_filesystem_generated.go
generate/zz_filesystem_generated.go: clean_templates
generate/zz_filesystem_generated.go: clean_templates templates/certs/ca-certificates.crt
go generate pkg/functions/templates_embedded.go

.PHONY: clean_templates
Expand Down

0 comments on commit 9224134

Please sign in to comment.