Hi all. I posted yesterday as reguard as importing file C into nesC code. I solve my problem using the #include preprocessor directive and typing "make micaz sim" In this way the commands resulting are: /*Nesc Compilation */ ---------------- ncc -c -shared -fPIC -o build/micaz/sim.o -g -O0 -tossim -fnesc-nido-tosnodes=1000 -fnesc-simulate -fnesc-nido-motenumber=sim_node\(\) -finline-limit=100000 -Wall -Wshadow -Wnesc-all -target=micaz -fnesc-cfile=build/micaz/app.c -board=micasb -DIDENT_PROGRAM_NAME=\"BlinkAppC\" -DIDENT_USER_ID=\"penguin\" -DIDENT_HOSTNAME=\"penguin-laptop\" -DIDENT_USER_HASH=0xdef7cfbeL -DIDENT_UNIX_TIME=0x47a1e254L -DIDENT_UID_HASH=0x03770cc6L -Wno-nesc-data-race BlinkAppC.nc -fnesc-dump=components -fnesc-dump=variables -fnesc-dump=constants -fnesc-dump=typedefs -fnesc-dump=interfacedefs -fnesc-dump=tags -fnesc-dumpfile=app.xml ------------- /*Linking Tossim libraries fo simulation*/ ----------- compiling Python support and C libraries into pytossim.o, tossim.o, and c-support.o g++ -c -shared -fPIC -o build/micaz/pytossim.o -g -O0 [ETC...] g++ -c -shared -fPIC -o build/micaz/tossim.o -g -O0 -DIDENT_PROGRAM_NAME= [ETC...] g++ -c -shared -fPIC -o build/micaz/c-support.o -g -O0 -DIDENT_PROGRAM_NAME=[ETC...] linking into shared object ./_TOSSIMmodule.so g++ -shared -fPIC build/micaz/pytossim.o build/micaz/sim.o build/micaz/tossim.o build/micaz/c-support.o -lstdc++ -o _TOSSIMmodule.so copying Python script interface TOSSIM.py from lib/tossim to local directory ------------ Now, I would link use only "make micaz" to test my application using my sensors and I would link avoid using of #include. So, I must compile nesC and C file and then linking them. If I type "make micaz" the resulting command is only: ---- ncc -o build/micaz/main.exe -Os -finline-limit=100000 -Wall -Wshadow -Wnesc-all -target=micaz -fnesc-cfile=build/micaz/app.c -board=micasb -DIDENT_PROGRAM_NAME=\"BlinkAppC\" -DIDENT_USER_ID=\"penguin\" -DIDENT_HOSTNAME=\"penguin-laptop\" -DIDENT_USER_HASH=0xdef7cfbeL -DIDENT_UNIX_TIME=0x47a1e38fL -DIDENT_UID_HASH=0xc1f3e2d6L -fnesc-dump=wiring -fnesc-dump='interfaces(!abstract())' -fnesc-dump='referenced(interfacedefs, components)' -fnesc-dumpfile=build/micaz/wiring-check.xml BlinkAppC.nc -lm ---- How can I compile my C files together with the nesC file? And how can I link the resulting files from compilation? In previous post, David Gay tried to explain me a modified version of Makefile I can use, but it doesn't work :-( I hope my explation is good. Thanks in advance for your help.
Roberto
_______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
