summaryrefslogtreecommitdiff
path: root/util/inteltool/Makefile
diff options
context:
space:
mode:
authorNico Huber <nico.huber@secunet.com>2017-06-13 12:51:54 +0200
committerPatrick Georgi <pgeorgi@google.com>2017-06-14 12:54:36 +0200
commitcce508fed2b764d81a4b172597c15e648227402a (patch)
treed7d214634f731af46b7127336f16aa59a9b3717f /util/inteltool/Makefile
parentbe3aa04f217cef8e0d6a19a40e9b2a0e6788be4d (diff)
downloadcoreboot-cce508fed2b764d81a4b172597c15e648227402a.tar.xz
inteltool/Makefile: Separate CPPFLAGS from CFLAGS
Separate the required CPPFLAGS from environment overridable CFLAGS. Change-Id: I0c1c0a1cebc7f7971634bf57d4a2370939c43fda Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: https://review.coreboot.org/20175 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com> Reviewed-by: Patrick Georgi <pgeorgi@google.com> Reviewed-by: Hannah Williams <hannah.williams@intel.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'util/inteltool/Makefile')
-rw-r--r--util/inteltool/Makefile17
1 files changed, 10 insertions, 7 deletions
diff --git a/util/inteltool/Makefile b/util/inteltool/Makefile
index b51f5a2ad8..e36560d6e1 100644
--- a/util/inteltool/Makefile
+++ b/util/inteltool/Makefile
@@ -22,9 +22,11 @@ top ?= $(abspath ../..)
CC ?= gcc
INSTALL ?= /usr/bin/install
PREFIX ?= /usr/local
-CFLAGS ?= -O2 -g -Wall -W -I$(top)/src/commonlib/include
+CFLAGS ?= -O2 -g -Wall -W
LDFLAGS += -lpci -lz
+CPPFLAGS += -I$(top)/src/commonlib/include
+
OBJS = inteltool.o cpu.o gpio.o rootcmplx.o powermgt.o memory.o pcie.o amb.o ivy_memory.o spi.o gfx.o ahci.o
OS_ARCH = $(shell uname)
@@ -32,19 +34,19 @@ ifeq ($(OS_ARCH), Darwin)
LDFLAGS += -framework DirectHW
endif
ifeq ($(OS_ARCH), FreeBSD)
-CFLAGS += -I/usr/local/include
+CPPFLAGS += -I/usr/local/include
LDFLAGS += -L/usr/local/lib
LIBS = -lz
endif
ifeq ($(OS_ARCH), NetBSD)
-CFLAGS += -I/usr/pkg/include
+CPPFLAGS += -I/usr/pkg/include
LDFLAGS += -L/usr/pkg/lib -Wl,-rpath-link,/usr/pkg/lib -lz -lpciutils -lpci -l$(shell uname -p)
endif
all: pciutils dep $(PROGRAM)
$(PROGRAM): $(OBJS)
- $(CC) $(CFLAGS) -o $(PROGRAM) $(OBJS) $(LDFLAGS)
+ $(CC) $(CFLAGS) $(CPPFLAGS) -o $(PROGRAM) $(OBJS) $(LDFLAGS)
clean:
rm -f $(PROGRAM) *.o *~ junit.xml
@@ -53,7 +55,7 @@ distclean: clean
rm -f .dependencies
dep:
- @$(CC) $(CFLAGS) -MM *.c > .dependencies
+ @$(CC) $(CFLAGS) $(CPPFLAGS) -MM *.c > .dependencies
define LIBPCI_TEST
/* Avoid a failing test due to libpci header symbol shadowing breakage */
@@ -77,8 +79,9 @@ export LIBPCI_TEST
pciutils:
@printf "\nChecking for pciutils and zlib... "
@echo "$$LIBPCI_TEST" > .test.c
- @$(CC) $(CFLAGS) .test.c -o .test $(LDFLAGS) >/dev/null 2>&1 && \
- printf "found.\n" || ( printf "not found.\n\n"; \
+ @$(CC) $(CFLAGS) $(CPPFLAGS) .test.c -o .test $(LDFLAGS) \
+ >/dev/null 2>&1 && \
+ printf "found.\n" || ( printf "not found.\n\n"; \
printf "Please install pciutils-devel and zlib-devel.\n"; \
printf "See README for more information.\n\n"; \
rm -f .test.c .test; exit 1)