From cce508fed2b764d81a4b172597c15e648227402a Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Tue, 13 Jun 2017 12:51:54 +0200 Subject: inteltool/Makefile: Separate CPPFLAGS from CFLAGS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Separate the required CPPFLAGS from environment overridable CFLAGS. Change-Id: I0c1c0a1cebc7f7971634bf57d4a2370939c43fda Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/20175 Tested-by: build bot (Jenkins) Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Patrick Georgi Reviewed-by: Hannah Williams Reviewed-by: Paul Menzel --- util/inteltool/Makefile | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'util') 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) -- cgit v1.2.3