Re: "Optional" variables ($?VAR)

Bram Moolenaar <[email protected]>
Newsgroups gmane.comp.tools.aap.devel
Message-ID <[email protected]>
Adriaan de Groot wrote:

> On Sunday 17 August 2003 16:52, Bram Moolenaar wrote:
> > I'm afraid I do not like global switches like this.  I have a lot of
> > experience what effect adding a global option has with Vim.  Main
> > problem is that the behavior of a recipe depends on the environment.
> > This has at least two problems:
> 
> Objections noted.
> 
> > Another solution would be to introduce a special command to read an
> > automake file.  Then it's clear that some special things happen when
> 
> But that's even more bloat and code to maintain for something you
> don't really want at all. If you want AAP to replace automake and
> make, then you'd prefer people to write AAP recipes instead of
> automake files and then running AAP over top of them. Perhaps a
> transitioning-from-automake-to-AAP tutorial would be more useful (I'll
> write one once I figure out just how :) )

Very often you find yourself in the situation that you are working with
an existing (big) project that uses make/automake/etc.  When you want to
start using Aap and other developers still use the old tools you can't
just convert files to Aap recipes, the old files will remain being used.
When making changes the two versions drift apart.  I would prefer to do
the conversion on the fly in this situation.  That's where the "read
automake file" command would be useful.

If you want to convert a project from using Makefiles to recipes then a
tool to do part of the conversion automatically would be useful.  It
doesn't need to do much more than putting ":sys " in front of shell
commands.  I don't think you would want to use $?VAR in place of $VAR
everywhere.  Thus you still need to go through the file to carefully
check for things that are different between a Makefile and a recipe.
For GNU Makefiles with variable-filtering it won't work anyway.

Since Aap is also to be used for porting existing software, I don't
object to the idea of reading a Makefile or automake-file.  Aap users
started using Aap because it works better than make, I don't have to
tell them to avoid using Makefiles.  When they do it anyway there
probably is a good reason for it (such as in your situation).

Since Aap intends to do everything that make does, adding a command that
includes a Makefile could be useful.  Especially when we explain the
restrictions.  For now I think we can read quite a few Makefiles when
supporting only a few things:

- Assume $?VAR everywhere.
- Put ":sys " in front of all shell commands.  Remove '-' and '@'.
- Interpret "include file" as ":include file".

Things that won't work:
- GNU make and BSD make specific features.
- Using environment variables.
- .SUFFIXES
- etc.

-- 
Did you ever see a "Hit any key to continue" message in a music piece?

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///          Creator of Vim - Vi IMproved -- http://www.Vim.org          \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
 \\\  Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html  ///


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.