Commit b57f7d80 authored by Alessandro Rubini's avatar Alessandro Rubini

arch/lm32: preprocess linker script

This renames ram.ld to ram.ld.S, adding a preprocessing rule. The
commit has no techcnical effect: it is only preparation for the next one.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <>
parent f6c6398d
......@@ -13,14 +13,21 @@ SIZE = $(CROSS_COMPILE)size
-include $(CURDIR)/.config
AUTOCONF = $(CURDIR)/include/generated/autoconf.h
PTP_NOPOSIX = ptp-noposix
# we miss CONFIG_ARCH_LM32 as we have no other archs by now
obj-y = arch/lm32/crt0.o arch/lm32/irq.o arch/lm32/debug.o
obj-y += wrc_main.o wrc_ptp.o monitor/monitor.o
LDS = arch/lm32/ram.ld
cflags-y = -include $(CURDIR)/include/generated/autoconf.h \
-Iinclude -I.
# our linker script is preprocessed, so have a rule here
%.ld: %.ld.S $(AUTOCONF)
$(CC) -include $(AUTOCONF) -E -P $*.ld.S -o $@
cflags-y = -include $(AUTOCONF) -Iinclude -I.
cflags-$(CONFIG_PP_PRINTF) += -I$(CURDIR)/pp_printf
......@@ -58,7 +65,7 @@ obj-$(CONFIG_PTP_NOPOSIX) += $(PTP_NOPOSIX)/PTPWRd/arith.o \
CFLAGS_PLATFORM = -mmultiply-enabled -mbarrel-shift-enabled
LDFLAGS_PLATFORM = -mmultiply-enabled -mbarrel-shift-enabled \
-nostdlib -T arch/lm32/ram.ld
-nostdlib -T $(LDS)
include shell/
include tests/
......@@ -86,7 +93,7 @@ all: tools $(OUTPUT).ram $(OUTPUT).vhd
.PRECIOUS: %.elf %.bin
.PHONY: all tools clean gitmodules
$(OUTPUT).elf: silentoldconfig gitmodules $(OBJS)
$(OUTPUT).elf: $(LDS) silentoldconfig gitmodules $(OBJS)
$(CC) $(CFLAGS) -DGIT_REVISION=\"$(REVISION)\" -c revision.c
${CC} -o $@ revision.o $(OBJS) $(LDFLAGS)
${OBJDUMP} -d $(OUTPUT).elf > $(OUTPUT)_disasm.S
\ No newline at end of file
Markdown is supported
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