ld scripts: drop duplication of standard sections

Instead of every "simple" target having their own duplicate file with
all the section mappings, just provide a single, simple,
"cortex-m-generic.ld" that works with our startup code and any simple
rom/ram system.  This also drops the pointless copying of files all over
the place.  Using -L flags properly is sufficient, and the standard file
is now in the root of the library already.
This commit is contained in:
Karl Palsson
2018-03-14 21:43:02 +00:00
parent dd87b5bed2
commit 9a05dcb6c0
58 changed files with 48 additions and 2376 deletions

View File

@@ -32,15 +32,10 @@ STANDARD_FLAGS ?= -std=c99
all: $(SRCLIBDIR)/$(LIBNAME).a
$(SRCLIBDIR)/$(LIBNAME).a: $(SRCLIBDIR)/$(LIBNAME).ld $(OBJS)
$(SRCLIBDIR)/$(LIBNAME).a: $(OBJS)
@printf " AR $(LIBNAME).a\n"
$(Q)$(AR) $(ARFLAGS) "$@" $(OBJS)
$(SRCLIBDIR)/$(LIBNAME).ld: $(LIBNAME).ld
@printf " CP $(LIBNAME).ld\n"
$(Q)cp $^ "$@"
$(Q)if [ -f $(LIBNAME)_rom_to_ram.ld ]; then cp $(LIBNAME)_rom_to_ram.ld $(SRCLIBDIR); fi
%.o: %.c
@printf " CC $(<F)\n"
$(Q)$(CC) $(TGT_CFLAGS) $(CFLAGS) -o $@ -c $<
@@ -48,8 +43,6 @@ $(SRCLIBDIR)/$(LIBNAME).ld: $(LIBNAME).ld
clean:
$(Q)rm -f *.o *.d ../*.o ../*.d
$(Q)rm -f $(SRCLIBDIR)/$(LIBNAME).a
$(Q)rm -f $(SRCLIBDIR)/$(LIBNAME).ld
$(Q)rm -f $(SRCLIBDIR)/$(LIBNAME)_rom_to_ram.ld
.PHONY: clean