help-make
[Top][All Lists]
Advanced

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

Re: how to manage an unmanageable recursive make structure?


From: Alessandro Vesely
Subject: Re: how to manage an unmanageable recursive make structure?
Date: Tue, 11 Jan 2005 15:13:33 +0100

Robert,

Noel Yap wrote:
> 
> [...]
> The only robust (eg makes no assumptions about include path)
> solution is to #include "aoeu.h".  Also, since it first checks
> the includer's directory, it's also much faster than traversing
> the include path.

However, some (buggy?) compiler takes #include "aoeu.h" from the
current directory, which may be different from the source path
specified on the command line. Such ambiguity may result using
VPATH or vpath with GNU make.

On a general discussion level, I wouldn't strive for recursivity
if it's not designed into the project already. See, "Recursive
Make Considered Harmful"
http://www.pcug.org.au/~millerp/rmch/recu-make-cons-harm.html

As a practical hint, let me recall perl's substitution syntax:

   perl -p -i[ext] -e 'command' filename...

where `ext' is the extension to give to original files,
`filename' is the list of filenames (e.g. via find | xargs),
and `command' is typically a substitution regular expression,
for example:

   find . -name '*.[ch]' | xargs perl -p -iorig \
      -e 's|^(#\s*include\s+)"(../)+([^"]+)"|$1<$3>|'




reply via email to

[Prev in Thread] Current Thread [Next in Thread]