Linux

Tuesday, June 06, 2006

Makefile wildcards!

Blogging after a very long gap!

There came a need to compile all the c files in directory.Learnt that i need to make use of wildcards

a makefile to compile all C source files in the directory and then link them together could be written as follows:
objects := $(patsubst %.c,%.o,$(wildcard *.c))

foo : $(objects)
cc -o foo $(objects)

and a few pointers as usual

[1] http://www.metalshell.com/view/tutorial/120/
[2] http://theory.uwinnipeg.ca/localfiles/infofiles/make/make_25.html
[3] http://www.gnu.org/software/make/manual/make.html


Labels:

1 Comments:

Anonymous Anonymous said...

I found this site using [url=http://google.com]google.com[/url] And i want to thank you for your work. You have done really very good site. Great work, great site! Thank you!

Sorry for offtopic

November 09, 2009 3:21 AM  

Post a Comment

Subscribe to Post Comments [Atom]

<< Home