mirror of https://github.com/PrimeDecomp/prime.git
Heavily simplify franklite steps
Also fixes issues with always reprocessing,
even when obj was unchanged.
Former-commit-id: 8600d9ae82
This commit is contained in:
parent
86ad34060b
commit
56410369ae
56
Makefile
56
Makefile
|
@ -22,13 +22,7 @@ endif
|
|||
NAME := mp1
|
||||
VERSION ?= 0
|
||||
|
||||
# Overkill epilogue fixup strategy. Set to 1 if necessary.
|
||||
EPILOGUE_PROCESS := 1
|
||||
|
||||
BUILD_DIR := build/$(NAME).$(VERSION)
|
||||
ifeq ($(EPILOGUE_PROCESS),1)
|
||||
EPILOGUE_DIR := epilogue/$(NAME).$(VERSION)
|
||||
endif
|
||||
|
||||
# Inputs
|
||||
S_FILES := $(wildcard asm/*.s)
|
||||
|
@ -48,9 +42,6 @@ ifeq ($(MAPGENFLAG),1)
|
|||
endif
|
||||
|
||||
include obj_files.mk
|
||||
ifeq ($(EPILOGUE_PROCESS),1)
|
||||
include e_files.mk
|
||||
endif
|
||||
|
||||
O_FILES := $(INIT_O_FILES) $(EXTAB_O_FILES) $(EXTABINDEX_O_FILES) $(METROTRK_FILES) \
|
||||
$(METROIDPRIME) $(WORLDFORMAT) $(WEAPONS) $(METARENDER) $(GUISYS) $(COLLISION) \
|
||||
|
@ -63,18 +54,11 @@ DEPENDS := $(O_FILES:.o=.d)
|
|||
# If a specific .o file is passed as a target, also process its deps
|
||||
DEPENDS += $(MAKECMDGOALS:.o=.d)
|
||||
|
||||
ifeq ($(EPILOGUE_PROCESS),1)
|
||||
E_FILES := $(EPILOGUE_UNSCHEDULED)
|
||||
endif
|
||||
#-------------------------------------------------------------------------------
|
||||
# Tools
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
MWCC_VERSION := 2.7
|
||||
ifeq ($(EPILOGUE_PROCESS),1)
|
||||
MWCC_EPI_VERSION := 1.2.5
|
||||
MWCC_EPI_EXE := mwcceppc.exe
|
||||
endif
|
||||
MWLD_VERSION := 2.6
|
||||
|
||||
# Programs
|
||||
|
@ -91,12 +75,9 @@ else
|
|||
CPP := $(DEVKITPPC)/bin/powerpc-eabi-cpp -P
|
||||
endif
|
||||
CC = $(WINE) tools/mwcc_compiler/$(MWCC_VERSION)/mwcceppc.exe
|
||||
ifeq ($(EPILOGUE_PROCESS),1)
|
||||
CC_EPI = $(WINE) tools/mwcc_compiler/$(MWCC_EPI_VERSION)/$(MWCC_EPI_EXE)
|
||||
endif
|
||||
LD := $(WINE) tools/mwcc_compiler/$(MWLD_VERSION)/mwldeppc.exe
|
||||
ELF2DOL := tools/elf2dol
|
||||
SHA1SUM := sha1sum
|
||||
SHA1SUM := shasum -a 1
|
||||
PYTHON := python3
|
||||
|
||||
TRANSFORM_DEP := tools/transform-dep.py
|
||||
|
@ -141,18 +122,10 @@ default: all
|
|||
all: $(DOL)
|
||||
|
||||
ALL_DIRS := $(sort $(dir $(O_FILES)))
|
||||
ifeq ($(EPILOGUE_PROCESS),1)
|
||||
EPI_DIRS := $(sort $(dir $(E_FILES)))
|
||||
endif
|
||||
|
||||
# Make sure build directory exists before compiling anything
|
||||
DUMMY != mkdir -p $(ALL_DIRS)
|
||||
|
||||
# ifeq ($(EPILOGUE_PROCESS),1)
|
||||
# Make sure profile directory exists before compiling anything
|
||||
# DUMMY != mkdir -p $(EPI_DIRS)
|
||||
# endif
|
||||
|
||||
.PHONY: tools
|
||||
|
||||
$(LDSCRIPT): ldscript.lcf
|
||||
|
@ -172,17 +145,10 @@ tools:
|
|||
$(MAKE) -C tools
|
||||
|
||||
# ELF creation makefile instructions
|
||||
ifeq ($(EPILOGUE_PROCESS),1)
|
||||
@echo Linking ELF $@
|
||||
$(ELF): $(O_FILES) $(E_FILES) $(LDSCRIPT)
|
||||
$(QUIET) @echo $(O_FILES) > build/o_files
|
||||
$(QUIET) $(LD) $(LDFLAGS) -o $@ -lcf $(LDSCRIPT) @build/o_files
|
||||
else
|
||||
$(ELF): $(O_FILES) $(LDSCRIPT)
|
||||
@echo Linking ELF $@
|
||||
$(QUIET) @echo $(O_FILES) > build/o_files
|
||||
$(QUIET) $(LD) $(LDFLAGS) -o $@ -lcf $(LDSCRIPT) @build/o_files
|
||||
endif
|
||||
|
||||
%.d.unix: %.d $(TRANSFORM_DEP)
|
||||
@echo Processing $<
|
||||
|
@ -194,6 +160,10 @@ $(BUILD_DIR)/%.o: %.s
|
|||
@echo Assembling $<
|
||||
$(QUIET) $(AS) $(ASFLAGS) -o $@ $<
|
||||
|
||||
$(BUILD_DIR)/%.ep.o: $(BUILD_DIR)/%.o
|
||||
@echo Frank is fixing $<
|
||||
$(QUIET) $(PYTHON) $(FRANK) $< $@
|
||||
|
||||
$(BUILD_DIR)/%.o: %.c
|
||||
@echo "Compiling " $<
|
||||
$(QUIET) $(CC) $(CFLAGS) -c -o $(dir $@) $<
|
||||
|
@ -206,22 +176,6 @@ $(BUILD_DIR)/%.o: %.cpp
|
|||
@echo "Compiling " $<
|
||||
$(QUIET) $(CC) $(CFLAGS) -c -o $(dir $@) $<
|
||||
|
||||
ifeq ($(EPILOGUE_PROCESS),1)
|
||||
$(EPILOGUE_DIR)/%.o: %.c $(BUILD_DIR)/%.o
|
||||
@echo Frank is fixing $<
|
||||
$(QUIET) $(PYTHON) $(FRANK) $(word 2,$^) $(word 2,$^)
|
||||
|
||||
$(EPILOGUE_DIR)/%.o: %.cp $(BUILD_DIR)/%.o
|
||||
@echo Frank is fixing $<
|
||||
$(QUIET) $(PYTHON) $(FRANK) $(word 2,$^) $(word 2,$^)
|
||||
|
||||
$(EPILOGUE_DIR)/%.o: %.cpp $(BUILD_DIR)/%.o
|
||||
@echo Frank is fixing $<
|
||||
$(QUIET) $(PYTHON) $(FRANK) $(word 2,$^) $(word 2,$^)
|
||||
endif
|
||||
# If we need Frank, add the following after the @echo
|
||||
# $(QUIET) $(CC_EPI) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
### Debug Print ###
|
||||
|
||||
print-% : ; $(info $* is a $(flavor $*) variable set to [$($*)]) @true
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
# Files with unscheduled epilogues.
|
||||
|
||||
|
||||
EPILOGUE_UNSCHEDULED:=\
|
||||
$(EPILOGUE_DIR)/src/Dolphin/os/OSAudioSystem.o\
|
|
@ -691,7 +691,7 @@ OS_FILES :=\
|
|||
$(BUILD_DIR)/asm/Dolphin/os/OS.o\
|
||||
$(BUILD_DIR)/asm/Dolphin/os/OSAlarm.o\
|
||||
$(BUILD_DIR)/asm/Dolphin/os/OSArena.o\
|
||||
$(BUILD_DIR)/src/Dolphin/os/OSAudioSystem.o\
|
||||
$(BUILD_DIR)/src/Dolphin/os/OSAudioSystem.ep.o\
|
||||
$(BUILD_DIR)/asm/Dolphin/os/OSCache.o\
|
||||
$(BUILD_DIR)/asm/Dolphin/os/OSContext.o\
|
||||
$(BUILD_DIR)/asm/Dolphin/os/OSError.o\
|
||||
|
|
|
@ -12,7 +12,7 @@ import argparse
|
|||
BLR_BYTE_SEQ = b"\x4E\x80\x00\x20"
|
||||
MTLR_BYTE_SEQ = b"\x7C\x08\x03\xA6"
|
||||
|
||||
# Example invocation: ./frank.py vanilla.o profile.o output.o
|
||||
# Example invocation: ./frank.py vanilla.o target.o
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("vanilla", help="Path to the vanilla object", type=argparse.FileType('rb'))
|
||||
parser.add_argument("target", help="Path to the target object (to write)")
|
||||
|
|
Loading…
Reference in New Issue