Unix Programming - simple makefile problem

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > June 2007 > simple makefile problem





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author simple makefile problem
bpatton

2007-06-15, 7:28 am

I know this has to be simple. but it doesn't work!!!!
GTKFLAGS := $(shell pkg-config gtk+-2.0 --cflags)

all :
@echo `pkg-config gtk+-2.0 --cflags`
@echo "GTKFLAGS = ${GTKFLAGS}"



THey both should produce the same lines, but GTKFLAGS is empty

Gianni Mariani

2007-06-15, 1:21 pm

bpatton wrote:
> I know this has to be simple. but it doesn't work!!!!
> GTKFLAGS := $(shell pkg-config gtk+-2.0 --cflags)
>
> all :
> @echo `pkg-config gtk+-2.0 --cflags`
> @echo "GTKFLAGS = ${GTKFLAGS}"


@echo "GTKFLAGS = $(GTKFLAGS)"

Or did you mean to export it ?

export GTKFLAGS := $(shell pkg-config gtk+-2.0 --cflags)

>
>
>
> THey both should produce the same lines, but GTKFLAGS is empty
>

Fred Kleinschmidt

2007-06-15, 1:21 pm


"bpatton" <bpatton@ti.com> wrote in message
news:1181907851.702789.115410@o61g2000hsh.googlegroups.com...
>I know this has to be simple. but it doesn't work!!!!
> GTKFLAGS := $(shell pkg-config gtk+-2.0 --cflags)
>
> all :
> @echo `pkg-config gtk+-2.0 --cflags`
> @echo "GTKFLAGS = ${GTKFLAGS}"
>
>
>
> THey both should produce the same lines, but GTKFLAGS is empty
>

You have spaces around the equals sign in the echo command.
Get rid of them.

I also presume the echo lines start with a tab, not a space.
--
Fred L. Kleinschmidt
Boeing Associate Technical Fellow
Aero Stability and Controls Computing


bpatton

2007-06-15, 1:21 pm

On Jun 15, 9:11 am, Gianni Mariani <gi3nos...@mariani.ws> wrote:[vbcol=seagreen]
> bpatton wrote:
>
>
> @echo "GTKFLAGS = $(GTKFLAGS)"
>
> Or did you mean to export it ?
>
> export GTKFLAGS := $(shell pkg-config gtk+-2.0 --cflags)
>
>
>

No intent to export it.
When I echo the variable ${GTKFLAGS} it is empty.

Maxim Yegorushkin

2007-06-15, 1:21 pm

On 15 Jun, 12:44, bpatton <bpat...@ti.com> wrote:
> I know this has to be simple. but it doesn't work!!!!
> GTKFLAGS := $(shell pkg-config gtk+-2.0 --cflags)
>
> all :
> @echo `pkg-config gtk+-2.0 --cflags`
> @echo "GTKFLAGS = ${GTKFLAGS}"
>
> THey both should produce the same lines, but GTKFLAGS is empty


And they do:

$ cat Makefile
GTKFLAGS := $(shell pkg-config gtk+-2.0 --cflags)

all :
@pkg-config gtk+-2.0 --cflags
@echo "GTKFLAGS = ${GTKFLAGS}"

$ make
-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/
atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/
glib-2.0 -I/usr/lib/glib-2.0/include
GTKFLAGS = -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/
include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/
include/glib-2.0 -I/usr/lib/glib-2.0/include


bpatton

2007-06-15, 1:21 pm

On Jun 15, 9:24 am, "Fred Kleinschmidt"
<fred.l.kleinmschm...@boeing.com> wrote:
> "bpatton" <bpat...@ti.com> wrote in message
>
> news:1181907851.702789.115410@o61g2000hsh.googlegroups.com...>I know this has to be simple. but it doesn't work!!!!
>
>
>
> You have spaces around the equals sign in the echo command.
> Get rid of them.
>
> I also presume the echo lines start with a tab, not a space.
> --
> Fred L. Kleinschmidt
> Boeing Associate Technical Fellow
> Aero Stability and Controls Computing

What effect can an = sign in a string have to effect the varialbe $
{GTKFLAGS} ?

bpatton

2007-06-15, 1:21 pm

On Jun 15, 10:25 am, Maxim Yegorushkin <maxim.yegorush...@gmail.com>
wrote:
> On 15 Jun, 12:44, bpatton <bpat...@ti.com> wrote:
>
>
>
>
> And they do:
>
> $ cat Makefile
> GTKFLAGS := $(shell pkg-config gtk+-2.0 --cflags)
>
> all :
> @pkg-config gtk+-2.0 --cflags
> @echo "GTKFLAGS = ${GTKFLAGS}"
>
> $ make
> -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/
> atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/
> glib-2.0 -I/usr/lib/glib-2.0/include
> GTKFLAGS = -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/
> include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/
> include/glib-2.0 -I/usr/lib/glib-2.0/include


I'm not getting anything . I'm using cygwin on PC (Pittyful Computer)

Gianni Mariani

2007-06-15, 7:27 pm

bpatton wrote:
> On Jun 15, 9:11 am, Gianni Mariani <gi3nos...@mariani.ws> wrote:
>
> No intent to export it.
> When I echo the variable ${GTKFLAGS} it is empty.
>


This is what I get running your original Makefile on cygwin.

$ make -f jnk.mf
-DXTHREADS -DXUSE_MTSAFE_API -I/usr/include/gtk-2.0
-I/usr/lib/gtk-2.0/include -
I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0
-I/usr/inclu
de/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
GTKFLAGS = -DXTHREADS -DXUSE_MTSAFE_API -I/usr/include/gtk-2.0
-I/usr/lib/gtk-2.
0/include -I/usr/X11R6/include -I/usr/include/atk-1.0
-I/usr/include/pango-1.0 -
I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com