Re: KDE2 helloworld.cpp
On Tue, Oct 01, 2002 at 09:31:10PM +1200, John Batistic wrote:
> On Tue, 2002-10-01 at 21:06, Colin Watson wrote:
> > On Tue, Oct 01, 2002 at 08:54:34PM +1200, John Batistic wrote:
> > > INCLUDES= -I/usr/share/qt/include -I/etc/kde2/include
> > > CFLAGS= -pipe -02 -fno-strength-reduce
> > > LFLAGS= -L/usr/share/qt/lib/ -L/usr/lib/kde2/lib -L/usr/X11R6/lib
> > > LIBS= -lqt -lX11 -ltext
> > > CC=g++
> > >
> > > helloworld: helloworld.o
> > > $(CC) $(LFLAGS) -o helloworld helloworld.o $(LIBS)
> > You don't actually mention either $(INCLUDES) or $(CFLAGS) in that rule,
> > so neither will be used.
> The reference I am using is the KDE Bible tutorial, which limits my
> knowledge to what it says.
> Man g++ appears to say that I should add -I$(INCLUDES) to the compiler
> command line, but trying that doesn't work.
> How should I add INCLUDES to the compiler rule?
Keep it simple and realize that this level of 'make' use is not all that
magic. '-I$(INCLUDES)' doesn't work because it expands to
'-I-I/usr/share/qt/include -I/etc/kde2/include', which is obviously
wrong. Just try this:
$(CC) $(INCLUDES) $(CFLAGS) $(LFLAGS) -o helloworld helloworld.o $(LIBS)
Colin Watson [email@example.com]