On Tue, Mar 3, 2009 at 1:22 PM, Achugatla, Vijay K. (LNG-CON) <[email protected]> wrote: ... > The info at http://make.paulandlesley.org/autodep.html is really useful.
Great! ... > But I have a 100s of files in a directory. I can not give the names of all > the files inside the Makefile. ... > Is there any option or directive available in GNU make that searches a > directory and gets the names of all the files available in that and then > store that in a variable? Have you looked at the manual? Check here, for one place: http://www.gnu.org/software/make/manual/make.html#File-Name-Functions You can always do something like: SRC1 := ./somdir/*.cc And then use text functions on the list. > Also any idea how to set a destination directory? I mean I want to store all > the object files in a directory and the executable in another directory. How > to achieve that? See here for some discussions on installation: http://www.gnu.org/software/make/manual/make.html#Install-Command-Categories One way to "store" files by type in different directories is with special targets: store_obj: <tab> mv $(OBJ) $(OBJ_STO_DIR) Or use the file/text functions to manipulate the desired directory in your build targets. Lots of ways to things. There are many examples of Makefiles on sourceforge.net and gcc.org There is also the book from O'Reilly: http://oreilly.com/catalog/9780596006105/index.html -Tom _______________________________________________ Help-make mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-make
