TARGET_DEBUGGING=-g3
endif
-TARGET_CFLAGS=$(TARGET_ABI) $(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING)
+TARGET_CPPFLAGS =
ifeq ($(BR2_LARGEFILE),y)
-TARGET_CFLAGS+=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+TARGET_CPPFLAGS += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
endif
-TARGET_CXXFLAGS=$(TARGET_CFLAGS)
-TARGET_LDFLAGS=$(call qstrip,$(BR2_TARGET_LDFLAGS))
+TARGET_CFLAGS = $(TARGET_CPPFLAGS) $(TARGET_ABI) $(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING)
+
+TARGET_CXXFLAGS = $(TARGET_CFLAGS)
+TARGET_LDFLAGS = $(call qstrip,$(BR2_TARGET_LDFLAGS))
ifeq ($(BR2_TOOLCHAIN_BUILDROOT)$(BR2_TOOLCHAIN_CTNG),y)
TARGET_CROSS=$(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-
BISON:=$(shell which bison || type -p bison)
SED:=$(shell which sed || type -p sed) -i -e
+HOST_CPPFLAGS = -I$(HOST_DIR)/usr/include
HOST_CFLAGS ?= -O2
-HOST_CFLAGS += -I$(HOST_DIR)/include -I$(HOST_DIR)/usr/include
-HOST_CXXFLAGS += -I$(HOST_DIR)/include -I$(HOST_DIR)/usr/include
+HOST_CFLAGS += $(HOST_CPPFLAGS)
+HOST_CXXFLAGS += $(HOST_CFLAGS)
HOST_LDFLAGS += -L$(HOST_DIR)/lib -L$(HOST_DIR)/usr/lib -Wl,-rpath,$(HOST_DIR)/usr/lib
HOST_PATH=$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(PATH)
CXX_FOR_BUILD="$(HOSTCXX)" \
FC_FOR_BUILD="$(HOSTFC)" \
LD_FOR_BUILD="$(HOSTLD)" \
+ CPPFLAGS_FOR_BUILD="$(HOST_CPPFLAGS)" \
CFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \
CXXFLAGS_FOR_BUILD="$(HOST_CXXFLAGS)" \
LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
FCFLAGS_FOR_BUILD="$(HOST_FCFLAGS)" \
DEFAULT_ASSEMBLER="$(TARGET_AS)" \
DEFAULT_LINKER="$(TARGET_LD)" \
+ CPPFLAGS="$(TARGET_CPPFLAGS)" \
CFLAGS="$(TARGET_CFLAGS)" \
CXXFLAGS="$(TARGET_CXXFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS)" \
GCC="$(HOSTCC)" \
CXX="$(HOSTCXX)" \
CPP="$(HOSTCPP)" \
+ CPPFLAGS="$(HOST_CPPFLAGS)" \
CFLAGS="$(HOST_CFLAGS)" \
CXXFLAGS="$(HOST_CXXFLAGS)" \
LDFLAGS="$(HOST_LDFLAGS)" \