Browse Source

* moved cpu and board specific parts to corresponding Makefiles

* introduced variable for cpu folder
dev/timer
Oliver Hahm 10 years ago
parent
commit
e6177e811a
  1. 2
      Makefile
  2. 41
      Makefile.base
  3. 18
      Makefile.dep
  4. 11
      Makefile.include
  5. 10
      Makefile.modules
  6. 2
      core/Makefile
  7. 20
      cpu/Makefile.base
  8. 5
      dist/Makefile
  9. 3
      sys/Makefile
  10. 2
      sys/lib/Makefile
  11. 3
      sys/logd/Makefile
  12. 2
      sys/syslog/Makefile
  13. 2
      sys/tracelog/Makefile
  14. 2
      sys/transceiver/Makefile
  15. 2
      sys/uart0/Makefile

2
Makefile

@ -1,4 +1,4 @@
DIRS = cpu core drivers sys
DIRS = $(RIOTCPU) core drivers sys
all:
mkdir -p $(BINDIR)

41
Makefile.base

@ -4,43 +4,8 @@ SRC = $(wildcard *.c)
OBJ = $(SRC:%.c=$(BINDIR)%.o)
DEP = $(SRC:%.c=$(BINDIR)%.d)
ifeq ($(CPU),lpc2387)
INCLUDES += -I$(MAKEBASE)/cpu/arm_common/include/
INCLUDES += -I$(MAKEBASE)/cpu/lpc2387/include
endif
ifeq ($(CPU),lpc214x)
INCLUDES += -I$(MAKEBASE)/cpu/arm_common/include/
INCLUDES += -I$(MAKEBASE)/cpu/lpc214x/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
ifeq ($(BOARD),msba2)
INCLUDES += -I$(RIOTBOARD)/msba2/include/
INCLUDES += -I$(RIOTBOARD)/msba2-common/include/
INCLUDES += -I$(RIOTBOARD)/msba2-common/drivers/include/
endif
ifeq ($(BOARD),msb-430)
INCLUDES += -I$(RIOTBOARD)/msb-430/include/
INCLUDES += -I$(RIOTBOARD)/msb-430-common/include/
INCLUDES += -I$(RIOTBOARD)/msb-430-common/drivers/include/
endif
ifeq ($(BOARD),msb-430h)
INCLUDES += -I$(RIOTBOARD)/msb-430h/include/
INCLUDES += -I$(RIOTBOARD)/msb-430-common/include/
INCLUDES += -I$(RIOTBOARD)/msb-430-common/drivers/include/
endif
ifeq ($(BOARD),native)
INCLUDES += -I$(RIOTBOARD)/native/include/
endif
include $(RIOTCPU)/Makefile.base
include $(RIOTBOARD)/Makefile.base
$(BINDIR)$(MODULE).a: $(OBJ) $(ASMOBJ)
$(AR) -rc $(BINDIR)$(MODULE).a $(OBJ) $(ASMOBJ)
@ -55,7 +20,7 @@ $(BINDIR)%.o: %.c
@printf "$(BINDIR)"|cat - $(BINDIR)$*.d > /tmp/riot_out && mv /tmp/riot_out $(BINDIR)$*.d
$(BINDIR)%.o: %.s
$(AS) $(ASFLAGS) $*.s -o $(BINDIR)$*.o
@$(AS) $(ASFLAGS) $*.s -o $(BINDIR)$*.o
# remove compilation products
clean::

18
Makefile.dep

@ -14,24 +14,10 @@ ifneq (,$(findstring uart0,$(USEMODULE)))
endif
ifneq (,$(findstring cc110x_ng,$(USEMODULE)))
ifeq (,$(findstring transceiver,$(USEMODULE)))
USEMODULE += transceiver
endif
ifneq (,$(findstring msba2,$(BOARD)))
USEMODULE += cc110x_spi
ifeq (,$(findstring gpioint,$(USEMODULE)))
USEMODULE += gpioint
ifeq (,$(findstring transceiver,$(USEMODULE)))
USEMODULE += transceiver
endif
ifeq (,$(findstring hwtimer,$(USEMODULE)))
USEMODULE += hwtimer
endif
endif
ifneq (,$(findstring msb-430h,$(BOARD)))
USEMODULE += cc110x_spi
ifeq (,$(findstring hwtimer,$(USEMODULE)))
USEMODULE += hwtimer
endif
endif
endif

11
Makefile.include

@ -1,3 +1,8 @@
ifeq ($(strip $(RIOTCPU)),)
export RIOTCPU =$(RIOTBASE)/cpu
endif
# 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)
@ -18,9 +23,9 @@ all: $(PROJBINDIR)/$(PROJECT).a
@echo "Building project $(PROJECT) for $(BOARD) w/ MCU $(CPU)."
$(MAKE) -C $(RIOTBOARD)
$(MAKE) -C $(RIOTBASE)
$(LINK) $(UNDEF) -o $(PROJBINDIR)/$(PROJECT).elf -Wl,--start-group $(BASELIBS) -lm -Wl,--end-group -Wl,-Map=$(PROJBINDIR)/$(PROJECT).map $(LINKFLAGS)
$(SIZE) $(PROJBINDIR)/$(PROJECT).elf
$(OBJCOPY) -O ihex $(PROJBINDIR)/$(PROJECT).elf $(PROJBINDIR)/$(PROJECT).hex
@$(LINK) $(UNDEF) -o $(PROJBINDIR)/$(PROJECT).elf -Wl,--start-group $(BASELIBS) -lm -Wl,--end-group -Wl,-Map=$(PROJBINDIR)/$(PROJECT).map $(LINKFLAGS)
@$(SIZE) $(PROJBINDIR)/$(PROJECT).elf
@$(OBJCOPY) -O ihex $(PROJBINDIR)/$(PROJECT).elf $(PROJBINDIR)/$(PROJECT).hex
## your make rules
## Only basic example - modify it for larger projects!!

10
Makefile.modules

@ -1,6 +1,5 @@
export MAKEBASE =$(RIOTBASE)
export BINDIR =$(RIOTBASE)/bin/
#UNDEF = $(BINDIR)startup.o $(BINDIR)builddate.o
UNDEF = $(BINDIR)startup.o
### Minimal setup
@ -16,12 +15,13 @@ endif
ifeq ($(CPU),native)
export INCLUDES += -I$(RIOTBASE)/cpu/native/include
endif
ifeq ($(CPU),cc430)
USEMODULE += cpu core lib sys
else
ifeq ($(CPU),stm32f407vgt6)
USEMODULE += stm32f4xxstdperi
UNDEF += $(BINDIR)syscalls.o
endif
#USEMODULE += cpu_drivers cpu core lib sys
USEMODULE += cpu core sys
endif
ED = $(USEMODULE:%=-DMODULE_%)
EXTDEFINES = $(shell echo $(ED)|tr 'a-z' 'A-Z')
BL=$(USEMODULE:%= $(BINDIR)%.a)

2
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../.. -I../drivers/include/
INCLUDES = -Iinclude/ -I../sys/include -I../sys/lib -I../sys/drivers/include -I$(RIOTCPU)/$(CPU)/include/ -I../.. -I../drivers/include/
include $(RIOTBASE)/Makefile.base

20
cpu/Makefile.base

@ -0,0 +1,20 @@
ifeq ($(CPU),lpc2387)
INCLUDES += -I$(MAKEBASE)/cpu/arm_common/include/
INCLUDES += -I$(MAKEBASE)/cpu/lpc2387/include
endif
ifeq ($(CPU),lpc214x)
INCLUDES += -I$(MAKEBASE)/cpu/arm_common/include/
INCLUDES += -I$(MAKEBASE)/cpu/lpc214x/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

5
dist/Makefile vendored

@ -5,7 +5,7 @@
#### /this makefile
#### ../../RIOT
#### ../../boards for board definitions (if you have one or more)
####/..
####
# name of your project
export PROJECT =foobar
@ -15,6 +15,7 @@ export BOARD = msb-430
# this has to be the absolute path of the RIOT-base dir
export RIOTBASE =$(CURDIR)/../../RIOT
export RIOTCPU =$(CURDIR)/../../RIOT/cpu
export RIOTBOARD =$(CURDIR)/../../boards
## Modules to include.
@ -28,6 +29,6 @@ export RIOTBOARD =$(CURDIR)/../../boards
#USEMODULE += cc110x
#USEMODULE += fat
export INCLUDES = -I$(RIOTBOARD)/$(BOARD)/include -I$(RIOTBASE)/core/include -I$(RIOTBASE)/cpu/$(CPU)/include -I$(RIOTBASE)/sys/lib -I$(RIOTBASE)/sys/include/ -I$(RIOTBASE)/drivers/include/
export INCLUDES = -I$(RIOTBOARD)/$(BOARD)/include -I$(RIOTBASE)/core/include -I$(RIOTCPU)/$(CPU)/include -I$(RIOTBASE)/sys/lib -I$(RIOTBASE)/sys/include/ -I$(RIOTBASE)/drivers/include/
include $(RIOTBASE)/Makefile.include

3
sys/Makefile

@ -1,5 +1,4 @@
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
INCLUDES = -Iinclude -I$(RIOTBASE)/drivers/ -I$(RIOTBASE)/drivers/include -Ilib -I$(RIOTCPU)/$(CPU)/include -Inet -I../core/include
MODULE =sys
ifneq (,$(findstring auto_init,$(USEMODULE)))

2
sys/lib/Makefile

@ -1,4 +1,4 @@
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
INCLUDES = -I../include -I../drivers/include -I../lib -I$(RIOTCPU)/$(CPU)/include -I../net -I../../core/include
MODULE =lib
include $(RIOTBASE)/Makefile.base

3
sys/logd/Makefile

@ -1,7 +1,6 @@
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
INCLUDES = -I../include -I../drivers/include -I../lib -I$(RIOTCPU)/$(CPU)/include -I../net -I../../core/include
MODULE =logd
include $(MAKEBASE)/Makefile.base

2
sys/syslog/Makefile

@ -1,4 +1,4 @@
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
INCLUDES = -I../include -I../drivers/include -I../lib -I$(RIOTCPU)/$(CPU)/include -I../net -I../../core/include
MODULE =syslog
include $(MAKEBASE)/Makefile.base

2
sys/tracelog/Makefile

@ -1,4 +1,4 @@
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
INCLUDES = -I../include -I../drivers/include -I../lib -I$(RIOTCPU)/$(CPU)/include -I../net -I../../core/include
MODULE =tracelog
include $(MAKEBASE)/Makefile.base

2
sys/transceiver/Makefile

@ -1,4 +1,4 @@
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
INCLUDES = -I../include -I$(RIOTBAE)/drivers/include -I$(RIOTBASE)/drivers/cc110x_ng/include -I../lib -I$(RIOTCPU)/$(CPU)/include -I../net -I../../core/include
MODULE =transceiver
include $(MAKEBASE)/Makefile.base

2
sys/uart0/Makefile

@ -1,4 +1,4 @@
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
INCLUDES = -I../include -I../drivers/include -I../lib -I$(RIOTCPU)/$(CPU)/include -I../net -I../../core/include
MODULE =uart0

Loading…
Cancel
Save