thank you. I could get it going, but, should I call the following a "bug"
or it is simply a missing feature?
./Tuprules.lua
PATH_ROOT = tup.getcwd()
./gen/Tupfile.lua
tup.rule({}, "echo 'int main() {}' > gen.c", {"gen.c", PATH_ROOT ..
"/<gen.c>"})
./src/Tupfile.lua
tup.rule({ PATH_ROOT .. "/<gen.c>" }, "gcc -c %<gen.c> -o %o", { '%B.o' } )
===
[root@bhlinv43 reference]# t
[ tup ] [0.000s] Scanning filesystem...
[ tup ] [0.001s] Reading in new environment variables...
[ tup ] [0.001s] No Tupfiles to parse.
[ tup ] [0.001s] No files to delete.
[ tup ] [0.001s] Executing Commands...
* 1) src: gcc -c %<gen.c> -o
tup: Expanded command string: gcc -c ../gen/gen.c -o
gcc: argument to '-o' is missing
*** tup errors ***
*** Command ID=49 failed with return value 1
[ ] 100%
*** tup: 1 job failed.
[root@bhlinv43 reference]#
As you can see, expanded command doesn't contain the file name. I'm forced
to hardcode the output file name.
or Am I using it incorrectly?
Regards,
venkrao
On Saturday, 26 July 2014 23:58:12 UTC+5:30, Freddie Chopin wrote:
>
> W dniu 2014-07-26 20:07, venkatakrishnarao ks pisze:
> >
> > Hi Mike,
> > Could you please give an example for using "generate source file" as
> > input file from a different directory than
> > the current compilation via groups?
> >
> > I've been having tough time implementing this with Lua parser.
> > My source code is generated by the RMI compiler in
> > directory cpp/aam/dm/management/idl/
> > My compilation runs in axcsw/src/aam/dm/management/rndsettings, but this
> > has to use the IDL generated source file from the above directory,
> > plus, some source files found in this source directory.
> >
> > I've a feeling that Tup has a bug in this feature, as it is failing to
> > recognize %<group_name> where my <group_name> is a group from a
> > different dir.
> > I've built tup from master as of today.
> >
> > Regards,
> > venkrao
>
>
> Groups are directory-specific, so if in folder a/ you add something to
> <group> and in folder b/ you require something from <group> you actually
> have two different containers. That's why you usually reference groups
> from top-level directory, using TUP_CWD.
>
> Here is a good example of what you want:
>
> > d:\1\tup>ls -R
> > .:
> > Tuprules.lua a b
> >
> > ./a:
> > Tupfile.lua
> >
> > ./b:
> > Tupfile.lua
> >
> > d:\1\tup>cat Tuprules.lua
> > TOP = tup.getcwd()
> >
> > d:\1\tup>cat a/Tupfile.lua
> > tup.rule({}, "echo generate > %o", {"generated.txt", TOP ..
> "/<generated>"})
> >
> > d:\1\tup>cat b/Tupfile.lua
> > tup.rule({TOP .. "/<generated>"}, "echo %<generated> > %o",
> {"generated-files.tx
> > t"})
> >
> > d:\1\tup>tup init
> > .tup repository initialized.
> >
> > d:\1\tup>tup
> > [ tup ] [0.091s] Scanning filesystem...
> > [ tup ] [0.239s] Reading in new environment variables...
> > [ tup ] [0.447s] Parsing Tupfiles...
> > 1) [0.001s] .
> > 2) [0.002s] a
> > 3) [0.002s] b
> > [ ] 100%
> > [ tup ] [0.456s] No files to delete.
> > [ tup ] [0.457s] Checking circular dependencies among groups...
> > [ tup ] [0.457s] Generating .gitignore files...
> > [ tup ] [0.558s] Executing Commands...
> > 1) [0.021s] a: echo generate > generated.txt
> > 2) [0.019s] b: echo %<generated> > generated-files.txt
> > [ ] 100%
> > [ tup ] [0.697s] Updated.
> >
> > d:\1\tup>ls -R
> > .:
> > Tuprules.lua a b
> >
> > ./a:
> > Tupfile.lua generated.txt
> >
> > ./b:
> > Tupfile.lua generated-files.txt
> >
> > d:\1\tup>cat a/generated.txt
> > generate
> >
> > d:\1\tup>cat b/generated-files.txt
> > ../a/generated.txt
> >
> > d:\1\tup>
>
> Hope this helps a bit (;
>
> Regards,
> FCh
>
>
--
--
tup-users mailing list
email: [email protected]
unsubscribe: [email protected]
options: http://groups.google.com/group/tup-users?hl=en
---
You received this message because you are subscribed to the Google Groups
"tup-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.