skip to content
Alvin Lucillo

Basic makefile

/ 1 min read

A Makefile allows you to create targets with commands, collectively called the recipe. hello is a target, and the command that it executes is called a recipe. The recipes must begin with a tab.

hello:
	@echo "Hello, Make!"

Running make runs the default target, which is hello since it’s the first target. To be specific, you can run make hello. The @ prevents Make from displaying the command itself so you only see the output.

make
Hello, Make!

make hello
Hello, Make!