A handy makefile for simple C/C++ applications
Easymake is a handy makefile for C/C++ applications on Linux system. For simple applications, you don’t even need to write a single line of makefile code to build your target with easymake.
foo.h, all your source files with
#include "foo.h"will be re-compiled.
NOTICE: Easymake is designed to be easy to use on simple applications, not as a highly flexible or extensible template. If you want more customization, you might need to look for a small and simple example for start.
git clone https://github.com/roxma/easymake cd easymake/samples/basics cp ../../easymake.mk Makefile make ./bin/add # if you rename add.cpp to myprogram.cpp, then you get ./bin/myprogram.cpp
*_test.cpattern will be used for testing (inspired by golang).
CFLAGSExtra flags to give to the C compiler.
CXXFLAGSExtra flags to give to the C++ compiler.
LDFLAGSExtra flags to give to compilers when they are supposed to invoke the linker
LDLIBSLibrary flags or names given to compilers when they are supposed to invoke the linker
ARFLAGSFlags to give the archive-maintaining program; default
In the GIFs, I simply copy
easymake.mkinto my souce code directory as a makefile. However, for code simplicity, I recommend the following style: