How to compile a project on release-mode with Makefile? | OPTIMIZATION CFLAGS

Hello there everyone.

The config.make file does make some reference to PROJECT OPTIMIZATION CFLAGS.

# PROJECT_OPTIMIZATION_CFLAGS_RELEASE flags are only applied to RELEASE targets.
#
# (default) PROJECT_OPTIMIZATION_CFLAGS_RELEASE = (blank)

How can I call the compiler to use the “RELEASE target”? It is the default target?
Does anybody knows what flags are required to enable the release mode?
Or it is a feature for libraries and a custom compiling logic.

default is Release, so you’re good :sun_with_face:

you can check the common compile.project.mk (referenced by your project Makefile) the first line:

$ head -1 libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk
.DEFAULT_GOAL=Release

If you want to specify it when compiling, you can do it like this:

$ make Release
or 
$ make Debug

The difference of Debug / Release depends a bit on your OS/IDE. In short, Debug includes handy information for debugging tools, and Release is faster, because lighter. Though in most cases it’s not something you need to worry about too much and just compile release.

A good introduction to the structure of oF is here: https://openframeworks.cc/ofBook/chapters/setup_and_project_structure.html

1 Like

Thanks a lot :slight_smile:

1 Like