From patchwork Wed Nov 19 18:31:28 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 9621 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9B14EDDDF0 for ; Thu, 20 Nov 2008 05:34:43 +1100 (EST) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.68 #1 (Red Hat Linux)) id 1L2rq2-0003ln-0H; Wed, 19 Nov 2008 18:31:42 +0000 Received: from relais.videotron.ca ([24.201.245.36]) by bombadil.infradead.org with esmtp (Exim 4.68 #1 (Red Hat Linux)) id 1L2rq0-0003lh-LJ for linux-mtd@lists.infradead.org; Wed, 19 Nov 2008 18:31:40 +0000 MIME-version: 1.0 Received: from xanadu.home ([66.131.194.97]) by VL-MH-MR002.ip.videotron.ca (Sun Java(tm) System Messaging Server 6.3-4.01 (built Aug 3 2007; 32bit)) with ESMTP id <0KAL008KZFGG1KJ0@VL-MH-MR002.ip.videotron.ca> for linux-mtd@lists.infradead.org; Wed, 19 Nov 2008 13:31:29 -0500 (EST) Date: Wed, 19 Nov 2008 13:31:28 -0500 (EST) From: Nicolas Pitre X-X-Sender: nico@xanadu.home To: linux-mtd@lists.infradead.org Subject: [PATCH mtd-utils] fix CFLAGS handling wrt cross compilation Message-id: User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) X-Spam-Score: 0.0 (/) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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 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