Mail Archives: djgpp/1997/01/06/10:11:50
On 6 Jan 1997, Alaric Dailey wrote:
> : all_subdirs=`cat $srcdir/*/PLUGIN/REQ $srcdir/*/PLUGIN/OPT /dev/null |
> : tsort | xargs echo`
>
> it looks like this is building a list of all the subdirectories under
> $srcdir (whereever this is defined in the makefile) catting the files
> (which will do the same thing as DOS "type" sorting the output making
> sure there are no duplicate listings and then xargs will put the whole
> damn shmear on a single line.
FYI, you can do the same on MSDOS even if you don't have bash installed.
If you use the port of Make 3.75, just replace the `..` with a call to the
$(shell) built-in function, like so:
subdir = $srcdir/*/PLUGIN
all_subdirs = \
$(shell cat $subdir/REQ $subdir/OPT /dev/null | tsort | xargs echo)
The difference between the two constructs is that in the last variant, the
commands are run when all_subdirs is *defined*, while in the second they
are run when all_subdirs is *used* (elsewhere in the Makefile).
- Raw text -