From dfcef6e557b7980a33aa30b45bde196ed1780eb1 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Tue, 16 Oct 2012 00:26:44 +0200 Subject: rt-tests Makefile: separate CFLAGS and CPPFLAGS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For compilation to work -D_GNU_SOURCE -Isrc/include is needed to be passed to the compiler. For Debian packaging several things are added but not these two from above. So be a bit more friendly and add them unconditionally. There is no harm if they are included in the user supplied CFLAGS and so passed twice. Moreover be a bit more correct about CFLAGS/CPPFLAGS. Both should be passed to the compiler with CFLAGS taking options for the compiler and CPPFLAGS taking options for the preprocessor. This is also needed for Debian packaging where the helper scripts set CPPFLAGS. Signed-off-by: Uwe Kleine-König Signed-off-by: John Kacur --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3a82407..a6f7a1b 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,8 @@ ifneq ($(filter x86_64 i386 ia64 mips powerpc,$(machinetype)),) NUMA := 1 endif -CFLAGS ?= -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include +CFLAGS ?= -Wall -Wno-nonnull +CPPFLAGS += -D_GNU_SOURCE -Isrc/include LDFLAGS ?= PYLIB := $(shell python -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib()') @@ -49,7 +50,7 @@ VPATH += src/lib VPATH += src/hackbench %.o: %.c - $(CC) -D VERSION_STRING=$(VERSION_STRING) -c $< $(CFLAGS) + $(CC) -D VERSION_STRING=$(VERSION_STRING) -c $< $(CFLAGS) $(CPPFLAGS) # Pattern rule to generate dependency files from .c files %.d: %.c -- cgit 1.2.3-korg