diff --git a/boards/native/drivers/Makefile b/boards/native/drivers/Makefile index f0516a8530..6e2c0a70b3 100644 --- a/boards/native/drivers/Makefile +++ b/boards/native/drivers/Makefile @@ -11,6 +11,8 @@ DEP = $(SRC:%.c=$(BINDIR)%.d) INCLUDES += -I$(RIOTBOARD)/native/include/ +EXCLUDES := -I$(RIOTBASE)/sys/posix/% + $(BINDIR)native_drivers.a: $(OBJ) @$(AR) rcs $(BINDIR)${ARCH} $(OBJ) @@ -19,7 +21,7 @@ $(BINDIR)native_drivers.a: $(OBJ) # compile and generate dependency info $(BINDIR)%.o: %.c - $(CC) $(CFLAGS) $(INCLUDES) $(BOARDINCLUDE) $(PROJECTINCLUDE) $(CPUINCLUDE) -c $*.c -o $(BINDIR)$*.o + $(CC) $(CFLAGS) $(filter-out $(EXCLUDES),$(INCLUDES)) $(BOARDINCLUDE) $(PROJECTINCLUDE) $(CPUINCLUDE) -c $*.c -o $(BINDIR)$*.o @$(CC) $(CFLAGS) $(INCLUDES) $(BOARDINCLUDE) $(PROJECTINCLUDE) $(CPUINCLUDE) -MM $*.c > $(BINDIR)$*.d @printf "$(BINDIR)" | cat - $(BINDIR)$*.d > /tmp/riot_out && mv /tmp/riot_out $(BINDIR)$*.d diff --git a/cpu/Makefile.include b/cpu/Makefile.include index e59606c7ef..5498061a25 100644 --- a/cpu/Makefile.include +++ b/cpu/Makefile.include @@ -15,5 +15,5 @@ ifeq ($(CPU),mc1322x) export INCLUDES += -I$(RIOTBASE)/cpu/arm_common/include endif ifeq ($(CPU),native) - export INCLUDES += -I$(RIOTBASE)/cpu/native/include + export INCLUDES += -I$(RIOTCPU)/native/include endif diff --git a/cpu/native/Makefile b/cpu/native/Makefile index 20840d66c5..d5d520f74b 100644 --- a/cpu/native/Makefile +++ b/cpu/native/Makefile @@ -1,6 +1,9 @@ MODULE = cpu INCLUDES += -I../include -I$(RIOTBASE)/core/include + +EXCLUDES := -I$(RIOTBASE)/sys/posix/% + DIRS = ifneq (,$(findstring rtc,$(USEMODULE))) DIRS += rtc @@ -14,6 +17,12 @@ all: $(BINDIR)$(MODULE).a include $(RIOTBASE)/Makefile.base +$(BINDIR)%.o: %.c + $(CC) $(CFLAGS) $(filter-out $(EXCLUDES),$(INCLUDES)) $(BOARDINCLUDE) $(PROJECTINCLUDE) $(CPUINCLUDE) -c $*.c -o $(BINDIR)$*.o + @$(CC) $(CFLAGS) $(INCLUDES) $(BOARDINCLUDE) $(PROJECTINCLUDE) $(CPUINCLUDE) -MM $*.c > $(BINDIR)$*.d + @printf "$(BINDIR)" | cat - $(BINDIR)$*.d > /tmp/riot_out && mv /tmp/riot_out $(BINDIR)$*.d + + clean:: @for i in $(DIRS) ; do "$(MAKE)" -C $$i clean ; done ; diff --git a/cpu/native/include/cpu-conf.h b/cpu/native/include/cpu-conf.h index 4ddd47a91a..edec5b5770 100644 --- a/cpu/native/include/cpu-conf.h +++ b/cpu/native/include/cpu-conf.h @@ -15,7 +15,6 @@ */ #ifndef CPUCONF_H_ #define CPUCONF_H_ -#include /* TODO: tighten stack sizes */ #ifdef __MACH__ /* OSX */ diff --git a/cpu/native/include/cpu.h b/cpu/native/include/cpu.h index 80e91d1e77..160a12eb2a 100644 --- a/cpu/native/include/cpu.h +++ b/cpu/native/include/cpu.h @@ -22,50 +22,14 @@ #ifndef _CPU_H #define _CPU_H -#include - -/* enable signal handler register access on different platforms - * check here for more: - * http://sourceforge.net/p/predef/wiki/OperatingSystems/ - */ -#ifdef BSD // BSD = (FreeBSD, Darwin, ...) -#ifndef _XOPEN_SOURCE -#define _XOPEN_SOURCE -#include -#undef _XOPEN_SOURCE -#else -#include -#endif -#elif defined(__linux__) -#ifndef _GNU_SOURCE -#define GNU_SOURCE -#include -#undef GNU_SOURCE -#else -#include -#endif -#endif // BSD/Linux - -#include "kernel_internal.h" -#include "sched.h" - #include "cpu-conf.h" /* TODO: choose better value? */ #define F_CPU 1000000 +/* TODO: remove once these have been removed from RIOT: */ void dINT(void); void eINT(void); -/** - * register interrupt handler handler for interrupt sig - */ -int register_interrupt(int sig, void (*handler)(void)); - -/** - * unregister interrupt handler for interrupt sig - */ -int unregister_interrupt(int sig); - /** @} */ #endif //_CPU_H diff --git a/cpu/native/include/native_internal.h b/cpu/native/include/native_internal.h index e7cf8c84eb..5ddc85f4db 100644 --- a/cpu/native/include/native_internal.h +++ b/cpu/native/include/native_internal.h @@ -12,7 +12,7 @@ #ifndef _NATIVE_INTERNAL_H #define _NATIVE_INTERNAL_H -//#include +#include /** * internal functions @@ -56,5 +56,44 @@ extern const char *_progname; extern fd_set _native_rfds; #endif + +/** + * register interrupt handler handler for interrupt sig + */ +int register_interrupt(int sig, void (*handler)(void)); + +/** + * unregister interrupt handler for interrupt sig + */ +int unregister_interrupt(int sig); + +//#include + +/* enable signal handler register access on different platforms + * check here for more: + * http://sourceforge.net/p/predef/wiki/OperatingSystems/ + */ +#ifdef BSD // BSD = (FreeBSD, Darwin, ...) +#ifndef _XOPEN_SOURCE +#define _XOPEN_SOURCE +#include +#undef _XOPEN_SOURCE +#else +#include +#endif +#elif defined(__linux__) +#ifndef _GNU_SOURCE +#define GNU_SOURCE +#include +#undef GNU_SOURCE +#else +#include +#endif +#endif // BSD/Linux + +#include "kernel_internal.h" +#include "sched.h" + + /** @} */ #endif /* _NATIVE_INTERNAL_H */ diff --git a/cpu/native/net/Makefile b/cpu/native/net/Makefile index 81c828ba24..3ce631f49c 100644 --- a/cpu/native/net/Makefile +++ b/cpu/native/net/Makefile @@ -1,6 +1,13 @@ INCLUDES += -I$(RIOTBASE)/core/include -I$(RIOTBASE)/sys/include +EXCLUDES := -I$(RIOTBASE)/sys/posix/% + MODULE = nativenet include $(MAKEBASE)/Makefile.base +$(BINDIR)%.o: %.c + $(CC) $(CFLAGS) $(filter-out $(EXCLUDES),$(INCLUDES)) $(BOARDINCLUDE) $(PROJECTINCLUDE) $(CPUINCLUDE) -c $*.c -o $(BINDIR)$*.o + @$(CC) $(CFLAGS) $(INCLUDES) $(BOARDINCLUDE) $(PROJECTINCLUDE) $(CPUINCLUDE) -MM $*.c > $(BINDIR)$*.d + @printf "$(BINDIR)" | cat - $(BINDIR)$*.d > /tmp/riot_out && mv /tmp/riot_out $(BINDIR)$*.d + diff --git a/cpu/native/net/interface.c b/cpu/native/net/interface.c index 70e8475bbc..a0fedc8845 100644 --- a/cpu/native/net/interface.c +++ b/cpu/native/net/interface.c @@ -27,6 +27,7 @@ #define ENABLE_DEBUG (0) #include "debug.h" #include "transceiver.h" +#include "msg.h" #include "tap.h" #include "nativenet.h"