diff --git a/.gitignore b/.gitignore index e94c6a25c..c5872bb89 100644 --- a/.gitignore +++ b/.gitignore @@ -22,7 +22,6 @@ *.id1 *.id2 *.latfont -*.ld *.lz *.map *.nam diff --git a/Makefile b/Makefile index adb08dfb7..259e19113 100644 --- a/Makefile +++ b/Makefile @@ -327,19 +327,15 @@ $(OBJ_DIR)/sym_ewram.ld: sym_ewram.txt $(RAMSCRGEN) ewram_data $< ENGLISH > $@ ifeq ($(MODERN),0) -LD_SCRIPT := ld_script.txt +LD_SCRIPT := ld_script.ld LD_SCRIPT_DEPS := $(OBJ_DIR)/sym_bss.ld $(OBJ_DIR)/sym_common.ld $(OBJ_DIR)/sym_ewram.ld else -LD_SCRIPT := ld_script_modern.txt +LD_SCRIPT := ld_script_modern.ld LD_SCRIPT_DEPS := endif -$(OBJ_DIR)/ld_script.ld: $(LD_SCRIPT) $(LD_SCRIPT_DEPS) - cd $(OBJ_DIR) && sed -f ../../ld_script.sed ../../$< | sed "s#tools/#../../tools/#g" > ld_script.ld - -$(ELF): $(OBJ_DIR)/ld_script.ld $(OBJS) - @echo "cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld -o ../../$@ " - @cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld -o ../../$@ $(OBJS_REL) $(LIB) +$(ELF): $(LD_SCRIPT) $(LD_SCRIPT_DEPS) $(OBJS) + @cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ../../$< -o ../../$@ $(OBJS_REL) $(LIB) $(FIX) $@ -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(GAME_REVISION) --silent $(ROM): $(ELF) diff --git a/ld_script.txt b/ld_script.ld similarity index 99% rename from ld_script.txt rename to ld_script.ld index a2cc3e6e7..6b1f95a3f 100644 --- a/ld_script.txt +++ b/ld_script.ld @@ -11,7 +11,7 @@ SECTIONS { . = 0x1C000; - + INCLUDE "sym_ewram.ld" src/*.o(.ewram_data); *libc.a:impure.o(.data); @@ -26,7 +26,7 @@ SECTIONS { ALIGN(4) { /* .bss starts at 0x3000000 */ - + INCLUDE "sym_bss.ld" src/*.o(.bss); data/*.o(.bss); @@ -34,7 +34,7 @@ SECTIONS { src/m4a.o(.bss.code); /* COMMON starts at 0x30030E0 */ - + INCLUDE "sym_common.ld" *libc.a:sbrkr.o(COMMON); end = .; diff --git a/ld_script.sed b/ld_script.sed deleted file mode 100644 index b91542b6f..000000000 --- a/ld_script.sed +++ /dev/null @@ -1,14 +0,0 @@ -// { - r sym_ewram.ld - d -} - -// { - r sym_bss.ld - d -} - -// { - r sym_common.ld - d -} diff --git a/ld_script_modern.txt b/ld_script_modern.ld similarity index 100% rename from ld_script_modern.txt rename to ld_script_modern.ld