[oe] OT: cross compiling: `?=` or `+=` for `INCLUDES`
obi at opendreambox.org
Sun Dec 12 17:29:23 CET 2010
On 12/12/2010 04:53 PM, Paul Menzel wrote:
> Dear OE folks,
> what is the best practice for Makefiles with `INCLUDES`? On the VDR list
> it was requested to use `+=` instead of `?=`. 
> However, in the Makefile changes:
> -INCLUDES = -I/usr/include/freetype2
> +INCLUDES ?= -I/usr/include/freetype2
> Shouldn't that be += instead of ?=.
> In my case, my IDE sets INCLUDES with some custom stuff. Therefore the
> Makefile does not touch INCLUDES any more and I get an error.
> Is it common when changing `INCLUDES` that one has to take care about
> this by oneself, i. e. by adding `-I/usr/include/freetype2` to
> `INCLUDES`? Or is there a better way?
IMO you should use pkg-config or freetype-config instead, e.g.:
INCLUDES ?= `pkg-config --cflags freetype2`
or better, instead of using INCLUDES at all:
FREETYPE_CFLAGS ?= `pkg-config --cflags freetype2`
CFLAGS += $(FREETYPE_CFLAGS)
This will work in most environments.
More information about the Openembedded-devel