We want to stick with the semantics defined by automake. In it *FLAGS are
user variables that should allow the user to override anything. Therefore,
we should not modify them in Makefile.rules at all.
The problem with the previous code was the following:
If config.target defined OMK_CFLAGS=-O0, then Makefile.rules defined
CFLAGS=-Wall -O2 and -O2 overrode the -O0.
This also fixes the test added in the previous commit.
# Makefile.rules - OCERA make framework common project rules -*- makefile-gmake -*-
#
# (C) Copyright 2003, 2006, 2007, 2008, 2009 by Pavel Pisa - OCERA team member
# Makefile.rules - OCERA make framework common project rules -*- makefile-gmake -*-
#
# (C) Copyright 2003, 2006, 2007, 2008, 2009 by Pavel Pisa - OCERA team member
-# (C) Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2013 by Michal Sojka - Czech Technical University, FEE, DCE
+# (C) Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2013, 2015 by Michal Sojka - Czech Technical University, FEE, DCE
#
# Homepage: http://rtime.felk.cvut.cz/omk/
# Version: @git-describe@
#
# Homepage: http://rtime.felk.cvut.cz/omk/
# Version: @git-describe@
LOCAL_BUILD_DIR = $(USER_OBJS_DIR)
LOCAL_BUILD_DIR = $(USER_OBJS_DIR)
-# Assign default values to CFLAGS variable. If the variable is defined
+# Assign default values to OMK_CFLAGS variable. If the variable is defined
# earlier (i.g. in config.omk), it is not overriden here.
# earlier (i.g. in config.omk), it is not overriden here.
-CFLAGS ?= -O2 -Wall
-CXXFLAGS ?= -O2 -Wall
+OMK_CFLAGS ?= -O2 -Wall
+OMK_CXXFLAGS ?= -O2 -Wall
-CPPFLAGS += -I $(USER_INCLUDE_DIR)
+INCLUDES += -I $(USER_INCLUDE_DIR)
LOADLIBES += -L$(USER_LIB_DIR)
LOADLIBES += -L$(USER_LIB_DIR)