3. The Makefile

For the usage of make a file named Makefile in the working folder is needed. The build can be started from the command-line with make.

target1.txt:
	 touch target1.txt

Defining dependencies:

targetA.txt: targetB.txt
	 touch targetA.txt

targetB.txt:
	 touch targetB.txt

By default, make will start to build the first target. If the target has dependencies defined, those will be build first. Targets that are not part of dependency chains and that are not the first in the makefile will be ignored.

target1.txt: target2.txt
	 touch target1.txt
target2.txt:
	 touch target2.txt
target3.txt: target2.txt
	 touch target3.txt

Target files that already exist in the work folder will considered to be fulfilled. make does not check for the content though, it simply checks the existance.

In the examples touch is used to simply create a file in the work folder.


Hendrik Heinl

Copyright Notice