diff --git a/board b/board index 182151f46326e9eb6c0c48bd2ac6438c66302a13..402bc0e1b920b54e1a87329d0b496fedfeafd811 160000 --- a/board +++ b/board @@ -1 +1 @@ -Subproject commit 182151f46326e9eb6c0c48bd2ac6438c66302a13 +Subproject commit 402bc0e1b920b54e1a87329d0b496fedfeafd811 diff --git a/core/makefile b/core/makefile index a3e669793a96d59a88072d4ed6ab4b3a5088c37b..ba54604b5c1de355ed8d76615038db5a8d9e7fd0 100644 --- a/core/makefile +++ b/core/makefile @@ -1,5 +1,5 @@ MODULE =core -INCLUDES = -Iinclude/ -I../sys/include -I../sys/lib -I../sys/drivers/include -I../cpu/$(CPU)/include/ -I../.. +INCLUDES = -Iinclude/ -I../sys/include -I../sys/lib -I../sys/drivers/include -I../cpu/$(CPU)/include/ -I../.. -I../drivers/include/ include $(RIOTBASE)/makefile.base diff --git a/drivers/cc110x_ng/cc110x_cc430.c b/cpu/cc430/cc110x_cc430.c similarity index 100% rename from drivers/cc110x_ng/cc110x_cc430.c rename to cpu/cc430/cc110x_cc430.c diff --git a/cpu/lpc2387/lpc2387-gpioint.c b/cpu/lpc2387/gpioint/lpc2387-gpioint.c similarity index 100% rename from cpu/lpc2387/lpc2387-gpioint.c rename to cpu/lpc2387/gpioint/lpc2387-gpioint.c diff --git a/cpu/lpc2387/gpioint/makefile b/cpu/lpc2387/gpioint/makefile new file mode 100644 index 0000000000000000000000000000000000000000..cf2b29f89140018d50ba9f538bfe982be38c73ba --- /dev/null +++ b/cpu/lpc2387/gpioint/makefile @@ -0,0 +1,6 @@ +INCLUDES = -I$(RIOTBASE)/drivers/include -I$(RIOTBASE)/sys/include -I../../net -I../include -I../../lib -I../../../.. -I../../../cpu/ -I../../../core/include -I../../ + +MODULE =gpioint + +include $(MAKEBASE)/makefile.base + diff --git a/cpu/lpc2387/makefile b/cpu/lpc2387/makefile index 9e47336715df125d0948248bd52bc4171ffe1643..a85865698aca4fd9bbaa2a59bfb0a24993e3c753 100644 --- a/cpu/lpc2387/makefile +++ b/cpu/lpc2387/makefile @@ -1,7 +1,16 @@ MODULE =cpu -INCLUDES = -Iinclude -Idrivers/include -I../arm_common/include -I../../sys/lib -I../../drivers/include -I../../core/include -I../../sys/include -I../../hal/include -I../../.. +INCLUDES = -I../include -Idrivers/include -I../arm_common/include -I../../sys/lib -I../../drivers/include -I../../core/include -I../../sys/include -I../../hal/include -I../../.. DIRS = +ifneq (,$(findstring gpioint,$(USEMODULE))) + DIRS += gpioint +endif +ifneq (,$(findstring mci,$(USEMODULE))) + DIRS += mci +endif +ifneq (,$(findstring rtc,$(USEMODULE))) + DIRS += rtc +endif all: $(BINDIR)$(MODULE).a @for i in $(DIRS) ; do $(MAKE) -C $$i ; done ; diff --git a/cpu/lpc2387/lpc2387-mci.c b/cpu/lpc2387/mci/lpc2387-mci.c similarity index 99% rename from cpu/lpc2387/lpc2387-mci.c rename to cpu/lpc2387/mci/lpc2387-mci.c index 8e044fd0e5b05ebe16d9cec28fdc4e36c933b0b4..255853f78a2a8bfb8781cb51d10d37b3479954dd 100644 --- a/cpu/lpc2387/lpc2387-mci.c +++ b/cpu/lpc2387/mci/lpc2387-mci.c @@ -18,7 +18,7 @@ #include "hwtimer.h" #include "diskio.h" -#define ENABLE_DEBUG +//#define ENABLE_DEBUG #include "debug.h" extern unsigned long hwtimer_now(void); diff --git a/cpu/lpc2387/mci/makefile b/cpu/lpc2387/mci/makefile new file mode 100644 index 0000000000000000000000000000000000000000..cdffdd035de4fcdcf7f3ab85f326f8eacab1babd --- /dev/null +++ b/cpu/lpc2387/mci/makefile @@ -0,0 +1,6 @@ +INCLUDES = -I$(RIOTBASE)/drivers/include -I$(RIOTBASE)/sys/include -I../../net -I../include -I../../lib -I../../../.. -I../../../cpu/ -I../../../core/include -I../../ + +MODULE =mci + +include $(MAKEBASE)/makefile.base + diff --git a/cpu/lpc2387/lpc2387-rtc.c b/cpu/lpc2387/rtc/lpc2387-rtc.c similarity index 100% rename from cpu/lpc2387/lpc2387-rtc.c rename to cpu/lpc2387/rtc/lpc2387-rtc.c diff --git a/cpu/lpc2387/rtc/makefile b/cpu/lpc2387/rtc/makefile new file mode 100644 index 0000000000000000000000000000000000000000..b3b66a79c80cfb25331337535410b820218d4d7e --- /dev/null +++ b/cpu/lpc2387/rtc/makefile @@ -0,0 +1,6 @@ +INCLUDES = -I$(RIOTBASE)/drivers/include -I$(RIOTBASE)/core/include + +MODULE =rtc + +include $(MAKEBASE)/makefile.base + diff --git a/dist/makefile b/dist/makefile index adcc39502b7c0f5dfc72ac323ae8b4221f406f6a..33919a7b18bb0bcaa7a7502f63ceb84170f2707d 100644 --- a/dist/makefile +++ b/dist/makefile @@ -9,7 +9,7 @@ #### Mandatory vars! -# this has to be the absolute path of the feuerware-base dir +# this has to be the absolute path of the RIOT-base dir export RIOTBASE =$(CURDIR)/../RIOT export RIOTBOARD =$(CURDIR)/../RIOT/board @@ -26,9 +26,17 @@ export AS = $(PREFIX)as export LINK = $(PREFIX)gcc export SIZE = $(PREFIX)size export OBJCOPY = $(PREFIX)objcopy +FLASH = lpc2k_pgm +TERM = pyterm.py LINKFLAGS = -gdwarf-2 -mcpu=arm7tdmi-s -static -lgcc -nostartfiles -T$(RIOTBASE)/cpu/$(CPU)/linkerscript.x -## Modules to include. No autodependencies! +PROJBINDIR = bin + +ifeq ($(strip $(PORT)),) + PORT = /dev/ttyUSB0 +endif + +## Modules to include. #USEMODULE += nanopan5375_proprietary #USEMODULE += sys @@ -57,9 +65,6 @@ LINKFLAGS = -gdwarf-2 -mcpu=arm7tdmi-s -static -lgcc -nostartfiles -T$(RIOTBASE) #USEMODULE += net_kernel #USEMODULE += net_mm -# mandatory include! -include $(RIOTBASE)/makefile.modules - #### Project Config # name of your project @@ -68,6 +73,9 @@ PROJECT = hello-world # for easy switching of boards export BOARD = msba2 +# mandatory include! +include $(RIOTBASE)/makefile.modules + # if you want to publish the board into the sources as an uppercase #define BB = $(shell echo $(BOARD)|tr 'a-z' 'A-Z') CFLAGS += -DBOARD_$(BB) @@ -75,31 +83,37 @@ export CFLAGS # your binaries to link BASELIBS += $(RIOTBOARD)/$(BOARD)/bin/$(BOARD)_base.a -BASELIBS += bin/project.a +BASELIBS += $(PROJBINDIR)/project.a -INCLUDES = -I$(RIOTBOARD)/$(BOARD)/include -I$(RIOTBASE)/core/include -I$(RIOTBASE)/cpu/$(CPU)/include -I$(RIOTBASE)/cpu/arm_common/include -I$(RIOTBASE)/sys/lib +INCLUDES = -I$(RIOTBOARD)/$(BOARD)/include -I$(RIOTBASE)/core/include -I$(RIOTBASE)/cpu/$(CPU)/include -I$(RIOTBASE)/cpu/arm_common/include -I$(RIOTBASE)/sys/lib -I$(RIOTBASE)/sys/include/ -I$(RIOTBASE)/drivers/include/ export INCLUDES -## make script for your project. Build feuerware-base here! -all: bin/$(PROJECT).a +## make script for your project. Build RIOT-base here! +all: $(PROJBINDIR)/$(PROJECT).a + @echo "Building project $(PROJECT) for $(BOARD) w/ MCU $(CPU)." $(MAKE) -C $(RIOTBOARD) $(MAKE) -C $(RIOTBASE) - $(LINK) $(LINKFLAGS) $(UNDEF) -o bin/$(PROJECT).elf -Wl,--start-group $(BASELIBS) -lm -Wl,--end-group -Wl,-Map=bin/$(PROJECT).map - $(SIZE) bin/$(PROJECT).elf - $(OBJCOPY) -O ihex bin/$(PROJECT).elf bin/$(PROJECT).hex + $(LINK) $(LINKFLAGS) $(UNDEF) -o $(PROJBINDIR)/$(PROJECT).elf -Wl,--start-group $(BASELIBS) -lm -Wl,--end-group -Wl,-Map=$(PROJBINDIR)/$(PROJECT).map + $(SIZE) $(PROJBINDIR)/$(PROJECT).elf + $(OBJCOPY) -O ihex $(PROJBINDIR)/$(PROJECT).elf $(PROJBINDIR)/$(PROJECT).hex ## your make rules ## Only basic example - modify it for larger projects!! -bin/$(PROJECT).a: bin/$(PROJECT).o - $(AR) -rc bin/project.a bin/$(PROJECT).o +$(PROJBINDIR)/$(PROJECT).a: $(PROJBINDIR)/$(PROJECT).o + $(AR) -rc $(PROJBINDIR)/project.a $(PROJBINDIR)/$(PROJECT).o -bin/$(PROJECT).o: main.c - $(CC) $(CFLAGS) $(BOARDINCLUDE) $(INCLUDES) -c main.c -o bin/$(PROJECT).o +$(PROJBINDIR)/$(PROJECT).o: main.c + $(CC) $(CFLAGS) $(BOARDINCLUDE) $(INCLUDES) -c main.c -o $(PROJBINDIR)/$(PROJECT).o clean: $(MAKE) -C $(RIOTBOARD) clean $(MAKE) -C $(RIOTBASE) clean - rm -f bin/* - + rm -f $(PROJBINDIR)/* + +flash: all + $(FLASH) $(PORT) $(PROJBINDIR)/$(PROJECT).hex + +term: + $(TERM) $(PORT) diff --git a/drivers/cc110x/makefile b/drivers/cc110x/makefile index b2e804282580283c3ce61a296242d6b520cd2856..b3519713c795f95e232711f16d6bd5d66ee3e264 100644 --- a/drivers/cc110x/makefile +++ b/drivers/cc110x/makefile @@ -1,6 +1,6 @@ -INCLUDES = -I../../include -I../../net -I../include -I../../lib -I../../../.. -I../../../cpu/ -I../../../core/include -I../../ +INCLUDES = -I$(RIOTBASE)/sys/include -I../../net -I../include -I../../lib -I../../../.. -I../../../cpu/ -I../../../core/include -I../../ -MODULE =cc110x +MODULE =cc110x_ng include $(MAKEBASE)/makefile.base diff --git a/drivers/cc110x_ng/makefile b/drivers/cc110x_ng/makefile index f8a7cfa78dbcb67d1fe11b7790ba847d320cd02e..c6490934a20249eb6eccf21f5df15c300d555193 100644 --- a/drivers/cc110x_ng/makefile +++ b/drivers/cc110x_ng/makefile @@ -1,5 +1,16 @@ -INCLUDES = -I../../include -I../../net -I../include -I../../lib -I../../../.. -I../../../cpu/ -I../../../core/include -I../../ -Iinclude/ +INCLUDES = -I$(RIOTBASE)/sys/include -I../../net -I../include -I../../lib -I../../../.. -I../../../cpu/ -I$(RIOTBASE)/core/include -I../../ -Iinclude/ MODULE =cc110x_ng -include $(MAKEBASE)/makefile.base +DIRS = +ifneq (,$(findstring msba2,$(BOARD))) + DIRS += spi +endif + +all: $(BINDIR)$(MODULE).a + @for i in $(DIRS) ; do $(MAKE) -C $$i ; done ; + +include $(RIOTBASE)/makefile.base + +clean:: + @for i in $(DIRS) ; do $(MAKE) -C $$i clean ; done ; diff --git a/drivers/cc110x_ng/cc110x_spi.c b/drivers/cc110x_ng/spi/cc110x_spi.c similarity index 100% rename from drivers/cc110x_ng/cc110x_spi.c rename to drivers/cc110x_ng/spi/cc110x_spi.c diff --git a/drivers/cc110x_ng/spi/makefile b/drivers/cc110x_ng/spi/makefile new file mode 100644 index 0000000000000000000000000000000000000000..1d02bec101cb2ebcdc0746f4f3d8018f2d4ee267 --- /dev/null +++ b/drivers/cc110x_ng/spi/makefile @@ -0,0 +1,6 @@ +INCLUDES = -I$(RIOTBASE)/sys/include -I../../net -I../include -I../../lib -I../../../.. -I../../../cpu/ -I$(RIOTBASE)/core/include -I../../ -Iinclude/ + +MODULE =cc110x_spi + +include $(MAKEBASE)/makefile.base + diff --git a/drivers/ltc4150/ltc4150.c b/drivers/ltc4150/ltc4150.c index 9f4134b5c94b79583ecb79221c76242907255d94..70c4a4ac11d075c0e2481f4539ad2fac31b30f5a 100644 --- a/drivers/ltc4150/ltc4150.c +++ b/drivers/ltc4150/ltc4150.c @@ -58,15 +58,15 @@ static double mAh_to_Joule(double mAh) { return (SUPPLY_VOLTAGE * mAh * 3600); } -uint32_t ltc4150_get_last_int_duration_us() { +uint32_t ltc4150_get_last_int_duration_us(void) { return HWTIMER_TICKS_TO_US(last_int_duration); } -double ltc4150_get_current_mA() { +double ltc4150_get_current_mA(void) { return 1000000000/(ltc4150_get_last_int_duration_us()*(_GFH * _R_SENSE)); } -double __attribute__((__no_instrument_function__)) ltc4150_get_total_mAh() { +double __attribute__((__no_instrument_function__)) ltc4150_get_total_mAh(void) { return coulomb_to_mA(int_to_coulomb(int_count)); } @@ -74,23 +74,23 @@ double ltc4150_get_total_Joule(void) { return mAh_to_Joule(ltc4150_get_total_mAh()); } -double ltc4150_get_avg_mA() { +double ltc4150_get_avg_mA(void) { return (int_to_coulomb(int_count)*1000000000)/HWTIMER_TICKS_TO_US(last_int_time - start_time); } -int ltc4150_get_interval() { +int ltc4150_get_interval(void) { return HWTIMER_TICKS_TO_US(last_int_time - start_time); } -unsigned long __attribute__((__no_instrument_function__)) ltc4150_get_intcount() { +unsigned long __attribute__((__no_instrument_function__)) ltc4150_get_intcount(void) { return int_count; } -void ltc4150_init() { +void ltc4150_init(void) { ltc4150_arch_init(); } -void ltc4150_start() { +void ltc4150_start(void) { ltc4150_disable_int(); int_count = 0; uint32_t now = hwtimer_now(); @@ -100,11 +100,11 @@ void ltc4150_start() { ltc4150_enable_int(); } -void ltc4150_stop() { +void ltc4150_stop(void) { ltc4150_disable_int(); } -void __attribute__((__no_instrument_function__)) ltc4150_interrupt() +void __attribute__((__no_instrument_function__)) ltc4150_interrupt(void) { uint32_t now = hwtimer_now(); if (now >= last_int_time) { diff --git a/drivers/ltc4150/makefile b/drivers/ltc4150/makefile index 56eb0df1f90bbf46d3b4f700dee691ba091144dc..b1ca863065f78813ee58f3165e6b3615e9504a69 100644 --- a/drivers/ltc4150/makefile +++ b/drivers/ltc4150/makefile @@ -1,4 +1,4 @@ -INCLUDES = -I../../include -I../../lib -I../../../cpu/$(CPU)/include -I../../../cpu/ -I../../../hal/include -I../../../core/include -I../../config -I../include +INCLUDES = -I$(RIOTBASE)/core/include -I../include/ MODULE =ltc4150 include $(MAKEBASE)/makefile.base diff --git a/drivers/sht11/makefile b/drivers/sht11/makefile index ac4e9acf92b043542ed11a89fa296d68d6a1deef..bfc0a2b08eebb7db208b65822d3109f2e61a52db 100644 --- a/drivers/sht11/makefile +++ b/drivers/sht11/makefile @@ -1,4 +1,4 @@ -INCLUDES = -I../../include -I../../lib -I../../../cpu/$(CPU)/include -I../../../cpu/ -I../../../hal/include -I../../../core/include -I../../config -I../include +INCLUDES = -I$(RIOTBASE)/core/include -I../include -I$(RIOTBOARD)/$(BOARD) MODULE =sht11 include $(MAKEBASE)/makefile.base diff --git a/makefile.base b/makefile.base index 9de16b5149f9b3acc279782b9cf29dabaa41b807..65474687c93de9720352feb4b677354e834dd7f5 100644 --- a/makefile.base +++ b/makefile.base @@ -20,6 +20,11 @@ ifeq ($(CPU),cc430) INCLUDES += -I$(MAKEBASE)/cpu/msp430-common/include/ INCLUDES += -I$(MAKEBASE)/cpu/cc430/include/ endif +ifeq ($(BOARD),msba2) + INCLUDES += -I$(RIOTBOARD)/msba2/include/ + INCLUDES += -I$(RIOTBOARD)/msba2-common/include/ + INCLUDES += -I$(RIOTBOARD)/msba2-common/drivers/include/ +endif $(BINDIR)$(MODULE).a: $(OBJ) $(ASMOBJ) $(AR) -rc $(BINDIR)$(MODULE).a $(OBJ) $(ASMOBJ) diff --git a/makefile.dep b/makefile.dep new file mode 100644 index 0000000000000000000000000000000000000000..4582bee5d27a31c067ad6408ac5d7f70cde461fb --- /dev/null +++ b/makefile.dep @@ -0,0 +1,27 @@ +ifneq (,$(findstring vtimer,$(USEMODULE))) + ifeq (,$(findstring hwtimer,$(USEMODULE))) + USEMODULE += hwtimer + endif + ifeq (,$(findstring timex,$(USEMODULE))) + USEMODULE += timex + endif +endif + +ifneq (,$(findstring uart0,$(USEMODULE))) + ifeq (,$(findstring lib,$(USEMODULE))) + USEMODULE += lib + endif +endif + +ifneq (,$(findstring cc110x_ng,$(USEMODULE))) + ifneq (,$(findstring msba2,$(BOARD))) + USEMODULE += cc110x_spi + ifeq (,$(findstring gpioint,$(USEMODULE))) + USEMODULE += gpioint + endif + ifeq (,$(findstring hwtimer,$(USEMODULE))) + USEMODULE += hwtimer + endif + endif +endif + diff --git a/makefile.modules b/makefile.modules index a3c7584120b66b53e6662e158e7b69117fed7908..675cdaf24f8e97c907ab4af6620376b2120d5fee 100644 --- a/makefile.modules +++ b/makefile.modules @@ -20,7 +20,11 @@ USEMODULE += cpu core sys endif ED = $(USEMODULE:%=-D MODULE_%) EXTDEFINES = $(shell echo $(ED)|tr 'a-z' 'A-Z') -export BASELIBS=$(USEMODULE:%= $(BINDIR)%.a) +BL=$(USEMODULE:%= $(BINDIR)%.a) +# exclude hwtimer, because it is part of the kernel but the define is needed for auto_init +export BASELIBS = $(shell echo $(BL)|sed 's/[^ ]*hwtimer.a//') CFLAGS += $(EXTDEFINES) +include $(RIOTBASE)/makefile.dep + export USEMODULE diff --git a/sys/auto_init.c b/sys/auto_init/auto_init.c similarity index 100% rename from sys/auto_init.c rename to sys/auto_init/auto_init.c diff --git a/sys/auto_init/makefile b/sys/auto_init/makefile new file mode 100644 index 0000000000000000000000000000000000000000..ffa6c4d6c658d79a75bd96e8567b2446b8cac7e0 --- /dev/null +++ b/sys/auto_init/makefile @@ -0,0 +1,5 @@ +INCLUDES = -I../include -I$(RIOTBASE)/core/include/ -I$(RIOTBASE)/drivers/include +MODULE =auto_init + +include $(RIOTBASE)/makefile.base + diff --git a/sys/config.c b/sys/config/config.c similarity index 100% rename from sys/config.c rename to sys/config/config.c diff --git a/sys/config/makefile b/sys/config/makefile new file mode 100644 index 0000000000000000000000000000000000000000..ea4db12a31b3f069c05d09de635fc143dcfa7dca --- /dev/null +++ b/sys/config/makefile @@ -0,0 +1,5 @@ +INCLUDES = -I../include -I$(RIOTBASE)/core/include +MODULE =config + +include $(RIOTBASE)/makefile.base + diff --git a/sys/include/ps.h b/sys/include/ps.h index 876edab77f9bb0c20ac9153593a5fd70ec1ae39d..25cc8cf18f8cba007a3509a32a2f120bf9198f7e 100644 --- a/sys/include/ps.h +++ b/sys/include/ps.h @@ -1,7 +1,7 @@ #ifndef __PS_H #define __PS_H -void thread_print_all(); +void thread_print_all(void); void _ps_handler(char*); #endif /* __PS_H */ diff --git a/sys/lib/makefile b/sys/lib/makefile index 982135d366a2cc334c5de5ba83ace1099bd199d9..39621155ee702e47579481dbcda827780996d27b 100644 --- a/sys/lib/makefile +++ b/sys/lib/makefile @@ -1,6 +1,5 @@ INCLUDES = -I../include -I../drivers/include -I../lib -I../../cpu/$(CPU)/include -I../../cpu/ -I../lib/cmdengine -I../net -I../../hal/include -I../../core/include -I../config -MODULE =shell +MODULE =lib include $(RIOTBASE)/makefile.base - diff --git a/sys/makefile b/sys/makefile index 88fc7b66324faa7b095183718f7f864d6b99515b..8e6ae25b3b063c4f45162c95939ac6a1e33b716b 100644 --- a/sys/makefile +++ b/sys/makefile @@ -2,6 +2,9 @@ INCLUDES = -Iinclude -I$(RIOTBASE)/drivers/ -I$(RIOTBASE)/drivers/include -Ilib -I../.. -I../cpu/$(CPU)/include -I../cpu/ -Ilib/cmdengine -Inet -I../hal/include -I../core/include -Iconfig MODULE =sys +ifneq (,$(findstring auto_init,$(USEMODULE))) + DIRS += auto_init +endif ifneq (,$(findstring config,$(USEMODULE))) DIRS += config endif @@ -20,6 +23,9 @@ endif ifneq (,$(findstring mprint,$(USEMODULE))) DIRS += mprint endif +ifneq (,$(findstring ps,$(USEMODULE))) + DIRS += ps +endif ifneq (,$(findstring sync_read,$(USEMODULE))) DIRS += sync_read endif @@ -29,21 +35,33 @@ endif ifneq (,$(findstring sysmon,$(USEMODULE))) DIRS += sysmon endif -ifneq (,$(findstring utimer,$(USEMODULE))) - DIRS += utimer -endif ifneq (,$(findstring mqueue,$(USEMODULE))) DIRS += mqueue endif +ifneq (,$(findstring posix,$(USEMODULE))) + DIRS += posix +endif ifneq (,$(findstring shell,$(USEMODULE))) DIRS += shell endif +ifneq (,$(findstring shell_commands,$(USEMODULE))) + DIRS += shell/commands +endif +ifneq (,$(findstring timex,$(USEMODULE))) + DIRS += timex +endif ifneq (,$(findstring tracelog,$(USEMODULE))) DIRS += tracelog endif ifneq (,$(findstring transceiver,$(USEMODULE))) DIRS += transceiver endif +ifneq (,$(findstring uart0,$(USEMODULE))) + DIRS += uart0 +endif +ifneq (,$(findstring vtimer,$(USEMODULE))) + DIRS += vtimer +endif all: $(BINDIR)$(MODULE).a @for i in $(DIRS) ; do $(MAKE) -C $$i ; done ; diff --git a/sys/posix/makefile b/sys/posix/makefile new file mode 100644 index 0000000000000000000000000000000000000000..4ce0d5187e00e4da13db4b9abc082e8797492bb6 --- /dev/null +++ b/sys/posix/makefile @@ -0,0 +1,5 @@ +INCLUDES = -I../include -I$(RIOTBASE)/core/include +MODULE =posix + +include $(RIOTBASE)/makefile.base + diff --git a/sys/posix_io.c b/sys/posix/posix_io.c similarity index 100% rename from sys/posix_io.c rename to sys/posix/posix_io.c diff --git a/sys/ps/makefile b/sys/ps/makefile new file mode 100644 index 0000000000000000000000000000000000000000..6c374d75a41f8c41f4a90373cdc85d8b78a6b1d8 --- /dev/null +++ b/sys/ps/makefile @@ -0,0 +1,5 @@ +INCLUDES = -I../include -I$(RIOTBASE)/core/include/ -I$(RIOTBASE)/drivers/include +MODULE =ps + +include $(RIOTBASE)/makefile.base + diff --git a/sys/shell/ps.c b/sys/ps/ps.c similarity index 95% rename from sys/shell/ps.c rename to sys/ps/ps.c index 6c3226fead0b142e7889b3bd8506d93af8263b2a..fb7fcacf5f3b50f0dd956fd9065c2ba59fdbfab9 100644 --- a/sys/shell/ps.c +++ b/sys/ps/ps.c @@ -18,8 +18,7 @@ const char *state_names[] = { /** * @brief Prints a list of running threads including stack usage to stdout. */ -void thread_print_all(void) -{ +void thread_print_all(void) { extern unsigned long hwtimer_now(void); const char queued_name[] = {'_', 'Q'}; int i; @@ -49,8 +48,3 @@ void thread_print_all(void) } printf("\t%5s %-21s|%13s%6s %5i\n", "|", "SUM", "|", "|", overall_stacksz); } - -void _ps_handler(char* unnused) { - thread_print_all(); -} - diff --git a/sys/shell/commands/makefile b/sys/shell/commands/makefile new file mode 100644 index 0000000000000000000000000000000000000000..1008c51a7cb35822d935d37fee0b385919bf507c --- /dev/null +++ b/sys/shell/commands/makefile @@ -0,0 +1,49 @@ +#SRC = cc1100.c cc110x_ng.c disk.c id.c ltc4150.c ps.c rtc.c shell.c shell_commands.c sht11.c +SRC = shell_commands.c sc_id.c +INCLUDES = -I../../../core/include -I../../include -I../../../drivers/include/ + +#cc1100.c cc110x_ng.c disk.c id.c Jamfile ltc4150.c makefile makefile.commands ps.c rtc.c shell.c shell_commands.c sht11.c +ifneq (,$(findstring cc110x_ng,$(USEMODULE))) + INCLUDES += -I$(RIOTBASE)/drivers/cc110x_ng/include/ + SRC += sc_cc110x_ng.c +endif +ifneq (,$(findstring cc110x,$(USEMODULE))) + INCLUDES += -I$(RIOTBASE)/drivers/cc110x/ + SRC += sc_cc1100.c +endif +ifneq (,$(findstring mci,$(USEMODULE))) + SRC += sc_disk.c +endif +ifneq (,$(findstring ltc4150,$(USEMODULE))) + SRC += sc_ltc4150.c +endif +ifneq (,$(findstring ps,$(USEMODULE))) + SRC += sc_ps.c +endif +ifneq (,$(findstring rtc,$(USEMODULE))) + SRC += sc_rtc.c +endif +ifneq (,$(findstring sht11,$(USEMODULE))) + SRC += sc_sht11.c +endif + +OBJ = $(SRC:%.c=$(BINDIR)%.o) +DEP = $(SRC:%.c=$(BINDIR)%.d) + +MODULE =shell_commands + +$(BINDIR)$(MODULE).a: $(OBJ) + $(AR) rc $(BINDIR)$(MODULE).a $(OBJ) + +# pull in dependency info for *existing* .o files +-include $(OBJ:.o=.d) + +# compile and generate dependency info +$(BINDIR)%.o: %.c + $(CC) $(CFLAGS) $(PROJECTINCLUDE) $(BOARDINCLUDE) $(INCLUDES) -c $*.c -o $(BINDIR)$*.o + $(CC) $(CFLAGS) $(PROJECTINCLUDE) $(BOARDINCLUDE) $(INCLUDES) -MM $*.c > $(BINDIR)$*.d + @printf "$(BINDIR)"|cat - $(BINDIR)$*.d > /tmp/riot_out && mv /tmp/riot_out $(BINDIR)$*.d + +# remove compilation products +clean:: + rm -f $(BINDIR)$(MODULE).a $(OBJ) $(DEP) $(ASMOBJ) diff --git a/sys/shell/cc1100.c b/sys/shell/commands/sc_cc1100.c similarity index 100% rename from sys/shell/cc1100.c rename to sys/shell/commands/sc_cc1100.c diff --git a/sys/shell/cc110x_ng.c b/sys/shell/commands/sc_cc110x_ng.c similarity index 100% rename from sys/shell/cc110x_ng.c rename to sys/shell/commands/sc_cc110x_ng.c diff --git a/sys/shell/disk.c b/sys/shell/commands/sc_disk.c similarity index 100% rename from sys/shell/disk.c rename to sys/shell/commands/sc_disk.c diff --git a/sys/shell/id.c b/sys/shell/commands/sc_id.c similarity index 100% rename from sys/shell/id.c rename to sys/shell/commands/sc_id.c diff --git a/sys/shell/ltc4150.c b/sys/shell/commands/sc_ltc4150.c similarity index 100% rename from sys/shell/ltc4150.c rename to sys/shell/commands/sc_ltc4150.c diff --git a/sys/shell/commands/sc_ps.c b/sys/shell/commands/sc_ps.c new file mode 100644 index 0000000000000000000000000000000000000000..2064e32c3db6ed8ea1669c76b3d761385f61e171 --- /dev/null +++ b/sys/shell/commands/sc_ps.c @@ -0,0 +1,6 @@ +#include "ps.h" + +void _ps_handler(char* unnused) { + thread_print_all(); +} + diff --git a/sys/shell/rtc.c b/sys/shell/commands/sc_rtc.c similarity index 100% rename from sys/shell/rtc.c rename to sys/shell/commands/sc_rtc.c diff --git a/sys/shell/sht11.c b/sys/shell/commands/sc_sht11.c similarity index 100% rename from sys/shell/sht11.c rename to sys/shell/commands/sc_sht11.c diff --git a/sys/shell/shell_commands.c b/sys/shell/commands/shell_commands.c similarity index 100% rename from sys/shell/shell_commands.c rename to sys/shell/commands/shell_commands.c diff --git a/sys/shell/makefile b/sys/shell/makefile index 982135d366a2cc334c5de5ba83ace1099bd199d9..3b88abc0d665efda120e0b0a3eb62e6939a8748c 100644 --- a/sys/shell/makefile +++ b/sys/shell/makefile @@ -1,6 +1,23 @@ -INCLUDES = -I../include -I../drivers/include -I../lib -I../../cpu/$(CPU)/include -I../../cpu/ -I../lib/cmdengine -I../net -I../../hal/include -I../../core/include -I../config +SRC = shell.c +OBJ = $(SRC:%.c=$(BINDIR)%.o) +DEP = $(SRC:%.c=$(BINDIR)%.d) +INCLUDES = -I../include + MODULE =shell -include $(RIOTBASE)/makefile.base +$(BINDIR)$(MODULE).a: $(OBJ) + $(AR) rc $(BINDIR)$(MODULE).a $(OBJ) + +# pull in dependency info for *existing* .o files +-include $(OBJ:.o=.d) +# compile and generate dependency info +$(BINDIR)%.o: %.c + $(CC) $(CFLAGS) $(PROJECTINCLUDE) $(BOARDINCLUDE) $(INCLUDES) -c $*.c -o $(BINDIR)$*.o + $(CC) $(CFLAGS) $(PROJECTINCLUDE) $(BOARDINCLUDE) $(INCLUDES) -MM $*.c > $(BINDIR)$*.d + @printf "$(BINDIR)"|cat - $(BINDIR)$*.d > /tmp/riot_out && mv /tmp/riot_out $(BINDIR)$*.d +# remove compilation products +clean:: + rm -f $(BINDIR)$(MODULE).a $(OBJ) $(DEP) $(ASMOBJ) + diff --git a/sys/timex/makefile b/sys/timex/makefile new file mode 100644 index 0000000000000000000000000000000000000000..1ef2448bf3c9ea4be8b17f594acf72fea90bb4eb --- /dev/null +++ b/sys/timex/makefile @@ -0,0 +1,5 @@ +INCLUDES = -I../include +MODULE =timex + +include $(RIOTBASE)/makefile.base + diff --git a/sys/timex.c b/sys/timex/timex.c similarity index 100% rename from sys/timex.c rename to sys/timex/timex.c diff --git a/sys/transceiver/makefile b/sys/transceiver/makefile index 43efa202bcfb56cd3c5e4c43084518070a8a786a..8216bd217f72c913a204584625d3a8fc521c87c8 100644 --- a/sys/transceiver/makefile +++ b/sys/transceiver/makefile @@ -1,4 +1,4 @@ -INCLUDES = -I../include -I../drivers/include -I../drivers/cc110x_ng/include -I../lib -I../../cpu/$(CPU)/include -I../../cpu/ -I../net -I../../hal/include -I../../core/include -I../config +INCLUDES = -I../include -I$(RIOTBAE)/drivers/include -I$(RIOTBASE)/drivers/cc110x_ng/include -I../lib -I../../cpu/$(CPU)/include -I../../cpu/ -I../net -I../../hal/include -I../../core/include -I../config MODULE =transceiver include $(MAKEBASE)/makefile.base diff --git a/sys/uart0/makefile b/sys/uart0/makefile new file mode 100644 index 0000000000000000000000000000000000000000..72c2cbda2ef0f6a6c5c16071198337278abd706f --- /dev/null +++ b/sys/uart0/makefile @@ -0,0 +1,7 @@ +INCLUDES = -I../include -I../drivers/include -I../lib -I../../cpu/$(CPU)/include -I../../cpu/ -I../lib/cmdengine -I../net -I../../hal/include -I../../core/include -I../config + +MODULE =uart0 + +include $(MAKEBASE)/makefile.base + + diff --git a/sys/uart0.c b/sys/uart0/uart0.c similarity index 100% rename from sys/uart0.c rename to sys/uart0/uart0.c diff --git a/sys/vtimer/makefile b/sys/vtimer/makefile new file mode 100644 index 0000000000000000000000000000000000000000..6c1df6e8e5c4ffd1d1ba9f8e4fc2df98f9d4e9e8 --- /dev/null +++ b/sys/vtimer/makefile @@ -0,0 +1,5 @@ +INCLUDES = -I../include -I$(RIOTBASE)/core/include/ -I$(RIOTBASE)/drivers/include +MODULE =vtimer + +include $(RIOTBASE)/makefile.base + diff --git a/sys/vtimer.c b/sys/vtimer/vtimer.c similarity index 100% rename from sys/vtimer.c rename to sys/vtimer/vtimer.c