skip to content
Alvin Lucillo

Add prerequisites to a target

/ 1 min read

In the example below, running make hello will run its prerequisite, greet, first.

.PHONY: hello

hello: greet
	@echo "This recipe has two commands." > hello.txt
	cat hello.txt

greet: 
	@echo "Hello, Make!"
make hello          
Hello, Make!
cat hello.txt
This recipe has two commands.