From 1b91cd8d6646bdf9dae6d900a0b6e13f9b61edc2 Mon Sep 17 00:00:00 2001 From: Thar0 <17233964+Thar0@users.noreply.github.com> Date: Sun, 30 Aug 2020 01:16:07 +0100 Subject: [PATCH] Allow building with wsl and remove objcopy hack with appropriate change to elf2dol --- Makefile | 9 +++++++-- tools/elf2dol.c | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 173eadeb8a0..8294a15f000 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,11 @@ ifneq ($(findstring MSYS,$(shell uname)),) WINDOWS := 1 endif +WSLENV ?= ok +ifndef WSLENV + WINDOWS := 1 +endif + #------------------------------------------------------------------------------- # Files #------------------------------------------------------------------------------- @@ -37,7 +42,7 @@ O_FILES := $(INIT_O_FILES) $(EXTAB_O_FILES) $(EXTABINDEX_O_FILES) $(TEXT_O_FILES # Tools #------------------------------------------------------------------------------- -MWCC_VERSION := 1.2.5 +MWCC_VERSION := 3.0 # Programs ifeq ($(WINDOWS),1) @@ -104,7 +109,7 @@ tools: $(ELF): $(O_FILES) $(LDSCRIPT) $(LD) $(LDFLAGS) -o $@ -lcf $(LDSCRIPT) $(O_FILES) # The Metrowerks linker doesn't generate physical addresses in the ELF program headers. This fixes it somehow. - $(OBJCOPY) $@ $@ +# $(OBJCOPY) $@ $@ $(BUILD_DIR)/%.o: %.s $(AS) $(ASFLAGS) -o $@ $< diff --git a/tools/elf2dol.c b/tools/elf2dol.c index 9da8b3cb29e..b201dd31891 100644 --- a/tools/elf2dol.c +++ b/tools/elf2dol.c @@ -234,7 +234,7 @@ void read_elf_segments(DOL_map *map, const char *elf, uint32_t sdata_pdhr, uint3 for(i=0; i