summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2012-08-15 23:06:32 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2012-08-15 23:06:32 +0000
commita8da224c63fd9e41d87e57f72050c0e23a285d86 (patch)
tree95a3ad39d807adcbbe17eadc31db374ee7f8bc9a
parentb7bce8a6cfedff9abcd806bdd7f0e6232f442943 (diff)
downloadast2050-flashrom-a8da224c63fd9e41d87e57f72050c0e23a285d86.zip
ast2050-flashrom-a8da224c63fd9e41d87e57f72050c0e23a285d86.tar.gz
Allow specifying CPPFLAGS
The user may know better which CFLAGS/CPPFLAGS are appropriate. Use flashrom_CFLAGS for flags which flashrom definitely needs to build. Thanks to Stefan Tauner for pointing out the flaw in r1574. Corresponding to flashrom svn r1575. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
-rw-r--r--Makefile6
-rw-r--r--util/ich_descriptors_tool/Makefile12
2 files changed, 9 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index c78f419..9309ce5 100644
--- a/Makefile
+++ b/Makefile
@@ -122,7 +122,7 @@ endif
ifeq ($(TARGET_OS), MinGW)
EXEC_SUFFIX := .exe
# MinGW doesn't have the ffs() function, but we can use gcc's __builtin_ffs().
-CPPFLAGS += -Dffs=__builtin_ffs
+FLASHROM_CFLAGS += -Dffs=__builtin_ffs
# libusb-win32/libftdi stuff is usually installed in /usr/local.
CPPFLAGS += -I/usr/local/include
LDFLAGS += -L/usr/local/lib
@@ -201,7 +201,7 @@ endif
endif
ifeq ($(TARGET_OS), libpayload)
-CPPFLAGS += -DSTANDALONE
+FLASHROM_CFLAGS += -DSTANDALONE
ifeq ($(CONFIG_DUMMY), yes)
UNSUPPORTED_FEATURES += CONFIG_DUMMY=yes
else
@@ -603,7 +603,7 @@ libflashrom.a: $(LIBFLASHROM_OBJS)
TAROPTIONS = $(shell LC_ALL=C tar --version|grep -q GNU && echo "--owner=root --group=root")
%.o: %.c .features
- $(CC) -MMD $(CFLAGS) $(CPPFLAGS) $(FEATURE_CFLAGS) $(SVNDEF) -o $@ -c $<
+ $(CC) -MMD $(CFLAGS) $(CPPFLAGS) $(FLASHROM_CFLAGS) $(FEATURE_CFLAGS) $(SVNDEF) -o $@ -c $<
# Make sure to add all names of generated binaries here.
# This includes all frontends and libflashrom.
diff --git a/util/ich_descriptors_tool/Makefile b/util/ich_descriptors_tool/Makefile
index 4d18aec..9cbc150 100644
--- a/util/ich_descriptors_tool/Makefile
+++ b/util/ich_descriptors_tool/Makefile
@@ -30,10 +30,10 @@ CFLAGS += -Werror
endif
-CPPFLAGS += -MMD -MP -MF $(DEPPATH)/$(@F).d
+FLASHROM_CFLAGS += -MMD -MP -MF $(DEPPATH)/$(@F).d
# enables functions that populate the descriptor structs from plain binary dumps
-CPPFLAGS += -D ICH_DESCRIPTORS_FROM_DUMP
-CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
+FLASHROM_CFLAGS += -D ICH_DESCRIPTORS_FROM_DUMP
+FLASHROM_CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
OBJ = $(OBJATH)/$(SRC:%.c=%.o)
@@ -42,15 +42,15 @@ SHAREDOBJ = $(OBJATH)/$(notdir $(SHAREDSRC:%.c=%.o))
all:$(PROGRAM)$(EXEC_SUFFIX)
$(OBJ): $(OBJATH)/%.o : %.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(FLASHROM_CFLAGS) -o $@ -c $<
# this enables us to share source files without simultaneously sharing .o files
# with flashrom, which would lead to unexpected results (w/o running make clean)
$(SHAREDOBJ): $(OBJATH)/%.o : $(SHAREDSRCDIR)/%.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(FLASHROM_CFLAGS) -o $@ -c $<
$(PROGRAM)$(EXEC_SUFFIX): $(OBJ) $(SHAREDOBJ)
- $(CC) -o $(PROGRAM)$(EXEC_SUFFIX) $(OBJ) $(SHAREDOBJ)
+ $(CC) $(LDFLAGS) -o $(PROGRAM)$(EXEC_SUFFIX) $(OBJ) $(SHAREDOBJ)
clean:
rm -f $(PROGRAM) $(PROGRAM).exe
OpenPOWER on IntegriCloud