Re: "Optional" variables ($?VAR)
Bram Moolenaar <[email protected]>
| Newsgroups | gmane.comp.tools.aap.devel |
|---|---|
| Message-ID | <[email protected]> |
Adriaan de Groot wrote:
> Sure. In most cases, :include am-wedge.aap is good enough (this is my
> automake-to-aap wedge, which does an :include Makefile.am and knows enough
> about automake to convert most of the targets to their AAP equivalents).
That sounds like a very clever thing!
> > 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
>
> [Still talking about _auto_makefiles.] One construction that comes back
> several times is for "variants" based on configure (autoconf) results. These
> look like
>
> if include_malconduit
> MAL_SUBDIR = malconduit
> endif
>
> where include_malconduit is defined by configure - and stored in a confusing
> place. As far as I can tell, grepping for 'include_malconduit_FALSE.*#' in
> config.status is all you can do (if found, include_malconduit is true).
I suppose you have to use the original configure for this. When using
Aap's new :conf command all the test results easily accessible.
Supporting the "if" statement of automake is quite a bit more
complicated. I doubt if we should really go this far. Especially
because you would also need to use AM_CONDITIONAL in configure.in. Your
mind would get twisted of this combination of configure/automake and Aap
recipes. Better convert it all to Aap then...
> Another is normal makefile targets, like this one:
>
> messages: rc.cpp
> $(EXTRACTRC) *.rc *.ui */*.ui >> rc.cpp
> $(XGETTEXT) *.h *.cpp */*.cpp */*.h -o $(podir)/kaddressbook.pot
>
> this construction falls under normal Makefile-reading rules.
Appending to the source file? That is an error in my opinion. It
should copy rc.cpp and append to that file. Otherwise rc.cpp will keep
on growing each time make is run (unless the context truncates it perhaps).
Ignoring this, prepending ":sys " to the lines will make it a valid Aap
dependency.
> A third is file inclusion:
>
> include ../admin/Doxyfile.am
>
> this inclusion mechanism is independent of GNU or BSD make.
Prepending a ":" to make it ":include" will work, I suppose.
> > 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".
>
> AAP's include reads everything relative to the current recipe, while make's
> include is, IIRC, relative to the file being processed (recipe or included
> file, it matters not). This makes nested includes work differently in AAP
> than in make.
You are confused with the ":child" command. ":include" does not change
directories and reads the included recipe into the current scope. Only
":child" changes directory and creates a new scope for the child recipe.
> And unfortunately, BSD make uses ".include" (possibly with <>
> as well) and GNU make uses plain "include".
BSD make also understands "include". Anyway, Aap can easily recognize
both. I don't think Makefiles exist where this causes problems.
--
hundred-and-one symptoms of being an internet addict:
173. You keep tracking down the email addresses of all your friends
(even childhood friends).
/// 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