mirror of
https://github.com/zeldaret/tp
synced 2026-05-23 06:54:28 -04:00
a072e71c33
* Z2SoundHandles: decomp portions
* start decomping: Z2SpeechMgr2, Z2SoundHandles
* Z2SoundHandles::stopAllSounds(): ok
* Z2SoundHandles::getHandleUserData(): ok
* Z2SoundInfo: header
* Z2SoundObjBase::framework(): ok
* Z2SoundObjBase::Z2SoundObjBase(), Z2SoundObjBase::init(): ok
* Z2SoundObjBase::~Z2SoundObjBase(): ok
* Z2SoundObjBase::stopOK(): ok
* Z2SoundObjBase::stopOK, incomplete Z2SoundObjBase::dispose()
* clang-format
* Z2SoundObjBase::dispose(): ok
* JAISound::operator->(): null assert
* JAIAudience: stub
* Z2SoundObject::{init, deleteObject, isAlive}: ok
* Z2SeMgr: elaborate struct (and decl JAISoundHandles to support this)
* start subclassing Z2SoundObjBase; nonmatching Z2SoundObjSimple::init()
* Z2SeMGr::{incrCrowdSize, decrCrowdSize}: ok
* Z2MultiSeMgr::resetMultiSePos(): ok
* Z2WolfHowlMgr.h: decls
* Z2SoundStarter: move to decls and fix postprocess.py symbol pass
* Z2AudioArcLoader: decls
* Z2SoundObjMgr: ok some fns
- deleteEnemyAll()
- isTwilightBattle()
- setGhostEnemyState()
additionally elaborates parts of the Z2Creature hierarchy
* delete unused .s files and add tool to find them (only runs on linux)
* run clang-format
* postprocess.py: comment out debugging
* add python step to ok-check workflow
* address review comments
* address review comments
Co-authored-by: notyourav <65437533+notyourav@users.noreply.github.com>
Co-authored-by: Pheenoh <pheenoh@gmail.com>
Co-authored-by: notyourav <65437533+notyourav@users.noreply.github.com>
145 lines
3.5 KiB
Makefile
145 lines
3.5 KiB
Makefile
WINDOWS := $(shell which wine ; echo $$?)
|
|
UNAME_S := $(shell uname -s)
|
|
|
|
#-------------------------------------------------------------------------------
|
|
# Options
|
|
#-------------------------------------------------------------------------------
|
|
DEBUG ?= 0
|
|
ifeq ($(DEBUG), 1)
|
|
CFLAGS += -g
|
|
else
|
|
CFLAGS +=
|
|
endif
|
|
|
|
#-------------------------------------------------------------------------------
|
|
# Files
|
|
#-------------------------------------------------------------------------------
|
|
|
|
TARGET_COL := wii
|
|
|
|
TARGET := dolzel2
|
|
|
|
BUILD_DIR := build/$(TARGET)
|
|
|
|
SRC_DIRS := $(shell find src/ libs/ -type f -name '*.cpp')
|
|
ASM_DIRS := $(shell find asm/ -type f -name '*.s')
|
|
|
|
# Inputs
|
|
LDSCRIPT := $(BUILD_DIR)/ldscript.lcf
|
|
|
|
# Outputs
|
|
DOL := $(BUILD_DIR)/main.dol
|
|
ELF := $(DOL:.dol=.elf)
|
|
MAP := $(BUILD_DIR)/dolzel2.map
|
|
|
|
include obj_files.mk
|
|
|
|
O_FILES := $(INIT_O_FILES) $(EXTAB_O_FILES) $(EXTABINDEX_O_FILES) $(TEXT_O_FILES) \
|
|
$(CTORS_O_FILES) $(DTORS_O_FILES) $(RODATA_O_FILES) $(DATA_O_FILES) \
|
|
$(BSS_O_FILES) $(SDATA_O_FILES) $(SBSS_O_FILES) \
|
|
$(SDATA2_O_FILES) $(SBSS2_O_FILES)
|
|
|
|
#-------------------------------------------------------------------------------
|
|
# Tools
|
|
#-------------------------------------------------------------------------------
|
|
|
|
MWCC_VERSION := 2.7
|
|
|
|
# Programs
|
|
ifeq ($(WINDOWS),1)
|
|
WINE :=
|
|
else
|
|
WINE := wine
|
|
endif
|
|
|
|
# Hack for OSX
|
|
ifeq ($(UNAME_S),Darwin)
|
|
CPP := cpp-10 -P
|
|
SHA1SUM := shasum -a 1
|
|
else
|
|
CPP := cpp -P
|
|
SHA1SUM := sha1sum
|
|
endif
|
|
|
|
AS := $(DEVKITPPC)/bin/powerpc-eabi-as
|
|
OBJCOPY := $(DEVKITPPC)/bin/powerpc-eabi-objcopy
|
|
STRIP := $(DEVKITPPC)/bin/powerpc-eabi-strip
|
|
CC := $(WINE) tools/mwcc_compiler/$(MWCC_VERSION)/mwcceppc.exe
|
|
LD := $(WINE) tools/mwcc_compiler/$(MWCC_VERSION)/mwldeppc.exe
|
|
ELF2DOL := tools/elf2dol
|
|
PYTHON := python3
|
|
DOXYGEN := doxygen
|
|
|
|
POSTPROC := tools/postprocess.py
|
|
|
|
# Options
|
|
INCLUDES := -i include -i include/dolphin/ -i src
|
|
|
|
# Assembler flags
|
|
ASFLAGS := -mgekko -I include
|
|
|
|
# Linker flags
|
|
LDFLAGS := -map $(MAP) -fp hard -nodefaults -w off
|
|
|
|
# Compiler flags
|
|
CFLAGS += -Cpp_exceptions off -proc gekko -fp hard -O3 -nodefaults -msgstyle gcc -enum int $(INCLUDES)
|
|
|
|
# elf2dol needs to know these in order to calculate sbss correctly.
|
|
SDATA_PDHR := 9
|
|
SBSS_PDHR := 10
|
|
|
|
#-------------------------------------------------------------------------------
|
|
# Recipes
|
|
#-------------------------------------------------------------------------------
|
|
|
|
### Default target ###
|
|
|
|
default: all
|
|
|
|
all: dirs $(DOL)
|
|
|
|
ALL_DIRS := build $(BUILD_DIR) $(addprefix $(BUILD_DIR)/,$(SRC_DIRS) $(ASM_DIRS))
|
|
|
|
# Make sure build directory exists before compiling anything
|
|
dirs:
|
|
$(shell mkdir -p $(ALL_DIRS))
|
|
|
|
$(LDSCRIPT): ldscript.lcf
|
|
$(CPP) -MMD -MP -MT $@ -MF $@.d -I include/ -I . -DBUILD_DIR=$(BUILD_DIR) -o $@ $<
|
|
|
|
$(DOL): $(ELF) | tools
|
|
$(ELF2DOL) $< $@ $(SDATA_PDHR) $(SBSS_PDHR) $(TARGET_COL)
|
|
$(SHA1SUM) -c $(TARGET).sha1
|
|
|
|
clean:
|
|
rm -f -d -r build
|
|
$(MAKE) -C tools clean
|
|
|
|
tools:
|
|
$(MAKE) -C tools
|
|
|
|
docs:
|
|
$(DOXYGEN) Doxyfile
|
|
|
|
$(ELF): $(O_FILES) $(LDSCRIPT)
|
|
echo $(O_FILES) > build/o_files
|
|
$(LD) $(LDFLAGS) -o $@ -lcf $(LDSCRIPT) @build/o_files
|
|
# The Metrowerks linker doesn't generate physical addresses in the ELF program headers. This fixes it somehow.
|
|
# $(OBJCOPY) $@ $@
|
|
|
|
$(BUILD_DIR)/%.o: %.s
|
|
$(AS) $(ASFLAGS) -o $@ $<
|
|
|
|
$(BUILD_DIR)/%.o: %.c
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
$(BUILD_DIR)/%.o: %.cpp
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
$(PYTHON) $(POSTPROC) -fsymbol-fixup $@
|
|
|
|
### Debug Print ###
|
|
|
|
print-% : ; $(info $* is a $(flavor $*) variable set to [$($*)]) @true
|
|
|
|
.PHONY: default all dirs clean tools docs print-%
|