Skip to content

Commit 0f02384

Browse files
authored
Fix Makefile variables (#888)
Problem: c52b4da added comments to variables in Makefile, which broke Makefile logic because the variable values got trailing space character. Solution: - Remove the trailing space character for variables with comments - Update help-generation Makefile code to account that Tests: Manual. make, make build, make container, make create-kind-cluster ran successfully.
1 parent 238c771 commit 0f02384

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Makefile

+8-8
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ GIT_COMMIT = $(shell git rev-parse HEAD || echo "unknown")
44
DATE = $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
55

66
# variables that can be overridden by the user
7-
PREFIX ?= nginx-kubernetes-gateway ## The name of the image. For example, nginx-kubernetes-gateway
8-
TAG ?= $(VERSION:v%=%) ## The tag of the image. For example, 0.3.0
9-
TARGET ?= local ## The target of the build. Possible values: local and container
10-
KIND_KUBE_CONFIG_FOLDER = $${HOME}/.kube/kind ## The folder where the kind kubeconfig is stored
11-
OUT_DIR ?= $(shell pwd)/build/out ## The folder where the binary will be stored
12-
ARCH ?= amd64 ## The architecture of the image and/or binary. For example: amd64 or arm64
13-
override DOCKER_BUILD_OPTIONS += --build-arg VERSION=$(VERSION) --build-arg GIT_COMMIT=$(GIT_COMMIT) --build-arg DATE=$(DATE) ## The options for the docker build command. For example, --pull
7+
PREFIX ?= nginx-kubernetes-gateway## The name of the image. For example, nginx-kubernetes-gateway
8+
TAG ?= $(VERSION:v%=%)## The tag of the image. For example, 0.3.0
9+
TARGET ?= local## The target of the build. Possible values: local and container
10+
KIND_KUBE_CONFIG_FOLDER = $${HOME}/.kube/kind## The folder where the kind kubeconfig is stored
11+
OUT_DIR ?= $(shell pwd)/build/out## The folder where the binary will be stored
12+
ARCH ?= amd64## The architecture of the image and/or binary. For example: amd64 or arm64
13+
override DOCKER_BUILD_OPTIONS += --build-arg VERSION=$(VERSION) --build-arg GIT_COMMIT=$(GIT_COMMIT) --build-arg DATE=$(DATE)## The options for the docker build command. For example, --pull
1414

1515
.DEFAULT_GOAL := help
1616

1717
.PHONY: help
1818
help: Makefile ## Display this help
1919
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "; printf "Usage:\n\n make \033[36m<target>\033[0m [VARIABLE=value...]\n\nTargets:\n\n"}; {printf " \033[36m%-30s\033[0m %s\n", $$1, $$2}'
20-
@grep -E '^(override )?[a-zA-Z_-]+ \??\+?= .*? ## .*$$' $< | sort | awk 'BEGIN {FS = " \\??\\+?= .*? ## "; printf "\nVariables:\n\n"}; {gsub(/override /, "", $$1); printf " \033[36m%-30s\033[0m %s\n", $$1, $$2}'
20+
@grep -E '^(override )?[a-zA-Z_-]+ \??\+?= .*?## .*$$' $< | sort | awk 'BEGIN {FS = " \\??\\+?= .*?## "; printf "\nVariables:\n\n"}; {gsub(/override /, "", $$1); printf " \033[36m%-30s\033[0m %s\n", $$1, $$2}'
2121

2222
.PHONY: container
2323
container: build ## Build the container

0 commit comments

Comments
 (0)