All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH rt-tests] Makefile: complement user-supplied CFLAGS with needed parameters
@ 2013-07-16 15:51 Uwe Kleine-König
  2013-07-16 16:01 ` Uwe Kleine-König
  0 siblings, 1 reply; 2+ messages in thread
From: Uwe Kleine-König @ 2013-07-16 15:51 UTC (permalink / raw)
  To: linux-rt-users, Clark Williams, John Kacur; +Cc: Uwe Kleine-König

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

For compilation to work

	-D_GNU_SOURCE -Isrc/include

is needed to be passed to the compiler. For Debian packaging several
things are added to CFLAGS but not these two from above yielding compilation
errors, similar to:

	$ make CFLAGS=-Wall cyclictest
	cc -D VERSION_STRING=0.84 -c src/cyclictest/cyclictest.c -Wall
	In file included from src/cyclictest/cyclictest.c:37:0:
	src/cyclictest/rt_numa.h:17:22: fatal error: rt-utils.h: No such file or directory
	compilation terminated.
	make: *** [cyclictest.o] Error 1

So add the needed parameters 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 <u.kleine-koenig@pengutronix.de> 
---
 Makefile |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,8 @@ ifneq ($(filter x86_64 i386 ia64 mips po
 NUMA 	:= 1
 endif
 
-CFLAGS ?= -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include
+CFLAGS ?= -Wall -Wno-nonnull
+CPPFLAGS += -D_GNU_SOURCE -Isrc/include
 LDFLAGS ?=
 
 ifndef DEBUG
@@ -47,11 +48,11 @@ 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
-	@$(CC) -MM $(CFLAGS) $< | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' > $@ || rm -f $@
+	@$(CC) -MM $(CFLAGS) $(CPPFLAGS) $< | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' > $@ || rm -f $@
 
 .PHONY: all
 all: $(TARGETS) hwlatdetect
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH rt-tests] Makefile: complement user-supplied CFLAGS with needed parameters
  2013-07-16 15:51 [PATCH rt-tests] Makefile: complement user-supplied CFLAGS with needed parameters Uwe Kleine-König
@ 2013-07-16 16:01 ` Uwe Kleine-König
  0 siblings, 0 replies; 2+ messages in thread
From: Uwe Kleine-König @ 2013-07-16 16:01 UTC (permalink / raw)
  Cc: linux-rt-users, Clark Williams, John Kacur

Hello,

I just saw that a variant of this already went into 0.85, so just ignore
this patch.

Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-07-16 16:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-16 15:51 [PATCH rt-tests] Makefile: complement user-supplied CFLAGS with needed parameters Uwe Kleine-König
2013-07-16 16:01 ` Uwe Kleine-König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.