bash-2.05b# rm mainprog.o bash-2.05b# rm mainprog bash-2.05b# ls mainprog.cand we ask make to just create mainprog directly:
bash-2.05b# make mainprog cc mainprog.c -o mainprog bash-2.05b# ls mainprog mainprog.c bash-2.05b# ./mainprog I am the main program I depend on nothingmake called the compiler with the source mainprog.c and asked for the output to be named mainprog.
Suppose we ask again:
bash-2.05b# make mainprog make: `mainprog' is up to date. bash-2.05b# ls -l total 16 -rwxr-xr-x 1 root root 11593 Mar 9 05:28 mainprog -rw-r--r-- 1 root root 125 Mar 9 05:07 mainprog.cSince mainprog exists and is newer than mainprog.c there is nothing to do.