Skip to content

Commit

Permalink
[mms-engine] Don't mess with CFLAGS because it's passed to submakes
Browse files Browse the repository at this point in the history
  • Loading branch information
monich committed Mar 7, 2016
1 parent a2b71f7 commit 9b07b61
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions mms-engine/Makefile
Expand Up @@ -101,13 +101,15 @@ MMS_SETTINGS_RELEASE_LIB = $(MMS_SETTINGS_BUILD_DIR)/release/$(MMS_SETTINGS_LIB)
CC = $(CROSS_COMPILE)gcc
LD = $(CC)
DEBUG_FLAGS = -g
RELEASE_FLAGS = -O2
RELEASE_FLAGS =
DEBUG_DEFS = -DDEBUG
RELEASE_DEFS =
WARN = -Wall
CFLAGS = -fPIC $(shell pkg-config --cflags $(PKGS)) -I. -I$(GEN_DIR) \
-I$(MMS_LIB_DIR)/include -I$(MMS_CONNMAN_DIR)/include \
-I$(MMS_HANDLER_DIR)/include -I$(MMS_SETTINGS_DIR)/include -MMD
BASE_FLAGS = -fPIC $(CFLAGS)
FULL_CFLAGS = $(BASE_FLAGS) -I. -I$(GEN_DIR) -I$(MMS_LIB_DIR)/include \
-I$(MMS_CONNMAN_DIR)/include -I$(MMS_HANDLER_DIR)/include \
-I$(MMS_SETTINGS_DIR)/include -MMD -MP \
$(shell pkg-config --cflags $(PKGS))

ifndef KEEP_SYMBOLS
KEEP_SYMBOLS = 0
Expand All @@ -119,15 +121,17 @@ SUBMAKE_OPTS += KEEP_SYMBOLS=1
endif

ifdef MMS_ENGINE_VERSION
CFLAGS += -DMMS_ENGINE_VERSION="$(MMS_ENGINE_VERSION)"
FULL_CFLAGS += -DMMS_ENGINE_VERSION="$(MMS_ENGINE_VERSION)"
endif

ifdef SAILFISH
CFLAGS += -DSAILFISH
FULL_CFLAGS += -DSAILFISH
endif

DEBUG_CFLAGS = $(DEBUG_FLAGS) $(DEBUG_DEFS) $(CFLAGS)
RELEASE_CFLAGS = $(RELEASE_FLAGS) $(RELEASE_DEFS) $(CFLAGS)
DEBUG_CFLAGS = $(FULL_CFLAGS) $(DEBUG_FLAGS) -DDEBUG
RELEASE_CFLAGS = $(FULL_CFLAGS) $(RELEASE_FLAGS) -O2
DEBUG_LDFLAGS = $(LDFLAGS) $(DEBUG_FLAGS)
RELEASE_LDFLAGS = $(LDFLAGS) $(RELEASE_FLAGS)

LIBS = $(shell pkg-config --libs $(LIB_PKGS)) -lmagic -ljpeg $(RESIZE_LIBS)
DEBUG_LIBS = \
Expand Down Expand Up @@ -277,10 +281,10 @@ $(RELEASE_BUILD_DIR)/%.o : $(GEN_DIR)/%.c
$(CC) -c $(RELEASE_CFLAGS) -MT"$@" -MF"$(@:%.o=%.d)" $< -o $@

$(DEBUG_EXE): $(DEBUG_EXE_DEPS) $(DEBUG_OBJS)
$(LD) $(DEBUG_FLAGS) $(DEBUG_OBJS) $(DEBUG_LIBS) -o $@
$(LD) $(DEBUG_LDFLAGS) $(DEBUG_OBJS) $(DEBUG_LIBS) -o $@

$(RELEASE_EXE): $(RELEASE_EXE_DEPS) $(RELEASE_OBJS)
$(LD) $(RELEASE_FLAGS) $(RELEASE_OBJS) $(RELEASE_LIBS) -o $@
$(LD) $(RELEASE_LDFLAGS) $(RELEASE_OBJS) $(RELEASE_LIBS) -o $@
ifeq ($(KEEP_SYMBOLS),0)
strip $@
endif

0 comments on commit 9b07b61

Please sign in to comment.