best_makefile_for_cpp
best_makefile_for_cpp copied to clipboard
This is, in my opinion, the best starting makefile for a cpp project.
best_makefile_for_cpp
Works great for about any cpp project
Default use folder structure
project_root/bin/src/Makefile
What happens when I run make?
- creates
bin/folder at project root .cppfiles located insrc/are built into.ofiles and placed inbin/.ofiles are linked together make your executable at project root
What happens when I run make clean?
- The
bin/folder is deleted and the executable is deleted
Limitations
- Does not check header files - run
make clean && makeif you've updated a header file with any significant changes
Other
make help- shows help menu (you probably wont need it now that you read this)make run- updates binaries and executables as neccessary and starts your program