Why do I need to make a make target
before being able to build my source code?
More specifically, what is make target exactly?
make
is a common development tool, which checks file dates between source code files and the object code produced from them, and compiles the one where the source is newer. It does this by use a file, called a makefile, which list the files that need to be compared.
The standard syntax is make /f makefile myprog.exe
That says to build myprog.exe using the file list in makefile. The makefile defaults to makefile.mak
so if you use that name, you don't have to specify it on the command line.
myprog.exe
here is called the target. One trick is that you could put in the makefile a list of build instructions for a non-existant file. If you then say to build that target, it will run those command. Often, you'll see something like make clean
, which has temporary file deleted.