Straightforward Makefile Tutorial that bring together best practices once and for all.
[c++] Basic makefile tutorial requested
Take a look at the GNU make manual - it really is pretty good!
More on reddit.comWriting a simple Makefile - tutorial
Anyone writing a make tutorial is going to be competing with one of the best bits of technical writing there is - https://www.gnu.org/software/make/manual/
More on reddit.com"A simple makefile" is a unicorn
I like the premise. It can be reused in different contexts, making it perfect for blog-writers. It follows a clear algorithm:
Take something you don't really understand;
Show a couple of non-trivial examples and reiterate that you have trouble understanding;
Make broad conclusions;
Profit.
In the next few installments, we do "A simple grep regexp is a unicorn", "A simple while-loop is a unicorn", and "A simple SQL query is a unicorn".
More on reddit.comVideos
I wrote this tutorial because the others that I found were overloaded or contradicting each other, so I went in search for the best practices to gather them in practical examples and I reduced the scope of the tutorial on the most general applications. I hope you will finally enjoy Makefiles
➡️ https://github.com/clemedon/Makefile_tutor
For the moment 5 Makefiles are studied (examples are in C but passing to C++ is only about few changes in compilation variables cf. Usage section)
v1-3 Build a C project
v4 Build a C static library
v5 Build a C project that uses libraries