mirror of https://github.com/zeldaret/tp.git
Merge pull request #1 from Thar0/makefile-changes
Makefile changes: Remove objcopy hack and allow building with WSL
This commit is contained in:
commit
c72fc0c64a
9
Makefile
9
Makefile
|
@ -5,6 +5,11 @@ ifneq ($(findstring MSYS,$(shell uname)),)
|
||||||
WINDOWS := 1
|
WINDOWS := 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
WSLENV ?= ok
|
||||||
|
ifndef WSLENV
|
||||||
|
WINDOWS := 1
|
||||||
|
endif
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Files
|
# Files
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
@ -37,7 +42,7 @@ O_FILES := $(INIT_O_FILES) $(EXTAB_O_FILES) $(EXTABINDEX_O_FILES) $(TEXT_O_FILES
|
||||||
# Tools
|
# Tools
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
MWCC_VERSION := 1.2.5
|
MWCC_VERSION := 3.0
|
||||||
|
|
||||||
# Programs
|
# Programs
|
||||||
ifeq ($(WINDOWS),1)
|
ifeq ($(WINDOWS),1)
|
||||||
|
@ -104,7 +109,7 @@ tools:
|
||||||
$(ELF): $(O_FILES) $(LDSCRIPT)
|
$(ELF): $(O_FILES) $(LDSCRIPT)
|
||||||
$(LD) $(LDFLAGS) -o $@ -lcf $(LDSCRIPT) $(O_FILES)
|
$(LD) $(LDFLAGS) -o $@ -lcf $(LDSCRIPT) $(O_FILES)
|
||||||
# The Metrowerks linker doesn't generate physical addresses in the ELF program headers. This fixes it somehow.
|
# The Metrowerks linker doesn't generate physical addresses in the ELF program headers. This fixes it somehow.
|
||||||
$(OBJCOPY) $@ $@
|
# $(OBJCOPY) $@ $@
|
||||||
|
|
||||||
$(BUILD_DIR)/%.o: %.s
|
$(BUILD_DIR)/%.o: %.s
|
||||||
$(AS) $(ASFLAGS) -o $@ $<
|
$(AS) $(ASFLAGS) -o $@ $<
|
||||||
|
|
|
@ -234,7 +234,7 @@ void read_elf_segments(DOL_map *map, const char *elf, uint32_t sdata_pdhr, uint3
|
||||||
for(i=0; i<phnum; i++) {
|
for(i=0; i<phnum; i++) {
|
||||||
if(swap32(phdrs[i].p_type) == PT_LOAD) {
|
if(swap32(phdrs[i].p_type) == PT_LOAD) {
|
||||||
uint32_t offset = swap32(phdrs[i].p_offset);
|
uint32_t offset = swap32(phdrs[i].p_offset);
|
||||||
uint32_t paddr = swap32(phdrs[i].p_paddr);
|
uint32_t paddr = swap32(phdrs[i].p_vaddr);
|
||||||
uint32_t filesz = swap32(phdrs[i].p_filesz);
|
uint32_t filesz = swap32(phdrs[i].p_filesz);
|
||||||
uint32_t memsz = swap32(phdrs[i].p_memsz);
|
uint32_t memsz = swap32(phdrs[i].p_memsz);
|
||||||
uint32_t flags = swap32(phdrs[i].p_flags);
|
uint32_t flags = swap32(phdrs[i].p_flags);
|
||||||
|
|
Loading…
Reference in New Issue