Example of initial makefile for a simple C++ toy project
Introduction
This is a sample makefile
I’m using when I create a C++ toy project that only
uses the standard library.
- It builds a single executable into a
bin
folder.
- It assumes the source code are all the
cpp
files in the src
folder.
- It uses a separate
tmp/build
folder for the build artefacts like object files.
- It handles incremental builds (using compiler generated dependency files).
Sample
References
Also see a ‘one exe per source file’ makefile.