Re: Making a Makefile



---Reply to mail from Kevin Mahoney about Making a Makefile

A simple Makefile for GTK+ 2:

CC = gcc
CFLAGS = -Wall -g3

exec: exec.o
    $(CC) exec.o -o exec `pkg-config --libs gtk+-2.0`

exec.o: exec.c exec.h
    $(CC) -c exec.c -o exec.o $(CFLAGS) `pkg-config --cflags gtk+-2.0`

clean: 
    rm -f *.o exec


    Hope this will help u ;-)

Hi,
I am new to this list and makefiles.  From the online documentation I was 
able to compile a simple 1 file program using:


$ g++ -Wall -g helloworld.cpp -o helloworld `pkg-config --cflags gtk+-2.0` 
`pkg-config --libs gtk+-2.0`

I need help creating a makefile.  No big deal for this example but it will 
become necessary for larger programs.

Thanks,
Kevin


_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


---End reply

-- 
Linux - 'cause freedom belongs to the world!






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]