]> www.infradead.org Git - mtd-utils.git/commitdiff
ubi-utils: fix CFLAGS handling wrt cross compilation
authorNicolas Pitre <nico@cam.org>
Wed, 19 Nov 2008 18:31:28 +0000 (13:31 -0500)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Fri, 21 Nov 2008 12:15:21 +0000 (14:15 +0200)
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>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
ubi-utils/new-utils/Makefile

index ba4c20f2a8114bbc8f607bad7112684708c0461a..6fce7c622929b3ab088776f6deb10a569e09e4d8 100644 (file)
@@ -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