mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
3f59eefbaf
Creating all object files in one directory is bound to produce name clashes. RIOT developers may take care to use unique file names, but external packages surely don't. With this change all the objects of a module (e.g. `shell`) will be created in `bin/$(BOARD)/$(MODULE)`. I compared the final linker command before and after the change. The `.o` files (e.g. `startup.o`, `syscall.o` ...) are included in the same order. Neglecting the changed path name where the `.o` files reside, the linker command stays exactly the same. A major problem could be third party boards, because the location of the `startup.o` needs to the specified now in `boards/$(BOARD)/Makefile.include`, e.g. ```Makefile export UNDEF += $(BINDIR)msp430_common/startup.o ```
30 lines
1.1 KiB
Makefile
30 lines
1.1 KiB
Makefile
## the cpu to build for
|
|
export CPU = lpc1768
|
|
|
|
# toolchain config
|
|
export PREFIX = arm-none-eabi-
|
|
export CC = $(PREFIX)gcc
|
|
export AR = $(PREFIX)ar
|
|
export CFLAGS += -DUSE_STDPERIPH_DRIVER -ggdb -g3 -O0 -Wall -Wstrict-prototypes -mcpu=cortex-m3 $(FPU_USAGE) -mlittle-endian -mthumb -mthumb-interwork -nostartfiles
|
|
export ASFLAGS = -ggdb -g3 -mcpu=cortex-m3 $(FPU_USAGE) -mlittle-endian
|
|
export AS = $(PREFIX)as
|
|
export LINK = $(PREFIX)gcc
|
|
export SIZE = $(PREFIX)size
|
|
export OBJCOPY = $(PREFIX)objcopy
|
|
#LINKFLAGS = -g3 -ggdb -mcpu=cortex-m3 $(FPU_USAGE) -mlittle-endian -static -lgcc -mthumb -mthumb-interwork -nostartfiles -T$(RIOTCPU)/$(CPU)/LPC1768.ld
|
|
LINKFLAGS = -mcpu=cortex-m3 -mthumb -Wl,--gc-sections,--cref -lc -lgcc -lnosys -T$(RIOTCPU)/$(CPU)/LPC1768.ld -nostartfiles
|
|
|
|
ifeq ($(strip $(PORT)),)
|
|
export PORT = /dev/ttyUSB0
|
|
endif
|
|
export HEXFILE = $(BINDIR)$(PROJECT).hex
|
|
export FFLAGS = $(HEXFILE)
|
|
|
|
export ELFFILE = bin/$(PROJECT).elf
|
|
export DEBUGGER_FLAGS = $(ELFFILE)
|
|
|
|
export INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include/ -I$(RIOTCPU)/$(CPU)/include
|
|
export OFLAGS = -O binary
|
|
|
|
export UNDEF += $(BINDIR)cpu/startup.o
|