Commit 34109dfb authored by Christian Eichler's avatar Christian Eichler
Browse files

Modify makefile to allow building with custom .o files

parent 7647dee8
.PHONY: reset_%
.SECONDARY: $(bin/*.axf)
#### Setup ####
XMC = $(shell pwd)/XMC
......@@ -16,16 +17,15 @@ LIBS = $(CMSIS)/Lib/GCC/libarm_cortexM4lf_math.a
LINKER_FILE = $(CMSIS)/Infineon/$(UC)_series/Source/GCC/XMC4500x1024.ld
CMSIS_SRC += $(CMSIS)/Infineon/$(UC)_series/Source/System_$(UC).c
JLINK = JLinkExe
SYSCC = $(TOOLCHAIN)-gcc
CC = patmos-clang
CP = $(TOOLCHAIN)-objcopy
OD = $(TOOLCHAIN)-objdump
GDB = $(TOOLCHAIN)-gdb
#STACK_SIZE?=2048
STACK_SIZE?=16384
JLINK = JLinkExe
JLFLAGS = -device XMC4500-1024 -if SWD -speed 900
CFLAGS = -target armv6m--none-eabi -mcpu=cortex-m4 -mthumb -integrated-as -ccc-gcc-name arm-none-eabi-gcc
......@@ -60,7 +60,7 @@ OBJS += src/System_$(UC).o
OBJS_MAIN = $(OBJS) $(SRC_MAIN:.c=.o)
#### Rules ####
all: $(OBJS) bin/xmc.bin
all: $(OBJS)
src/System_$(UC).o: $(CMSIS_SRC)
$(CC) -c $(CFLAGS) $< -o $@
......@@ -88,10 +88,10 @@ bin/ids_%.axf: $(OBJS) bin/startup_XMC4500.o bin/ids_%.o
%.bin: %.axf
$(CP) $(CPFLAGS) $^ $@
bin/xmc.axf: $(OBJS_MAIN) bin/startup_XMC4500.o gene.o
bin/system_%.axf: $(OBJS_MAIN) bin/startup_XMC4500.o %.o
mkdir -p bin
@echo LD $<
@$(CC) -T $(LINKER_FILE) $(LFLAGS) -o bin/xmc.axf $^ $(LIBS)
@echo LD $@
@$(CC) -T $(LINKER_FILE) $(LFLAGS) -o $@ $^ $(LIBS)
reset_%:
echo "connect\n\
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment