GitHub
All our OpenSource projects have been migrated to GitHub.
Feel free to fork!
Feel free to fork!
Documentation
Reference
You will find below all the available configuration directive for the Magic MakeFile.
You can either edit them directly in the 'makefile-config.mk' file, or temporary set them from the command line, when calling make.
Table of contents
Project configuration
code
- Programming language
code = C
This is were you define the programming language used in your project.
Actually, 'C', 'C++' and 'Objective-C' are supported.
Actually, 'C', 'C++' and 'Objective-C' are supported.
Note that the settings for each language are placed in the 'makefile-code' directory. You'll find a detailed explaination about those settings at the end of this page.
lang
- Output language
lang = en
The language that the Magic MakeFile will use for its output messages.
Actually, 'en' or 'fr' are supported. Translators are welcome...
Actually, 'en' or 'fr' are supported. Translators are welcome...
Executables & dependancies
EXEC
- Final executable(s)
EXEC = main
The name of the final executable(s) that will be built.
If you need to generate several executables, simply separate them by a single space.
If you need to generate several executables, simply separate them by a single space.
Note that you need to have a source file with the same name as the target.
For instance, if your final executable is called 'my_soft', and if you are using C as programming language, you'll need to have a 'my_soft.c' file in the source directory.
For instance, if your final executable is called 'my_soft', and if you are using C as programming language, you'll need to have a 'my_soft.c' file in the source directory.
DEPS_
- Object code dependancies
DEPS_main =
The dependancies for a final executable.
The name after 'DEPS_' must be the same as the executable you configured in the 'EXEC' section.
If you have several executables, simply add other 'DEPS_' lines.
The name after 'DEPS_' must be the same as the executable you configured in the 'EXEC' section.
If you have several executables, simply add other 'DEPS_' lines.
Listed dependancies must have a corresponding source file, in the source directory.
For instance, 'DEPS_main = funcs' will compile the 'funcs.c' and 'main.c' files from the source directory and link them together to generate an executable called main.
Separate dependancies for a single executable by a single space.
For instance, 'DEPS_main = funcs' will compile the 'funcs.c' and 'main.c' files from the source directory and link them together to generate an executable called main.
Separate dependancies for a single executable by a single space.
DEPS_LIB_
- Library dependancies
DEPS_LIB_main =
This setting works the same way as the previous one, with the difference that listed dependancies will be taken form the 'source/lib' directory.
For each dependancy, a static library will be built (instead of object code), and then linked with the final executable.
For each dependancy, a static library will be built (instead of object code), and then linked with the final executable.
DEPS_SYSLIB_
- System library dependancies
DEPS_SYSLIB_main =
You may list here the system libraries that have to be linked with the final executable.
OBJC_FRAMEWORK
- Objective-C framework(s)
OBJC_FRAMEWORK = Cocoa
This setting is only applicable if Objective-C is defined as the programming language.
It specifies the frameworks that will be linked with the executables.
It specifies the frameworks that will be linked with the executables.
By default, the 'Cocoa' framework is set, but you can add other ones if you need them.
Simply separate frameworks with a single space.
Simply separate frameworks with a single space.
Directories
DIR_BUILD
- Build directory
DIR_BUILD = ./build
The directory for the build files.
DIR_BUILD_BIN
- Build directory (executables)
DIR_BUILD_BIN = $(DIR_BUILD)/bin
The directory where the final executables will be placed, after compiling the project.
DIR_BUILD_OBJ
- Build directory (object code)
DIR_BUILD_OBJ = $(DIR_BUILD)/obj
The directory where the intermediate object-code files will be placed, after compiling the project.
DIR_BUILD_LIB
- Build directory (libraries)
DIR_BUILD_LIB = $(DIR_BUILD)/lib
The directory where the generated static libraries will be placed, after compiling the project.
DIR_SRC
- Sources
DIR_SRC = ./source
The directory where the main source files are located.
DIR_SRC_LIB
- Library sources
DIR_SRC_LIB = $(DIR_SRC)/lib
The directory where the source files for the libraries are located.
DIR_SRC_INC
- Includes
DIR_SRC_INC = $(DIR_SRC)/include
The directory where the main include files are located.
DIR_SRC_LIB_INC
- Library includes
DIR_SRC_LIB_INC = $(DIR_SRC_LIB)/include
The directory where the include files for the libraries are located.
External tools
RM
- Removal tool
RM = rm
The tool used to remove files or directories.
INSTALL
- Install tool
INSTALL = install
The tool used to install files into their final destinations.
SHELL
- Used shell
SHELL = /bin/sh
The shell that will be used for some operations.
Arguments for the external tools
ARGS_RM
ARGS_RM = -rf
The arguments for the file removal tool.
ARGS_INSTALL
ARGS_INSTALL =
The arguments for the installation tool.
Debug options
DEBUG_LIBTOOL
- Linker debug
DEBUG_LIBTOOL = 0
If set to '1', displays the commands used to link generated files together, in order to create the executables.
DEBUG_CC
- Compiler debug
DEBUG_CC = 0
If set to '1', displays the commands used to compile individual source files.
DEBUG_RM
- Remove debug
DEBUG_RM = 0
If set to '1', displays the commands used to remove files or directories.
DEBUG_INSTALL
- Installation debug
DEBUG_INSTALL = 0
If set to '1', displays the commands used to install files into their final destinations.
Output
DISPLAY_HEADER
DISPLAY_HEADER = 1
If set to '1', displays the Magic MakeFile header notice.
DISPLAY_FOOTER
DISPLAY_FOOTER = 1
If set to '1', displays the Magic MakeFile footer notice.
Installation tools
INSTALL_PROGRAM
INSTALL_PROGRAM = $(INSTALL)
The tool used to install software.
INSTALL_DATA
INSTALL_DATA = $(INSTALL) -m 644
The tool used to install software's data, that does not require an execution flag.
Installation paths
Those variables are used in most makefiles to control where the final files will be installed.
The 'prefix' variable controls where all files will be located. The other ones are used for fine tuning, if necessary.
The 'prefix' variable controls where all files will be located. The other ones are used for fine tuning, if necessary.
prefix
prefix = /usr/local
exec_prefix
exec_prefix = $(prefix)
bindir
bindir = $(exec_prefix)/bin
sbindir
sbindir = $(exec_prefix)/sbin
libexecdir
libexecdir = $(exec_prefix)/libexec
datarootdir
datarootdir = $(prefix)/share
datadir
datadir = $(datarootdir)
infodir
infodir = $(datarootdir)/info
Language specific settings
Independant settings can be configured for each supported language.
The language settings can be found on the 'makefile-code' directory. They are included, depending on which language you are using.
The language settings can be found on the 'makefile-code' directory. They are included, depending on which language you are using.
Here's the list of the default settings:
C
Compiler: gcc
Linker: glibtool
Linker: glibtool
Compiler options:
- -std=c99
- -Os
- -pedantic
- -Werror
- -Wall
- -Wextra
- -Wbad-function-cast
- -Wdeclaration-after-statement
- -Werror-implicit-function-declaration
- -Wmissing-braces
- -Wmissing-declarations
- -Wmissing-field-initializers
- -Wmissing-prototypes
- -Wnested-externs
- -Wold-style-definition
- -Wparentheses
- -Wreturn-type
- -Wshadow
- -Wsign-compare
- -Wstrict-prototypes
- -Wswitch
- -Wuninitialized
- -Wunknown-pragmas
- -Wunused-function
- -Wunused-label
- -Wunused-parameter
- -Wunused-value
- -Wunused-variable
C++
Compiler: g++
Linker: glibtool
Linker: glibtool
Compiler options:
- -Os
- -pedantic
- -Werror
- -Wall
- -Wextra
- -Wmissing-braces
- -Wmissing-field-initializers
- -Wmissing-prototypes
- -Wparentheses
- -Wreturn-type
- -Wshadow
- -Wsign-compare
- -Wswitch
- -Wuninitialized
- -Wunknown-pragmas
- -Wunused-function
- -Wunused-label
- -Wunused-parameter
- -Wunused-value
- -Wunused-variable
Objective-C
Compiler: gcc
Linker: glibtool
Linker: glibtool
Compiler options:
- -std=c99
- -Os
- -pedantic
- -Werror
- -Wall
- -Wextra
- -Wbad-function-cast
- -Wdeclaration-after-statement
- -Werror-implicit-function-declaration
- -Wmissing-braces
- -Wmissing-declarations
- -Wmissing-field-initializers
- -Wmissing-prototypes
- -Wnested-externs
- -Wold-style-definition
- -Wparentheses
- -Wreturn-type
- -Wshadow
- -Wsign-compare
- -Wstrict-prototypes
- -Wstrict-selector-match
- -Wswitch
- -Wundeclared-selector
- -Wuninitialized
- -Wunknown-pragmas
- -Wunused-function
- -Wunused-label
- -Wunused-parameter
- -Wunused-value
- -Wunused-variable