Re: Making a Makefile



        The other day I was making a makefile
(which needed alot of fancy little features
i.e. $(wildcard ...) $(subst...) ...)
and I came across this link:

http://www.gnu.org/manual/manual.html

I'm _realy_ glad to know about this link and
_realy_ suprised that I didn't know it beforehand.

search make-3.79.1 in the page (or just make)

I've never seen makefile documentation this easy
to use and straight forward even in books.

in my opinion; the above link is a _must_ for
linux/gnu development.

Cheers,
        -Tristan


Thijs Assies wrote:

Kevin Mahoney wrote:

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


Making a Makefile is verry easy:

__________________________________

CFLAGS += -g3 -O2 `pkg-config --cflags gtk+-2.0`
        <-- watch the ` instead of '
LDFLAGS += `pkg-config --libs gtk+-2.0`


program_name:  mainwindow,o other.o file.o source.o
                       g++ $(CFLAGS) $(LDFLAGS) $* $+

------------------------------

thats all!

program_name should be the name of the ouput file. if you have the
sourcefiles called source1.c source2.c and source3.c    after the :
 there should be:  source1.o source2.o source3.o    Make sure that is is
on the same line of program_name: !!!!! if it doesnt fit on one line,
put an \ on the end of the first line.

like:

program_name:  source1.o\
                        source2.o\
                        source3.o

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



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