MESSAGE
DATE | 2004-08-19 |
FROM | Billy
|
SUBJECT | Re: [hangout] Makefile problem
|
On Wed, Aug 18, 2004 at 09:22:58PM -0400, Ruben Safir Secretary NYLXS wrote: > > I'm trying to use the new GTK 2 C binders and they are now recommending > a new scripting tool for the commandline options pkg-config
> It's output is as follows on this system: > > pkg-config --cflags --libs gtk+-2.0 > -I/opt/gnome/include/gtk-2.0 -I/opt/gnome/lib/gtk-2.0/include > -I/opt/gnome/include/atk-1.0 -I/opt/gnome/include/pango-1.0 > -I/usr/X11R6/include -I/usr/include/freetype2 > -I/opt/gnome/include/glib-2.0 -I/opt/gnome/lib/glib-2.0/include
> -Wl,--export-dynamic -L/opt/gnome/lib -lgtk-x11-2.0 -lgdk-x11-2.0 > -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 > -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 >
> So I'm creating a Makefile for a program we are writing and I can't > seem to get the libraries to substitute within the Makefile
> The Makefile is as follows: > > CC=gcc > LDLIBS= \ > -Wl,--export-dynamic -L/opt/gnome/lib -lgtk-x11-2.0 -lgdk-x11-2.0 \ > -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 \ > -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 > > CFLAGS= -Wall -g -O3 \ > -I/opt/gnome/lib/gtk-2.0/include -I/opt/gnome/include/atk-1.0 \ > -I/opt/gnome/include/pango-1.0 -I/usr/X11R6/include \ > -I/usr/include/freetype2 -I/opt/gnome/include/glib-2.0 \ > -I/opt/gnome/lib/glib-2.0/include > > INCLUDE= .
You're missing "-I/opt/gnome/include/gtk-2.0" in CFLAGS. Anyway, do yourself a favor and rewrite the Makefile...
# Ruben's new Makefile CFLAGS=-Wall -g -O3 LDFLAGS+=$(shell pkg-config --libs gtk+-2.0) CFLAGS+=$(shell pkg-config --cflags gtk+-2.0) clinical: clinical.o calculations.o front.o #EOF
That's it... let make do the rest of the work.
> clinical: clinical.o calculations.o front.o
> clinical.o: clinical.c > front.o: front.c > calculations.o: calculations.c
Make already knows these. Get rid of them.
> clinical.c: > $(CC) -I$(INCLUDE) $(LDLIBS) $(CFLAGS) -c clinical.c > calculations.c: > $(CC) -I$(INCLUDE) $(LDLIBS) $(CFLAGS) -c calculations.c > front.c: > $(CC) -I$(INCLUDE) $(LDLIBS) $(CFLAGS) -c front.c
What are these supposed to do? Get rid of them.
____________________________ NYLXS: New Yorker Free Software Users Scene Fair Use - because it's either fair use or useless.... NYLXS is a trademark of NYLXS, Inc
|
|