Re: Missing info about commands, variables and attributes

Magnus Therning <[email protected]> Mon, 26 Jul 2004 00:43:52 +0200
Newsgroups gmane.comp.tools.aap.user
Message-ID <[email protected]>
On Sun, Jul 25, 2004 at 06:17:13PM +0200, Bram Moolenaar wrote:
>
>Magnus Therning wrote:
>
>> After feeling a bit lost in using aap for some time I have finally
>> realised one thing that is missing from the documentation. I think it
>> would help me greatly in grokking how to use aap.
>> 
>> I would like to see info on what variables/attributes are used for each
>> command in the documentation. E.g. for :program I'd like to see
>> something like this:
>> 
>>  each C file is compiled like this:
>> 
>>   $(CC) $(CFLAGS) -o $(target) $(INCLUDE) $(source)
>> 
>>  each C++ file is compiled like this:
>> 
>>   $(CXX) $(CXXFLAGS) -o $(target) $(INCLUDE) $(source)
>>
>>  and the final executable is linked with:
>> 
>>   $(CC) -o $(target) $(add_LIBS) $(LIBS) $(source)
>>  or if there was at least one C++ file among the sources with:
>>   $(CXX) -o $(target) $(add_LIBS) $(LIBS) $(source)
>
>Unfortunately, this is not true.  It depends on what tools you are
>using.  For compiling with MSVC a different command is used.
>
>Flexibility has its price....

It should at least be possible to list what variables/attributes are
involved in the commands in aap, right? The names of the
variables/attributes should be quite self-explanatory.

The beginning of a list for :program would be:

 Variables:
   INCLUDE
   CFLAGS
   CXXFLAGS
   CC
   CXX
   LIBS
   LD
   LDFLAGS

 Attributes:
   add_LIBS
   add_LDFLAGS

>> P.S.
>> I found it very confusing that the following didn't do what I expected:
>> 
>>  :program { INCLUDE = -I../foo } bar : main.c
>> 
>> instead I needed to do this:
>> 
>>  INCLUDE = -I../foo
>>  :program bar : main.c
>> 
>> and $(INCLUDE) would then be used for _all_ compilations of C files
>> (which wasn't what I wanted).
>
>Did you try to use any of these:
>
>  :program bar { INCLUDE = -I../foo } : main.c

Don't work.

>  :program bar : { INCLUDE = -I../foo } main.c

Don't work.

>  :program bar : main.c { INCLUDE = -I../foo }

Don't work.

>Generally, an attribute comes after the item it applies to.  It's not
>always obvious where to put it in a command (unfortunately).

You are suggesting that each variable could be over-ridden by an
attribute for a specific file. That is clearly not so, and there also
seems to be some ambiguity of _when_ the attribute should come into play
(when building the file or when using the file).

/M

-- 
Magnus Therning                    (OpenPGP: 0xAB4DFBA4)
[email protected]
http://magnus.therning.org/

Some people, when confronted with a problem, think 'I know, I'll use
regular expressions.' Now they have two problems.
     -- Jamie Zawinski
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBBDeoiMWTaatN+6QRAhE5AKCN9ay/esBt0+Px15N8dMwgalosCwCdHw/2
UhOkEntBeJoSlq4+OtKB3fU=
=VINP
-----END PGP SIGNATURE-----