I have a simple generic Makefile that will use an explicit list of
sources, if defined, but otherwise uses "find" to get a list of
sources. This has two benefits:
1. I can do a quick compile of a directory of sources just by copying
my makefile to the directory and typing "make". Later, I can revise
the makefile to make it custom. In some ways, this use of my generic
makefile is just a way of enhancing make's built-in rules. For
instance, we can already "make program" without a makefile if
program.c exists in our current directory. But, I can "make
TARGET=program" with one or more sources in a directory with zero
changes to my makefile.
2. I can give this makefile to my non-makefile-savvy co-workers saving
me some time.
Notes:
- If you're going to recurse directories for sources, it also helps to
do the same for include directories.
- Writing the automatic dependency rules is just marginally more
difficult as you have to make sure that the dependency targets include
the /path/to/objects.o.
Harvey
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make