* [PATCH mtd-utils] fix CFLAGS handling wrt cross compilation
@ 2008-11-19 18:31 Nicolas Pitre
2008-11-20 1:52 ` Mike Frysinger
2008-11-21 10:38 ` Artem Bityutskiy
0 siblings, 2 replies; 4+ messages in thread
From: Nicolas Pitre @ 2008-11-19 18:31 UTC (permalink / raw)
To: linux-mtd
Let's have the "new ubi-utils" makefile handle CFLAGS like the other
makefiles. This is important when cross compiling and CFLAGS is
externally provided. Without this, local include files are not found due
to the various -I arguments which are then lost.
Signed-off-by: Nicolas Pitre <nico@marvell.com>
diff --git a/ubi-utils/new-utils/Makefile b/ubi-utils/new-utils/Makefile
index ba4c20f..6fce7c6 100644
--- a/ubi-utils/new-utils/Makefile
+++ b/ubi-utils/new-utils/Makefile
@@ -2,7 +2,6 @@
# Makefile for ubi-utils
#
-OPTFLAGS := -O2 -Wall
KERNELHDR := ../../include
DESTDIR := /usr/local
SBINDIR=/usr/sbin
@@ -10,7 +9,8 @@ MANDIR=/usr/man
INCLUDEDIR=/usr/include
CC := $(CROSS)gcc
-CFLAGS := -Iinclude -Isrc -I$(KERNELHDR) $(OPTFLAGS) -Werror -Wall
+CFLAGS ?= -O2 -Wall
+CPPFLAGS := -Iinclude -Isrc -I$(KERNELHDR) $(CFLAGS) -Werror -Wall
LIBS = libubi libmtd libubigen libiniparser libscan
UTILS = ubiupdatevol ubimkvol ubirmvol ubicrc32 ubinfo ubiattach \
@@ -26,7 +26,7 @@ all: $(UTILS)
# The below is the rule to get an .o file from a .c file
%.o: %.c
- $(CC) $(CFLAGS) $< -c -o $@
+ $(CC) $(CPPFLAGS) $< -c -o $@
# And the below is the rule to get final executable from its .o and common.o
%: libubi.a %.o common.o
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH mtd-utils] fix CFLAGS handling wrt cross compilation
2008-11-19 18:31 [PATCH mtd-utils] fix CFLAGS handling wrt cross compilation Nicolas Pitre
@ 2008-11-20 1:52 ` Mike Frysinger
2008-11-21 10:41 ` Artem Bityutskiy
2008-11-21 10:38 ` Artem Bityutskiy
1 sibling, 1 reply; 4+ messages in thread
From: Mike Frysinger @ 2008-11-20 1:52 UTC (permalink / raw)
To: Nicolas Pitre; +Cc: linux-mtd
On Wed, Nov 19, 2008 at 13:31, Nicolas Pitre wrote:
> Let's have the "new ubi-utils" makefile handle CFLAGS like the other
> makefiles. This is important when cross compiling and CFLAGS is
> externally provided. Without this, local include files are not found due
> to the various -I arguments which are then lost.
>
> Signed-off-by: Nicolas Pitre <nico@marvell.com>
i dont think sticking CFLAGS into CPPFLAGS is right. they're separate
on purpose. you also break custom CPPFLAG injection here ... CPPFLAGS
should be treated just like CFLAGS: appended, not strictly set.
-mike
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH mtd-utils] fix CFLAGS handling wrt cross compilation
2008-11-19 18:31 [PATCH mtd-utils] fix CFLAGS handling wrt cross compilation Nicolas Pitre
2008-11-20 1:52 ` Mike Frysinger
@ 2008-11-21 10:38 ` Artem Bityutskiy
1 sibling, 0 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2008-11-21 10:38 UTC (permalink / raw)
To: Nicolas Pitre; +Cc: linux-mtd
On Wed, 2008-11-19 at 13:31 -0500, Nicolas Pitre wrote:
> Let's have the "new ubi-utils" makefile handle CFLAGS like the other
> makefiles. This is important when cross compiling and CFLAGS is
> externally provided. Without this, local include files are not found due
> to the various -I arguments which are then lost.
>
> Signed-off-by: Nicolas Pitre <nico@marvell.com>
Applied, thanks.
--
Best regards,
Artem Bityutskiy (Битюцкий Артём)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH mtd-utils] fix CFLAGS handling wrt cross compilation
2008-11-20 1:52 ` Mike Frysinger
@ 2008-11-21 10:41 ` Artem Bityutskiy
0 siblings, 0 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2008-11-21 10:41 UTC (permalink / raw)
To: Mike Frysinger; +Cc: linux-mtd, Nicolas Pitre
On Wed, 2008-11-19 at 20:52 -0500, Mike Frysinger wrote:
> On Wed, Nov 19, 2008 at 13:31, Nicolas Pitre wrote:
> > Let's have the "new ubi-utils" makefile handle CFLAGS like the other
> > makefiles. This is important when cross compiling and CFLAGS is
> > externally provided. Without this, local include files are not found due
> > to the various -I arguments which are then lost.
> >
> > Signed-off-by: Nicolas Pitre <nico@marvell.com>
>
> i dont think sticking CFLAGS into CPPFLAGS is right. they're separate
> on purpose. you also break custom CPPFLAG injection here ... CPPFLAGS
> should be treated just like CFLAGS: appended, not strictly set.
May be, I'm bad in Makefile stuff. But this is what the rest of Makefile
files in mtd-utils do, so I've applied Nicolas' patch.
--
Best regards,
Artem Bityutskiy (Битюцкий Артём)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-11-21 10:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-19 18:31 [PATCH mtd-utils] fix CFLAGS handling wrt cross compilation Nicolas Pitre
2008-11-20 1:52 ` Mike Frysinger
2008-11-21 10:41 ` Artem Bityutskiy
2008-11-21 10:38 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox