A generic makefile template/framework for C and C++ projects. The template helps simplify the build process and does not require building tools such as CMake, qmake, etc. Only a few lines of information are needed to create each Makefile, which is based on the information in a project file. Project files are created by the developer, and are usually simple.
- Automatically finds and compiles all source files within the source directory.
- Automatically generates dependecies as files are compiled, ensuring that files are correctly recompiled when dependecies have updated.
-
Add makefile template (in directory
modules
) into your project path. -
Define project file (e.g. helloworld.pro) which will be included in
Makefile
. You can define some built-in variables of GNU make in this file, such asCFLAGS
,CXXFLAGS
,CPPFLAGS
,LDFLAGS
, etc. Moveover, you should define the following specific variables:TARGET Specifies target name.
TARGET = helloworld
INCLUDEPATH Specifies the #include directories which should be searched when compiling the project.
INCLUDEPATH = include
DEPENDPATH Specifies the source directories which should be searched when compiling the project.
DEPENDPATH = src
HEADERS Defines the header files for the project.
HEADERS = message.h
SOURCES Defines the source files for the project.
SOURCES = main.cpp message.cpp