I've just started learning C++ and I find it very hard to find short, comprehensive tutorials on how to use gnu make / gcc. Any ideas (please don't point me to the official gnu make tutorial, it's way too much in-depth for my purposes ;-)).
The gcc option -O enables different levels of optimization. Use -O0 to disable them and use -S to output assembly. -O3 is the highest level of optimization.
make is a build tool. It takes a file that describes how to build the files in your project based on dependencies between files, so when you change one source file, you don't have to rebuild everything (like if you used a build script). make usually uses gcc to actually compile source files.
“GCC” is a common shorthand term for the GNU Compiler Collection. This is both the most general name for the compiler, and the name used when the emphasis is on compiling C programs (as the abbreviation formerly stood for “GNU C Compiler”). When referring to C++ compilation, it is usual to call the compiler “G++”.
Check the book Managing Projects with GNU Make.
The entire text of this book is available online. Part I of this book covers the basic concepts, which I think would help you get comfortable with GNU Make.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With