From: Mike Frysinger <vapier@gentoo.org>
To: linux-mtd@lists.infradead.org
Subject: [PATCH] respect CFLAGS/CPPFLAGS from build environment
Date: Wed, 11 Jun 2008 17:49:08 -0400 [thread overview]
Message-ID: <1213220948-30156-1-git-send-email-vapier@gentoo.org> (raw)
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
Makefile | 10 ++++++----
ubi-utils/Makefile | 9 +++++----
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/Makefile b/Makefile
index 9f5ef6c..6c13a5a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,15 @@
# -*- sh -*-
-OPTFLAGS := -O2 -Wall
SBINDIR=/usr/sbin
MANDIR=/usr/share/man
INCLUDEDIR=/usr/include
+
#CROSS=arm-linux-
CC := $(CROSS)gcc
-CFLAGS := -I./include $(OPTFLAGS)
+CFLAGS ?= -O2
+CFLAGS += -Wall
+CPPFLAGS += -I./include
ifeq ($(origin CROSS),undefined)
BUILDDIR := .
@@ -17,7 +19,7 @@ else
endif
ifeq ($(WITHOUT_XATTR), 1)
- CFLAGS += -DWITHOUT_XATTR
+ CPPFLAGS += -DWITHOUT_XATTR
endif
RAWTARGETS = ftl_format flash_erase flash_eraseall nanddump doc_loadbios \
@@ -38,7 +40,7 @@ SYMLINKS =
$(BUILDDIR)/%.o: %.c
mkdir -p $(BUILDDIR)
- $(CC) $(CFLAGS) -g -c -o $@ $< -g -Wp,-MD,$(BUILDDIR)/.$(<F).dep
+ $(CC) $(CPPFLAGS) $(CFLAGS) -g -c -o $@ $< -g -Wp,-MD,$(BUILDDIR)/.$(<F).dep
.SUFFIXES:
diff --git a/ubi-utils/Makefile b/ubi-utils/Makefile
index 0394eee..062cc32 100644
--- a/ubi-utils/Makefile
+++ b/ubi-utils/Makefile
@@ -2,7 +2,6 @@
# Makefile for ubi-utils
#
-OPTFLAGS := -O2 -g -Wall
KERNELHDR := ../include
DESTDIR := /usr/local
SBINDIR=/usr/sbin
@@ -10,8 +9,10 @@ MANDIR=/usr/share/man
INCLUDEDIR=/usr/include
CC := $(CROSS)gcc
-CFLAGS := -I./inc -I./src -I$(KERNELHDR) $(OPTFLAGS) -Werror \
- -Wwrite-strings -W -std=gnu99 -DPACKAGE_VERSION=\"1.0\"
+CFLAGS ?= -O2 -g -Werror
+CFLAGS += -Wall -Wwrite-strings -W
+CPPFLAGS += -I./inc -I./src -I$(KERNELHDR) \
+ -std=gnu99 -DPACKAGE_VERSION=\"1.0\"
PERLPROGS = mkpfi ubicrc32.pl
@@ -26,7 +27,7 @@ vpath %.c ./src
$(CC) $(LDFLAGS) -g -o $@ $^
%.o: %.c
- $(CC) $(CFLAGS) -g -c -o $@ $< -g -Wp,-MD,.$(shell basename $<).dep
+ $(CC) $(CPPFLAGS) $(CFLAGS) -g -c -o $@ $< -g -Wp,-MD,.$(shell basename $<).dep
all: $(TARGETS)
make -C new-utils
--
1.5.5.3
next reply other threads:[~2008-06-11 21:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-11 21:49 Mike Frysinger [this message]
2008-06-13 14:51 ` [PATCH] respect CFLAGS/CPPFLAGS from build environment Josh Boyer
2008-06-13 21:11 ` Mike Frysinger
2008-06-16 16:12 ` Josh Boyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1213220948-30156-1-git-send-email-vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox