Skip to content

Commit 238e061

Browse files
authored
chore: add missing .PHONY statements to Makefile (knative#2878)
1 parent b31a3a4 commit 238e061

File tree

1 file changed

+29
-4
lines changed

1 file changed

+29
-4
lines changed

Makefile

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ export GOFLAGS
4040

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

43-
.PHONY: test docs
44-
4543
# Default Targets
44+
.PHONY: all
4645
all: build docs
4746
@echo '🎉 Build process completed!'
4847

4948
# Help Text
5049
# Headings: lines with `##$` comment prefix
5150
# Targets: printed if their line includes a `##` comment
51+
.PHONY: help
5252
help:
5353
@echo 'Usage: make <OPTIONS> ... <TARGETS>'
5454
@echo ''
@@ -60,6 +60,7 @@ help:
6060
##@ Development
6161
###############
6262

63+
.PHONY: build
6364
build: $(BIN) ## (default) Build binary for current OS
6465

6566
.PHONY: $(BIN)
@@ -123,6 +124,7 @@ docs:
123124
##@ Prow Integration
124125
#############
125126

127+
.PHONY: presubmit-unit-tests
126128
presubmit-unit-tests: ## Run prow presubmit unit tests locally
127129
docker run --platform linux/amd64 -it --rm -v$(MAKEFILE_DIR):/src/ us-docker.pkg.dev/knative-tests/images/prow-tests:v20230616-086ddd644 sh -c 'cd /src && runner.sh ./test/presubmit-tests.sh --unit-tests'
128130

@@ -147,31 +149,39 @@ check-rust: ## Check Rust templates' source
147149
cd templates/rust/cloudevents && cargo clippy && cargo clean
148150
cd templates/rust/http && cargo clippy && cargo clean
149151

152+
.PHONY: test-templates
150153
test-templates: test-go test-node test-python test-quarkus test-springboot test-rust test-typescript ## Run all template tests
151154

155+
.PHONY: test-go
152156
test-go: ## Test Go templates
153157
cd templates/go/cloudevents && go mod tidy && go test
154158
cd templates/go/http && go mod tidy && go test
155159

160+
.PHONY: test-node
156161
test-node: ## Test Node templates
157162
cd templates/node/cloudevents && npm ci && npm test && rm -rf node_modules
158163
cd templates/node/http && npm ci && npm test && rm -rf node_modules
159164

165+
.PHONY: test-python
160166
test-python: ## Test Python templates and Scaffolding
161167
test/test_python.sh
162168

169+
.PHONY: test-quarkus
163170
test-quarkus: ## Test Quarkus templates
164171
cd templates/quarkus/cloudevents && ./mvnw -q test && ./mvnw clean && rm .mvn/wrapper/maven-wrapper.jar
165172
cd templates/quarkus/http && ./mvnw -q test && ./mvnw clean && rm .mvn/wrapper/maven-wrapper.jar
166173

174+
.PHONY: test-springboot
167175
test-springboot: ## Test Spring Boot templates
168176
cd templates/springboot/cloudevents && ./mvnw -q test && ./mvnw clean && rm .mvn/wrapper/maven-wrapper.jar
169177
cd templates/springboot/http && ./mvnw -q test && ./mvnw clean && rm .mvn/wrapper/maven-wrapper.jar
170178

179+
.PHONY: test-rust
171180
test-rust: ## Test Rust templates
172181
cd templates/rust/cloudevents && cargo -q test && cargo clean
173182
cd templates/rust/http && cargo -q test && cargo clean
174183

184+
.PHONY: test-typescript
175185
test-typescript: ## Test Typescript templates
176186
cd templates/typescript/cloudevents && npm ci && npm test && rm -rf node_modules build
177187
cd templates/typescript/http && npm ci && npm test && rm -rf node_modules build
@@ -181,16 +191,18 @@ test-typescript: ## Test Typescript templates
181191
###############
182192

183193
# Pulls runtimes then rebuilds the embedded filesystem
194+
.PHONY: update-runtimes
184195
update-runtimes: update-runtime-go generate/zz_filesystem_generated.go ## Update Scaffolding Runtimes
185196

197+
.PHONY: update-runtime-go
186198
update-runtime-go:
187199
cd templates/go/scaffolding/instanced-http && go get -u knative.dev/func-go/http
188200
cd templates/go/scaffolding/static-http && go get -u knative.dev/func-go/http
189201
cd templates/go/scaffolding/instanced-cloudevents && go get -u knative.dev/func-go/cloudevents
190202
cd templates/go/scaffolding/static-cloudevents && go get -u knative.dev/func-go/cloudevents
191203

192204

193-
.PHONY: cert
205+
.PHONY: certs
194206
certs: templates/certs/ca-certificates.crt ## Update root certificates
195207

196208
.PHONY: templates/certs/ca-certificates.crt
@@ -202,59 +214,70 @@ templates/certs/ca-certificates.crt:
202214
##@ Extended Testing (cluster required)
203215
###################
204216

217+
.PHONY: test-integration
205218
test-integration: ## Run integration tests using an available cluster.
206219
go test -tags integration -timeout 30m --coverprofile=coverage.txt ./... -v
207220

208221
.PHONY: func-instrumented
209-
210222
func-instrumented: ## Func binary that is instrumented for e2e tests
211223
env CGO_ENABLED=1 go build -cover -o func ./cmd/$(BIN)
212224

225+
.PHONY: test-e2e
213226
test-e2e: func-instrumented ## Run end-to-end tests using an available cluster.
214227
./test/e2e_extended_tests.sh
215228

229+
.PHONY: test-e2e-runtime
216230
test-e2e-runtime: func-instrumented ## Run end-to-end lifecycle tests using an available cluster for a single runtime.
217231
./test/e2e_lifecycle_tests.sh $(runtime)
218232

233+
.PHONY: test-e2e-on-cluster
219234
test-e2e-on-cluster: func-instrumented ## Run end-to-end on-cluster build tests using an available cluster.
220235
./test/e2e_oncluster_tests.sh
221236

222237
######################
223238
##@ Release Artifacts
224239
######################
225240

241+
.PHONY: cross-platform
226242
cross-platform: darwin-arm64 darwin-amd64 linux-amd64 linux-arm64 linux-ppc64le linux-s390x windows ## Build all distributable (cross-platform) binaries
227243

244+
.PHONY: darwin-arm64
228245
darwin-arm64: $(BIN_DARWIN_ARM64) ## Build for mac M1
229246

230247
$(BIN_DARWIN_ARM64): generate/zz_filesystem_generated.go
231248
env CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o $(BIN_DARWIN_ARM64) -trimpath -ldflags "$(LDFLAGS) -w -s" ./cmd/$(BIN)
232249

250+
.PHONY: darwn-amd64
233251
darwin-amd64: $(BIN_DARWIN_AMD64) ## Build for Darwin (macOS)
234252

235253
$(BIN_DARWIN_AMD64): generate/zz_filesystem_generated.go
236254
env CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o $(BIN_DARWIN_AMD64) -trimpath -ldflags "$(LDFLAGS) -w -s" ./cmd/$(BIN)
237255

256+
.PHONY: linux-amd64
238257
linux-amd64: $(BIN_LINUX_AMD64) ## Build for Linux amd64
239258

240259
$(BIN_LINUX_AMD64): generate/zz_filesystem_generated.go
241260
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o $(BIN_LINUX_AMD64) -trimpath -ldflags "$(LDFLAGS) -w -s" ./cmd/$(BIN)
242261

262+
.PHONY: linux-arm64
243263
linux-arm64: $(BIN_LINUX_ARM64) ## Build for Linux arm64
244264

245265
$(BIN_LINUX_ARM64): generate/zz_filesystem_generated.go
246266
env CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o $(BIN_LINUX_ARM64) -trimpath -ldflags "$(LDFLAGS) -w -s" ./cmd/$(BIN)
247267

268+
.PHONY: linux-ppc64le
248269
linux-ppc64le: $(BIN_LINUX_PPC64LE) ## Build for Linux ppc64le
249270

250271
$(BIN_LINUX_PPC64LE): generate/zz_filesystem_generated.go
251272
env CGO_ENABLED=0 GOOS=linux GOARCH=ppc64le go build -o $(BIN_LINUX_PPC64LE) -trimpath -ldflags "$(LDFLAGS) -w -s" ./cmd/$(BIN)
252273

274+
.PHONY: linux-s390x
253275
linux-s390x: $(BIN_LINUX_S390X) ## Build for Linux s390x
254276

255277
$(BIN_LINUX_S390X): generate/zz_filesystem_generated.go
256278
env CGO_ENABLED=0 GOOS=linux GOARCH=s390x go build -o $(BIN_LINUX_S390X) -trimpath -ldflags "$(LDFLAGS) -w -s" ./cmd/$(BIN)
257279

280+
.PHONY: windows
258281
windows: $(BIN_WINDOWS) ## Build for Windows
259282

260283
$(BIN_WINDOWS): generate/zz_filesystem_generated.go
@@ -264,10 +287,12 @@ $(BIN_WINDOWS): generate/zz_filesystem_generated.go
264287
##@ Schemas
265288
######################
266289

290+
.PHONY: schema-generate
267291
schema-generate: schema/func_yaml-schema.json ## Generate func.yaml schema
268292
schema/func_yaml-schema.json: pkg/functions/function.go pkg/functions/function_*.go
269293
go run schema/generator/main.go
270294

295+
.PHONY: schema-check
271296
schema-check: ## Check that func.yaml schema is up-to-date
272297
mv schema/func_yaml-schema.json schema/func_yaml-schema-previous.json
273298
make schema-generate

0 commit comments

Comments
 (0)