All of lore.kernel.org
 help / color / mirror / Atom feed
* OT: cross compiling: `?=` or `+=` for `INCLUDES`
@ 2010-12-12 15:53 Paul Menzel
  2010-12-12 16:29 ` Andreas Oberritter
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Menzel @ 2010-12-12 15:53 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 836 bytes --]

Dear OE folks,


what is the best practice for Makefiles with `INCLUDES`? On the VDR list
it was requested to use `+=` instead of `?=`. [1]

        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?


Thanks,

Paul


[1] http://www.linuxtv.org/pipermail/vdr/2010-November/023953.html
[2] http://www.linuxtv.org/pipermail/vdr/2010-December/024019.html

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: OT: cross compiling: `?=` or `+=` for `INCLUDES`
  2010-12-12 15:53 OT: cross compiling: `?=` or `+=` for `INCLUDES` Paul Menzel
@ 2010-12-12 16:29 ` Andreas Oberritter
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Oberritter @ 2010-12-12 16:29 UTC (permalink / raw)
  To: openembedded-devel

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 `?=`. [1]
> 
>         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.

Regards,
Andreas



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-12-12 16:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-12 15:53 OT: cross compiling: `?=` or `+=` for `INCLUDES` Paul Menzel
2010-12-12 16:29 ` Andreas Oberritter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.