Browse Source

simplified and unified cpu build structure

dev/timer
Oleg Hahm 9 years ago
parent
commit
26c50522d5
  1. 2
      Makefile
  2. 2
      Makefile.base
  3. 2
      Makefile.include
  4. 42
      cpu/Makefile
  5. 24
      cpu/Makefile.base
  6. 19
      cpu/Makefile.include
  7. 4
      cpu/arm_common/Makefile.include
  8. 2
      cpu/cc430/Makefile
  9. 2
      cpu/cc430/Makefile.include
  10. 3
      cpu/lpc1768/Makefile
  11. 3
      cpu/lpc1768/Makefile.include
  12. 1
      cpu/lpc1768/include/LPC17xx.h
  13. 2
      cpu/lpc1768/include/cpu-conf.h
  14. 2
      cpu/lpc2387/Makefile
  15. 7
      cpu/lpc2387/Makefile.include
  16. 3
      cpu/lpc_common/Makefile.include
  17. 2
      cpu/mc1322x/Makefile
  18. 7
      cpu/mc1322x/Makefile.include
  19. 20
      cpu/mc1322x/gpio.c
  20. 2
      cpu/msp430-common/Makefile.include
  21. 2
      cpu/msp430x16x/Makefile
  22. 4
      cpu/msp430x16x/Makefile.include
  23. 2
      cpu/native/Makefile.include

2
Makefile

@ -1,4 +1,4 @@
DIRS = $(RIOTCPU) core drivers sys
DIRS = $(RIOTCPU)/$(CPU) core drivers sys
.PHONY: all clean doc

2
Makefile.base

@ -23,7 +23,7 @@ export CFLAGS += -DVERSION=\"$(GIT_VERSION)\"
.PHONY: clean
include $(RIOTCPU)/Makefile.base
include $(RIOTCPU)/$(CPU)/Makefile.include
include $(RIOTBOARD)/$(BOARD)/Makefile.include
$(BINDIR)$(MODULE).a: $(OBJ) $(ASMOBJ)

2
Makefile.include

@ -21,7 +21,7 @@ export BINDIR =$(CURDIR)/bin/
# mandatory includes!
include $(RIOTBOARD)/$(BOARD)/Makefile.include
include $(RIOTCPU)/Makefile.include
include $(RIOTCPU)/$(CPU)/Makefile.include
include $(RIOTBASE)/Makefile.modules
# your binaries to link

42
cpu/Makefile

@ -1,42 +0,0 @@
ifeq ($(CPU),lpc1768)
DIRS = lpc1768
endif
ifeq ($(CPU),lpc2387)
DIRS = arm_common lpc_common lpc2387
endif
ifeq ($(CPU),mc1322x)
DIRS = arm_common mc1322x
endif
ifeq ($(CPU),cc430)
DIRS = msp430-common cc430
endif
ifeq ($(CPU),msp430x16x)
DIRS = msp430-common msp430x16x
endif
ifeq ($(CPU),native)
DIRS = native
endif
.PHONY: cpus
.PHONY: $(DIRS)
cpus: $(DIRS)
$(DIRS):
@"$(MAKE)" -C $@
clean:
@"$(MAKE)" -C lpc1768 clean
@"$(MAKE)" -C lpc2387 clean
@"$(MAKE)" -C mc1322x clean
@"$(MAKE)" -C lpc_common clean
@"$(MAKE)" -C arm_common clean
@"$(MAKE)" -C cc430 clean
@"$(MAKE)" -C msp430-common clean
@"$(MAKE)" -C msp430x16x clean
@"$(MAKE)" -C native clean

24
cpu/Makefile.base

@ -1,24 +0,0 @@
ifeq ($(CPU),lpc1768)
INCLUDES += -I$(MAKEBASE)/cpu/lpc1768/include
endif
ifeq ($(CPU),lpc2387)
INCLUDES += -I$(MAKEBASE)/cpu/arm_common/include/
INCLUDES += -I$(MAKEBASE)/cpu/lpc_common/include/
INCLUDES += -I$(MAKEBASE)/cpu/lpc2387/include
endif
ifeq ($(CPU),mc1322x)
INCLUDES += -I$(MAKEBASE)/cpu/arm_common/include/
INCLUDES += -I$(MAKEBASE)/cpu/mc1322x/include
endif
ifeq ($(CPU),msp430x16x)
INCLUDES += -I$(MAKEBASE)/cpu/msp430-common/include/
INCLUDES += -I$(MAKEBASE)/cpu/msp430x16x/include/
endif
ifeq ($(CPU),cc430)
INCLUDES += -I$(MAKEBASE)/cpu/msp430-common/include/
INCLUDES += -I$(MAKEBASE)/cpu/cc430/include/
endif
ifeq ($(CPU),native)
INCLUDES += -I$(MAKEBASE)/cpu/native/include/
endif

19
cpu/Makefile.include

@ -1,19 +0,0 @@
### Minimal setup
ifeq ($(CPU),lpc1768)
export UNDEF += $(BINDIR)syscalls.o
endif
ifeq ($(CPU),lpc2387)
export USEMODULE += arm_common lpc_common
export UNDEF += $(BINDIR)syscalls.o $(BINDIR)lpc_syscalls.o
export INCLUDES += -I$(RIOTCPU)/arm_common/include
export INCLUDES += -I$(RIOTCPU)/lpc_common/include
endif
ifeq ($(CPU),mc1322x)
export USEMODULE += arm_common
export UNDEF += $(BINDIR)syscalls.o
export UNDEF += $(BINDIR)mc1322x_syscalls.o
export INCLUDES += -I$(RIOTBASE)/cpu/arm_common/include
endif
ifeq ($(CPU),native)
export INCLUDES += -I$(RIOTCPU)/native/include
endif

4
cpu/arm_common/Makefile.include

@ -0,0 +1,4 @@
INCLUDES += -I$(MAKEBASE)/cpu/arm_common/include/
export UNDEF += $(BINDIR)syscalls.o

2
cpu/cc430/Makefile

@ -1,7 +1,7 @@
MODULE = cpu
INCLUDES += -I$(RIOTCPU)/$(CPU)/include -I$(RIOTBASE)/core/include -I$(RIOTBASE)/drivers/cc110x_ng/include
DIRS =
DIRS = $(RIOTCPU)/msp430-common
all: $(BINDIR)$(MODULE).a
@for i in $(DIRS) ; do "$(MAKE)" -C $$i ; done ;

2
cpu/cc430/Makefile.include

@ -0,0 +1,2 @@
INCLUDES += -I$(MAKEBASE)/cpu/cc430/include/

3
cpu/lpc1768/Makefile

@ -7,8 +7,7 @@ CC_SYMBOLS = -DTARGET_LPC1769 -DTOOLCHAIN_GCC_ARM -DNDEBUG -D__CORTEX_M3
LD_FLAGS = -mcpu=cortex-m3 -mthumb -Wl,--gc-sections,-Map=$(PROJECT).map,--cref --specs=nano.specs
LD_SYS_LIBS = -lc -lgcc -lnosys
INCLUDES = -Iinclude
INCLUDES += -I$(RIOTBASE)/core/include -I$(RIOTBASE)/sys/include -I$(RIOTBASE)/sys/lib
INCLUDES = -Iinclude -I$(RIOTBASE)/core/include -I$(RIOTBASE)/sys/include -I$(RIOTBASE)/sys/lib
all: $(BINDIR)$(MODULE).a

3
cpu/lpc1768/Makefile.include

@ -0,0 +1,3 @@
INCLUDES += -I$(MAKEBASE)/cpu/lpc1768/include
export UNDEF += $(BINDIR)syscalls.o

1
cpu/lpc1768/include/LPC17xx.h

@ -97,7 +97,6 @@ typedef enum IRQn
#include "core_cm3.h" /* Cortex-M3 processor and core peripherals */
#include "system_LPC17xx.h" /* System Header */
/******************************************************************************/

2
cpu/lpc1768/include/cpu-conf.h

@ -13,6 +13,8 @@
#endif
#define KERNEL_CONF_STACKSIZE_IDLE 1000
#define UART0_BUFSIZE (128)
/** @} */
#endif /* CPU_CONF_H */

2
cpu/lpc2387/Makefile

@ -1,7 +1,7 @@
MODULE =cpu
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 =
DIRS = $(RIOTCPU)/arm_common $(RIOTCPU)/lpc_common
ifneq (,$(findstring gpioint,$(USEMODULE)))
DIRS += gpioint
endif

7
cpu/lpc2387/Makefile.include

@ -0,0 +1,7 @@
INCLUDES += -I$(RIOTCPU)/lpc2387/include
include $(RIOTCPU)/arm_common/Makefile.include
include $(RIOTCPU)/lpc_common/Makefile.include
export USEMODULE += arm_common lpc_common

3
cpu/lpc_common/Makefile.include

@ -0,0 +1,3 @@
INCLUDES += -I$(RIOTCPU)/lpc_common/include
export UNDEF += $(BINDIR)lpc_syscalls.o

2
cpu/mc1322x/Makefile

@ -1,6 +1,6 @@
MODULE =cpu
DIRS =
DIRS = $(RIOTCPU)/arm_common
ifneq (,$(findstring mc1322x_adc,$(USEMODULE)))
DIRS += adc
endif

7
cpu/mc1322x/Makefile.include

@ -0,0 +1,7 @@
INCLUDES += -I$(MAKEBASE)/cpu/mc1322x/include
include $(RIOTCPU)/arm_common/Makefile.include
export UNDEF += $(BINDIR)mc1322x_syscalls.o
export USEMODULE += arm_common

20
cpu/mc1322x/gpio.c

@ -10,19 +10,19 @@
#include "gpio.h"
inline void gpio_pad_dir(volatile uint64_t data)
static inline void gpio_pad_dir(volatile uint64_t data)
{
GPIO->PAD_DIR0 = (data & 0xffffffff);
GPIO->PAD_DIR1 = (data >> 32);
}
inline void gpio_data(volatile uint64_t data)
static inline void gpio_data(volatile uint64_t data)
{
GPIO->DATA0 = (data & 0xffffffff);
GPIO->DATA1 = (data >> 32);
}
inline uint64_t gpio_data_get(volatile uint64_t bits) {
static inline uint64_t gpio_data_get(volatile uint64_t bits) {
uint64_t rdata = 0;
rdata = GPIO->DATA0 & (bits & 0xffffffff);
@ -31,43 +31,43 @@ inline uint64_t gpio_data_get(volatile uint64_t bits) {
return rdata;
}
inline void gpio_pad_pu_en(volatile uint64_t data)
static inline void gpio_pad_pu_en(volatile uint64_t data)
{
GPIO->PAD_PU_EN0 = (data & 0xffffffff);
GPIO->PAD_PU_EN1 = (data >> 32);
}
inline void gpio_data_sel(volatile uint64_t data)
static inline void gpio_data_sel(volatile uint64_t data)
{
GPIO->DATA_SEL0 = (data & 0xffffffff);
GPIO->DATA_SEL1 = (data >> 32);
}
inline void gpio_pad_pu_sel(volatile uint64_t data)
static inline void gpio_pad_pu_sel(volatile uint64_t data)
{
GPIO->PAD_PU_SEL0 = (data & 0xffffffff);
GPIO->PAD_PU_SEL1 = (data >> 32);
}
inline void gpio_data_set(volatile uint64_t data)
static inline void gpio_data_set(volatile uint64_t data)
{
GPIO->DATA_SET0 = (data & 0xffffffff);
GPIO->DATA_SET1 = (data >> 32);
}
inline void gpio_data_reset(volatile uint64_t data)
static inline void gpio_data_reset(volatile uint64_t data)
{
GPIO->DATA_RESET0 = (data & 0xffffffff);
GPIO->DATA_RESET1 = (data >> 32);
}
inline void gpio_pad_dir_set(volatile uint64_t data)
static inline void gpio_pad_dir_set(volatile uint64_t data)
{
GPIO->PAD_DIR_SET0 = (data & 0xffffffff);
GPIO->PAD_DIR_SET1 = (data >> 32);
}
inline void gpio_pad_dir_reset(volatile uint64_t data)
static inline void gpio_pad_dir_reset(volatile uint64_t data)
{
GPIO->PAD_DIR_RESET0 = (data & 0xffffffff);
GPIO->PAD_DIR_RESET1 = (data >> 32);

2
cpu/msp430-common/Makefile.include

@ -0,0 +1,2 @@
INCLUDES += -I$(MAKEBASE)/cpu/msp430-common/include/

2
cpu/msp430x16x/Makefile

@ -1,7 +1,7 @@
MODULE =cpu
INCLUDES = -I../include -I$(RIOTBASE)/core/include
DIRS =
DIRS = $(RIOTCPU)/msp430-common/
all: $(BINDIR)$(MODULE).a
@for i in $(DIRS) ; do "$(MAKE)" -C $$i ; done ;

4
cpu/msp430x16x/Makefile.include

@ -0,0 +1,4 @@
INCLUDES += -I$(RIOTCPU)/msp430x16x/include/
include $(RIOTCPU)/msp430-common/Makefile.include

2
cpu/native/Makefile.include

@ -0,0 +1,2 @@
export INCLUDES += -I$(RIOTCPU)/native/include
Loading…
Cancel
Save