Hi Lorenzo,

On Wednesday 06 December 2006 03:22 am, Lorenzo Mainardi wrote:
> I would to know how to put all my files in a new
> directory, instead that in tos/, so I don't not spread my files in the tos
> directory. I think I should configurate my Makefile, how to do this?

You can add additional directories to the search path for the build by adding 
"-I<dir>" options to the PFLAGS variable.  So if I had some components in the 
subdirectory named foo, I could add this line to the Makefile:

PFLAGS += -Ifoo

Note that relative paths are anchored to the top directory of the project 
being built.

If you have a lot of shared code, you may want to do what we do.  We keep a 
"local" tos directory containing shared code we've developed and use between 
multiple projects.  The make snippet below includes a tree of shared code 
into projects that need it:

sdirs = $(shell find <basedir>/ -type d | grep -v -e unwanted -e patterns)
PFLAGS += $(patsubst %,-I%,$(sdirs))

Note that <basedir> should be the top level directory for shared code.  I've 
found that in cygwin environments, you need a '/' at the end of this 
directory name for the code to provide the desired results.  You can place 
the above code in a separate file, like 'custtos.mk', then use make's include 
directive to add it to project makefiles.

Hope you find this useful,
Steve
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to