aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2012-08-20 00:27:22 +0200
committerHarald Welte <laforge@gnumonks.org>2012-08-20 00:27:22 +0200
commit41ddc255af5a2f8170c5be09b1b841c5c048a8f2 (patch)
treed12374a1461a1b8d7155f07aa35332c7a09948d0
parent7039377361533d701fd6271bf6c268906da278b1 (diff)
Makefile: use _ramonly and build raw binary image
-rw-r--r--src/Makefile16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/Makefile b/src/Makefile
index 5c08a8c..4025856 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -6,11 +6,18 @@ SIZE = $(CROSS_COMPILE)size
STRIP = $(CROSS_COMPILE)strip
OBJCOPY = $(CROSS_COMPILE)objcopy
+#LDS = cc32/CC32RS512.lds
+LDS = cc32/CC32RS512_ramonly.lds
+
OPTIMIZATION = -Os
ASM_OBJECTS = cc32/start.o
-C_OBJECTS = main.o cc32/cc32_flcon.o cc32/cc32_irq.o cc32/iso7816_slave.o cc32/cc32_spi.o
+CC32_OBJECTS = cc32/cc32_flcon.o cc32/cc32_irq.o cc32/cc32_gpio.o \
+ cc32/cc32_spi.o cc32/iso7816_slave.o \
+ cc32/uart_sc16is740.o
+
+C_OBJECTS = $(CC32_OBJECTS) main.o
CFLAGS = -Wall -ffunction-sections -fno-exceptions -nostartfiles -nostdlib #-mthumb
@@ -19,8 +26,13 @@ CFLAGS += -g $(OPTIMIZATION)
LDFLAGS = -g $(OPTIMIZATION) -nostartfiles -Wl,--gc-sections
+all: target target.bin
+
target: $(ASM_OBJECTS) $(C_OBJECTS)
- $(CC) $(LDFLAGS) -T"cc32/CC32RS512.lds" -o $@.elf $^
+ $(CC) $(LDFLAGS) -T$(LDS) -o $@.elf $^
+
+%.bin: %.elf
+ $(OBJCOPY) --gap-fill=0xff -O binary $^ $@
$(ASM_OBJECTS): %.o: %.s Makefile
$(CC) $(ASFLAGS) -c -o $@ $<