On Wed, Aug 5, 2015 at 12:38 PM, Bourgond Aries <[email protected]> wrote:
> I have a project with a lot of directories.
> I want to just build every .c file and dump the .o files in $(TOP)/temp/.
> Then I'd like to link them into an executable.
>
You can do something like this with the Lua parser:
Tupdefault.lua (at the top of your project):
tup.foreach_rule('*.c', 'gcc -c %f -o %o -I$(NETHACK_ROOT)/include',
{'%B.o', '$(NETHACK_ROOT)/<objs>'})
Tuprules.lua (at the top of your project):
NETHACK_ROOT = tup.getcwd()
Tupfile.lua (wherever you want to link everything):
tup.rule('$(NETHACK_ROOT)/<objs>', 'gcc -o %o %<objs>', 'nethack')
So three files in total, each one line.
>
> This is trivial with make.
>
I'd like to see this trivial Makefile.
> How is this done in tup?
> The single-tupfile-per-directory and similar limitations are not practical
> and they clutter.
> What am I supposed to do? Propagate the .o files up to the parent
> directory? What
> if the files have the same name?
>
If the files have the same name, won't you run into trouble putting
everything in $(TOP)/temp regardless?
-Mike
--
--
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.