mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 05:32:45 +01:00
simplified and unified cpu build structure
This commit is contained in:
parent
55f31a4829
commit
26c50522d5
2
Makefile
2
Makefile
@ -1,4 +1,4 @@
|
|||||||
DIRS = $(RIOTCPU) core drivers sys
|
DIRS = $(RIOTCPU)/$(CPU) core drivers sys
|
||||||
|
|
||||||
.PHONY: all clean doc
|
.PHONY: all clean doc
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ export CFLAGS += -DVERSION=\"$(GIT_VERSION)\"
|
|||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
|
||||||
include $(RIOTCPU)/Makefile.base
|
include $(RIOTCPU)/$(CPU)/Makefile.include
|
||||||
include $(RIOTBOARD)/$(BOARD)/Makefile.include
|
include $(RIOTBOARD)/$(BOARD)/Makefile.include
|
||||||
|
|
||||||
$(BINDIR)$(MODULE).a: $(OBJ) $(ASMOBJ)
|
$(BINDIR)$(MODULE).a: $(OBJ) $(ASMOBJ)
|
||||||
|
@ -21,7 +21,7 @@ export BINDIR =$(CURDIR)/bin/
|
|||||||
|
|
||||||
# mandatory includes!
|
# mandatory includes!
|
||||||
include $(RIOTBOARD)/$(BOARD)/Makefile.include
|
include $(RIOTBOARD)/$(BOARD)/Makefile.include
|
||||||
include $(RIOTCPU)/Makefile.include
|
include $(RIOTCPU)/$(CPU)/Makefile.include
|
||||||
include $(RIOTBASE)/Makefile.modules
|
include $(RIOTBASE)/Makefile.modules
|
||||||
|
|
||||||
# your binaries to link
|
# your binaries to link
|
||||||
|
42
cpu/Makefile
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
|
|
@ -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
|
|
||||||
|
|
@ -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
Normal file
4
cpu/arm_common/Makefile.include
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
INCLUDES += -I$(MAKEBASE)/cpu/arm_common/include/
|
||||||
|
|
||||||
|
export UNDEF += $(BINDIR)syscalls.o
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
MODULE = cpu
|
MODULE = cpu
|
||||||
|
|
||||||
INCLUDES += -I$(RIOTCPU)/$(CPU)/include -I$(RIOTBASE)/core/include -I$(RIOTBASE)/drivers/cc110x_ng/include
|
INCLUDES += -I$(RIOTCPU)/$(CPU)/include -I$(RIOTBASE)/core/include -I$(RIOTBASE)/drivers/cc110x_ng/include
|
||||||
DIRS =
|
DIRS = $(RIOTCPU)/msp430-common
|
||||||
|
|
||||||
all: $(BINDIR)$(MODULE).a
|
all: $(BINDIR)$(MODULE).a
|
||||||
@for i in $(DIRS) ; do "$(MAKE)" -C $$i ; done ;
|
@for i in $(DIRS) ; do "$(MAKE)" -C $$i ; done ;
|
||||||
|
2
cpu/cc430/Makefile.include
Normal file
2
cpu/cc430/Makefile.include
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
INCLUDES += -I$(MAKEBASE)/cpu/cc430/include/
|
||||||
|
|
@ -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_FLAGS = -mcpu=cortex-m3 -mthumb -Wl,--gc-sections,-Map=$(PROJECT).map,--cref --specs=nano.specs
|
||||||
LD_SYS_LIBS = -lc -lgcc -lnosys
|
LD_SYS_LIBS = -lc -lgcc -lnosys
|
||||||
|
|
||||||
INCLUDES = -Iinclude
|
INCLUDES = -Iinclude -I$(RIOTBASE)/core/include -I$(RIOTBASE)/sys/include -I$(RIOTBASE)/sys/lib
|
||||||
INCLUDES += -I$(RIOTBASE)/core/include -I$(RIOTBASE)/sys/include -I$(RIOTBASE)/sys/lib
|
|
||||||
|
|
||||||
all: $(BINDIR)$(MODULE).a
|
all: $(BINDIR)$(MODULE).a
|
||||||
|
|
||||||
|
3
cpu/lpc1768/Makefile.include
Normal file
3
cpu/lpc1768/Makefile.include
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
INCLUDES += -I$(MAKEBASE)/cpu/lpc1768/include
|
||||||
|
|
||||||
|
export UNDEF += $(BINDIR)syscalls.o
|
@ -97,7 +97,6 @@ typedef enum IRQn
|
|||||||
|
|
||||||
|
|
||||||
#include "core_cm3.h" /* Cortex-M3 processor and core peripherals */
|
#include "core_cm3.h" /* Cortex-M3 processor and core peripherals */
|
||||||
#include "system_LPC17xx.h" /* System Header */
|
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
@ -13,6 +13,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define KERNEL_CONF_STACKSIZE_IDLE 1000
|
#define KERNEL_CONF_STACKSIZE_IDLE 1000
|
||||||
|
|
||||||
|
#define UART0_BUFSIZE (128)
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
#endif /* CPU_CONF_H */
|
#endif /* CPU_CONF_H */
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
MODULE =cpu
|
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../../..
|
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)))
|
ifneq (,$(findstring gpioint,$(USEMODULE)))
|
||||||
DIRS += gpioint
|
DIRS += gpioint
|
||||||
endif
|
endif
|
||||||
|
7
cpu/lpc2387/Makefile.include
Normal file
7
cpu/lpc2387/Makefile.include
Normal file
@ -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
Normal file
3
cpu/lpc_common/Makefile.include
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
INCLUDES += -I$(RIOTCPU)/lpc_common/include
|
||||||
|
|
||||||
|
export UNDEF += $(BINDIR)lpc_syscalls.o
|
@ -1,6 +1,6 @@
|
|||||||
MODULE =cpu
|
MODULE =cpu
|
||||||
|
|
||||||
DIRS =
|
DIRS = $(RIOTCPU)/arm_common
|
||||||
ifneq (,$(findstring mc1322x_adc,$(USEMODULE)))
|
ifneq (,$(findstring mc1322x_adc,$(USEMODULE)))
|
||||||
DIRS += adc
|
DIRS += adc
|
||||||
endif
|
endif
|
||||||
|
7
cpu/mc1322x/Makefile.include
Normal file
7
cpu/mc1322x/Makefile.include
Normal file
@ -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
|
@ -10,19 +10,19 @@
|
|||||||
|
|
||||||
#include "gpio.h"
|
#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_DIR0 = (data & 0xffffffff);
|
||||||
GPIO->PAD_DIR1 = (data >> 32);
|
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->DATA0 = (data & 0xffffffff);
|
||||||
GPIO->DATA1 = (data >> 32);
|
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;
|
uint64_t rdata = 0;
|
||||||
|
|
||||||
rdata = GPIO->DATA0 & (bits & 0xffffffff);
|
rdata = GPIO->DATA0 & (bits & 0xffffffff);
|
||||||
@ -31,43 +31,43 @@ inline uint64_t gpio_data_get(volatile uint64_t bits) {
|
|||||||
return rdata;
|
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_EN0 = (data & 0xffffffff);
|
||||||
GPIO->PAD_PU_EN1 = (data >> 32);
|
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_SEL0 = (data & 0xffffffff);
|
||||||
GPIO->DATA_SEL1 = (data >> 32);
|
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_SEL0 = (data & 0xffffffff);
|
||||||
GPIO->PAD_PU_SEL1 = (data >> 32);
|
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_SET0 = (data & 0xffffffff);
|
||||||
GPIO->DATA_SET1 = (data >> 32);
|
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_RESET0 = (data & 0xffffffff);
|
||||||
GPIO->DATA_RESET1 = (data >> 32);
|
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_SET0 = (data & 0xffffffff);
|
||||||
GPIO->PAD_DIR_SET1 = (data >> 32);
|
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_RESET0 = (data & 0xffffffff);
|
||||||
GPIO->PAD_DIR_RESET1 = (data >> 32);
|
GPIO->PAD_DIR_RESET1 = (data >> 32);
|
||||||
|
2
cpu/msp430-common/Makefile.include
Normal file
2
cpu/msp430-common/Makefile.include
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
INCLUDES += -I$(MAKEBASE)/cpu/msp430-common/include/
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
MODULE =cpu
|
MODULE =cpu
|
||||||
|
|
||||||
INCLUDES = -I../include -I$(RIOTBASE)/core/include
|
INCLUDES = -I../include -I$(RIOTBASE)/core/include
|
||||||
DIRS =
|
DIRS = $(RIOTCPU)/msp430-common/
|
||||||
|
|
||||||
all: $(BINDIR)$(MODULE).a
|
all: $(BINDIR)$(MODULE).a
|
||||||
@for i in $(DIRS) ; do "$(MAKE)" -C $$i ; done ;
|
@for i in $(DIRS) ; do "$(MAKE)" -C $$i ; done ;
|
||||||
|
4
cpu/msp430x16x/Makefile.include
Normal file
4
cpu/msp430x16x/Makefile.include
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
INCLUDES += -I$(RIOTCPU)/msp430x16x/include/
|
||||||
|
|
||||||
|
include $(RIOTCPU)/msp430-common/Makefile.include
|
||||||
|
|
2
cpu/native/Makefile.include
Normal file
2
cpu/native/Makefile.include
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
export INCLUDES += -I$(RIOTCPU)/native/include
|
||||||
|
|
Loading…
Reference in New Issue
Block a user