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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user