skip to content
Alvin Lucillo

Basic Make variable

/ 1 min read

A variable assignment in Makefile should not be tab-indented, and it can only hold text values. To read its value, $(GREETING) is used as seen in the echo command below of the target hello.

GREETING = Hello, Make!

.PHONY: hello

hello:
	@echo "$(GREETING)"
$ make hello    
Hello, Make!