target: dependencies actionNote that action must be preceded by a tab character; this is a historical artifact that no one has bothered to fix.
make(Target) { foreach Dependency do { if (IsATarget(Dependency)) { make(Dependency) } } if (!FileExists(Target) || AnyNewer(Dependencies,Target)) { DoActions(Target) } }
clean: rm -f *.o *.bak *~which causes make to delete object files and any backup files (*.bak and *~) created by other programs such as editors.
prompt> gcc -c *.c prompt> ar -rv libmystuff.a *.o prompt> pwd /home/geoff/c prompt> gcc MyMain.c -L/home/geoff/c -lmystuff -o MyMain
all: part1.o part2.o gcc part1.o part2.o -o whole part1.o: part1.c part3.o gcc -c part1.c gcc part1.o part3.o -o part3.out part2.o: part2.c gcc -c part2.c part3.o: part3.c gcc -c part3.c
Exam Style Questions