Thread: [A-a-p-user] Missing info about commands, variables and attributes
Brought to you by:
vimboss
From: Magnus T. <ma...@th...> - 2004-07-25 15:31:23
|
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) I'd also like to have it clearly marked what is a variable and what is an attribute (and in the case of attributes: an attribute of what). /M P.S. I found it very confusing that the following didn't do what I expected: :program { INCLUDE =3D -I../foo } bar : main.c instead I needed to do this: INCLUDE =3D -I../foo :program bar : main.c and $(INCLUDE) would then be used for _all_ compilations of C files (which wasn't what I wanted). --=20 Magnus Therning (OpenPGP: 0xAB4DFBA4) ma...@th... http://magnus.therning.org/ You call it untidy, I call it LRU ordered -- Daniel Barlow |
From: Bram M. <Br...@mo...> - 2004-07-25 16:17:26
|
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.... > I'd also like to have it clearly marked what is a variable and what is > an attribute (and in the case of attributes: an attribute of what). Attributes are used for items (file names) and for commands. A variable is a string of characters, it can have items (file names) and attributes. > 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 :program bar : { INCLUDE = -I../foo } main.c :program bar : main.c { INCLUDE = -I../foo } Generally, an attribute comes after the item it applies to. It's not always obvious where to put it in a command (unfortunately). -- hundred-and-one symptoms of being an internet addict: 87. Everyone you know asks why your phone line is always busy ...and you tell them to send an e-mail. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html /// |
From: Magnus T. <ma...@th...> - 2004-07-25 22:44:01
|
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. >>=20 >> 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: >>=20 >> each C file is compiled like this: >>=20 >> $(CC) $(CFLAGS) -o $(target) $(INCLUDE) $(source) >>=20 >> each C++ file is compiled like this: >>=20 >> $(CXX) $(CXXFLAGS) -o $(target) $(INCLUDE) $(source) >> >> and the final executable is linked with: >>=20 >> $(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: >>=20 >> :program { INCLUDE =3D -I../foo } bar : main.c >>=20 >> instead I needed to do this: >>=20 >> INCLUDE =3D -I../foo >> :program bar : main.c >>=20 >> 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 =3D -I../foo } : main.c Don't work. > :program bar : { INCLUDE =3D -I../foo } main.c Don't work. > :program bar : main.c { INCLUDE =3D -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 --=20 Magnus Therning (OpenPGP: 0xAB4DFBA4) ma...@th... 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 |
From: Bram M. <Br...@mo...> - 2004-07-26 08:34:05
|
Magnus Therning wrote: > 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. I think they are quite obvious, if you have worked with other programs and make. > The beginning of a list for :program would be: > > Variables: > INCLUDE > CFLAGS > CXXFLAGS > CC > CXX > LIBS > LD > LDFLAGS There are quite a few more, and when using tools many more. It is not possible to give a complete list. Would an incomplete list of the most often used variables still be useful? > Attributes: > add_LIBS > add_LDFLAGS You can do that for all variables. > >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. It appears you have run into a bug. :program doesn't use the attributes on the sources as expected. You need to set the variable, and attribute doesn't work here. I'll have to think about how attributes on a source file are used. This should be consistent. -- From "know your smileys": :----} You lie like Pinocchio /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html /// |
From: Magnus T. <ma...@th...> - 2004-07-26 12:01:47
|
On Mon, Jul 26, 2004 at 10:33:52AM +0200, Bram Moolenaar wrote: > >Magnus Therning wrote: > >> 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. > >I think they are quite obvious, if you have worked with other programs >and make. Yes, for most, but it would be nice to have the info where it's needed, i.e. the info on what variables are used in :program is listed where :program is explained. >> The beginning of a list for :program would be: >>=20 >> Variables: >> INCLUDE >> CFLAGS >> CXXFLAGS >> CC >> CXX >> LIBS >> LD >> LDFLAGS > >There are quite a few more, and when using tools many more. It is not >possible to give a complete list. Would an incomplete list of the most >often used variables still be useful? Yes, I personally believe every tool should make it easy to perform the things most users do most of the time, or at least find documentation on the common usage scenarios. Maybe there isn't big enough a user community yet to do that though... >> Attributes: >> add_LIBS >> add_LDFLAGS > >You can do that for all variables. Well, it seems I can't. I tried with add_INCLUDE on both :program and :dll (for :program it might be related to what you say below). >> >Did you try to use any of these: >> > >> > :program bar { INCLUDE =3D -I../foo } : main.c >>=20 >> Don't work. >>=20 >> > :program bar : { INCLUDE =3D -I../foo } main.c >>=20 >> Don't work. >>=20 >> > :program bar : main.c { INCLUDE =3D -I../foo } >>=20 >> Don't work. > >It appears you have run into a bug. :program doesn't use the >attributes on the sources as expected. You need to set the variable, >and attribute doesn't work here. I can report that :dll behaves the same way as :program >I'll have to think about how attributes on a source file are used. >This should be consistent. /M --=20 Magnus Therning (OpenPGP: 0xAB4DFBA4) ma...@th... http://magnus.therning.org/ X-Windows: ...You'll envy the dead. |