CFLAGS are passed to a C compiler, usually GCC in our case,
so the behavior depends on what gcc wants to do with arguments.
In the case of -I the common behavior is to add a directory to
the compile-time include-file search path. Directories are (usually)
searched in the order listed until the desired file is found,
and (again usually) it's not an error if the dir doesn't exist.
If the full path of search dir is the same as that of another
search dir, then they are the same dir...but I think what you
asked is if you have "mychip/chip" and "tos/chip" the first
file found will be used, so it depends on what order the dirs
are specified.

My belief is that PFLAGS in TOS makefiles does the same thing for NCC
(Preprocessor) and again include dirs are searched in the order speced.
NESCC has a bunch of (partially) hidden search dirs that it sticks
onto the end of whatever PFLAGS specifies. Those "hidden" dirs
may be found in the .platform file in later T1's, or reverse
engineered using the -v flag (which you can stick into PFLAGS).

MS


John Griessen wrote:
I am wanting to start using tinyos-2.x-contrib/ecosensory
as my tested code, and have a question about CFLAGS += -I

I see Makefile lines like:

CFLAGS += -I../../../tos/lib/extended_storage

and in that case,

ll ../../../tos/lib/extended_storage

finds something, but some contribs I browsed seem incomplete.

How will this extra includes search work?
I assume it wants unique dir names not found in the tinyos-2.x tree, right? For instance, if I put a new platform in tinyos-2.x-contrib/ecosensory/tos/platforms/ecosens1 directory I think
I will get a compilation that finds the ecosens1 platform directory,
but what about a chips dir?

What happens when a contributor puts a Makefile include to search out
another chips dir they have and with a chip of the same name as in the tinyos-2.x tree?

John Griessen
Still merging code in with the tinyos-2.x tree to run it...
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to