Re: [PATCH v5 01/18] Makefile: pass CPPFLAGS through to fllow customization
From: Robin H. Johnson <hidden>
Date: 2016-06-15 22:48:48
On Fri, May 14, 2010 at 09:31:32AM +0000, Gary V. Vaughan wrote:
Without this patch there is no straight forward way to pass additional CPPFLAGS at configure-time. At TWW, everything non-vendor package is installed to its own subdirectory, so we need the following to show the preprocessor where the headers for the libraries we will link later can be found:
As a point of comparision, this is what we use in Gentoo, to allow us to
override many of the variables:
sed -i \
-e 's:^\(CFLAGS =\).*$:\1 $(OPTCFLAGS) -Wall:' \
-e 's:^\(LDFLAGS =\).*$:\1 $(OPTLDFLAGS):' \
-e 's:^\(CC = \).*$:\1$(OPTCC):' \
-e 's:^\(AR = \).*$:\1$(OPTAR):' \
Makefile || die "sed failed"
Which would be equivilent to changing the Makefile to have:
CFLAGS = $(OPTCFLAGS) -Wall
LDFLAGS = $(OPTLDFLAGS)
CC = $(OPTCC)
AR = $(OPTAR)
Thereafter, we pass in the relevant values for those variables.
CPPFLAGS is reserved for flags destined for ONLY the preprocessor, and we don't
want to introduce for that reason.
--
Robin Hugh Johnson
Gentoo Linux: Developer, Trustee & Infrastructure Lead
E-Mail : robbat2@gentoo.org
GnuPG FP : 11AC BA4F 4778 E3F6 E4ED F38E B27B 944E 3488 4E85