makefiles — recipes for build automation in C++ - Casady-ComSci-Seminar/Seminar-Notes GitHub Wiki
Short Disclaimer
This page is a feeble attempt to explain the practicality and general convenience of the make command and the makefile used to direct tell the command what to "make", and how to "make" it. To find much clearer and far more detailed documentation on this topic, please consult the GNU make manual.
Make
Make is a tool often distributed with a C++ compiler that is used for build automation and managing dependencies within a project. What does that even mean? It takes on the responsibility of knowing what files ( *.cpp, *.h *.o) need to be compiled or recompiled in order to generate an up-to-date version of the desired program. There are other uses but I don't know what they are, so if you want to, that's on you.
makefiles
Essentially what we are doing when writing up a makefile is creating a set of instructions for the make command to follow as it builds our program. Almost everything in this recipe will be made, and nothing outside of it will be used. So, to get the full program, we must be more specific than kfc's "eleven herbs and spices".
in the land before makefiles:
Suppose we have a directory of program files, where our source files are: rpnStack.cpp arrayStack.cpp dynamicStack.cpp, our