Clean up and improvements to tools (#163)

* moved elf2dol

* removed postprocess.py

* removed vtables.py

* find_unused_asm.py

* removed section2cpp.py

* removed splitter/*

* fixed symbol names due to iconv file rename

* fixed problem building RELs caused by #160

* improved performance of a few python tools

* added new tool for finding conflict when not OK

* added ./tp setup

* don't install dol2asm dependecies with requirements.txt

* format and check for imports

* remove unused tools/difftools.py

* fixed ignore to include elf2dol

* fix compiler patcher

* ok-check now creates the patched compiler at mwcceppc_patched.exe

* Add new command to copy the build folder to the expected folder

* 'make clean' will now only clean main.dol stuff. (added clean_rels and clean_all)

* './tp pull-request' and './tp check' now doesn't include RELs by default. Use '--rels' to include them in the process.

* './tp remove-unused-asm --check' added, exitcode 0==no files, 1==exists files

Co-authored-by: Julgodis <>
This commit is contained in:
Jonathan Wase
2021-12-02 23:38:37 +01:00
committed by GitHub
co-authored by Julgodis <>
parent 5f187a0776
commit bc428f7f65
829 changed files with 5043 additions and 4328 deletions
+1 -1
View File
@@ -15,6 +15,6 @@ jobs:
with:
token: ${{secrets.MY_REPO_PAT}}
- name: Copy in dol and compilers
run: cp /tmp/baserom.dol ./baserom.dol && cp -r /tmp/mwcc_compiler/ tools/mwcc_compiler && chown root /github/home/
run: cp /tmp/baserom.dol ./baserom.dol && cp -r /tmp/mwcc_compiler/ tools/mwcc_compiler && cp tools/mwcc_compiler/2.7/mwcceppc.exe tools/mwcc_compiler/2.7/mwcceppc_patched.exe && chown root /github/home/
- name: Run Make (OK)
run: make
+30 -18
View File
@@ -19,7 +19,8 @@ TARGET_COL := wii
TARGET := dolzel2
BUILD_DIR := build/$(TARGET)
BUILD_PATH := build
BUILD_DIR := $(BUILD_PATH)/$(TARGET)
SRC_DIRS := $(shell find src/ libs/ -type f -name '*.cpp')
ASM_DIRS := $(shell find asm/ -type f -name '*.s')
@@ -33,7 +34,7 @@ ELF := $(DOL:.dol=.elf)
MAP := $(BUILD_DIR)/dolzel2.map
# include list of object files
-include obj_files.mk
include obj_files.mk
#-------------------------------------------------------------------------------
# Tools
@@ -60,15 +61,15 @@ 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
CC := $(WINE) tools/mwcc_compiler/$(MWCC_VERSION)/mwcceppc_patched.exe
LD := $(WINE) tools/mwcc_compiler/$(MWCC_VERSION)/mwldeppc.exe
ELF2DOL := tools/elf2dol
ELF2DOL := $(BUILD_PATH)/elf2dol
PYTHON := python3
ICONV := iconv
DOXYGEN := doxygen
MAKEREL := tools/makerel.py
IMAGENAME := gz2e01.iso
POSTPROC := tools/postprocess.py
# Options
INCLUDES := -i include -i include/dolphin/ -i src
@@ -95,44 +96,52 @@ 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))
@mkdir -p build
@mkdir -p $(BUILD_DIR)
$(DOL): $(ELF) | tools
$(ELF2DOL) $< $@ $(SDATA_PDHR) $(SBSS_PDHR) $(TARGET_COL)
$(SHA1SUM) -c $(TARGET).sha1
clean:
rm -f -d -r build
$(MAKE) -C tools clean
rm -f -d -r $(BUILD_DIR)/libs
rm -f -d -r $(BUILD_DIR)/src
rm -f $(ELF)
rm -f $(DOL)
rm -f $(BUILD_DIR)/*.a
tools:
@$(MAKE) -C tools
clean_all:
rm -f -d -r build
clean_rels:
rm -f -d -r $(BUILD_DIR)/rel
rm -f $(BUILD_PATH)/*.rel
tools: $(ELF2DOL)
assets:
@cd game; python3 ../tools/extract_game_assets.py ../$(IMAGENAME)
@cd game; $(PYTHON) ../tools/extract_game_assets.py ../$(IMAGENAME)
docs:
$(DOXYGEN) Doxyfile
rels: $(ELF) $(RELS)
@echo generating RELs from .plf
@python3 tools/makerel.py build --string-table $(BUILD_DIR)/frameworkF.str $(RELS) $(ELF)
@$(PYTHON) $(MAKEREL) build --string-table $(BUILD_DIR)/frameworkF.str $(RELS) $(ELF)
$(ELF): $(LIBS) $(O_FILES)
@echo $(O_FILES) > build/o_files
@python3 tools/lcf.py dol --output $(LDSCRIPT)
@$(PYTHON) tools/lcf.py dol --output $(LDSCRIPT)
$(LD) -application $(LDFLAGS) -o $@ -lcf $(LDSCRIPT) @build/o_files $(LIBS)
#
$(BUILD_DIR)/%.o: %.cpp
@mkdir -p $(@D)
@echo building... $<
@iconv -f UTF-8 -t CP932 < $< > $@.iconv.cpp
@$(CC) $(CFLAGS) -c -o $@ $@.iconv.cpp
@$(ICONV) -f UTF-8 -t CP932 < $< > $(basename $@).cpp
@$(CC) $(CFLAGS) -c -o $@ $(basename $@).cpp
# shared cpp files for RELs
$(BUILD_DIR)/rel/%.o: rel/%.cpp
@@ -142,6 +151,9 @@ $(BUILD_DIR)/rel/%.o: rel/%.cpp
# include library and rel makefiles
-include include_link.mk
# tools
include tools/elf2dol/Makefile
### Debug Print ###
print-% : ; $(info $* is a $(flavor $*) variable set to [$($*)]) @true
+2 -2
View File
@@ -58,6 +58,6 @@ $(BUILD_DIR)/libJ2DGraph.a: $(LIBJ2DGRAPH_A_O_FILES)
$(BUILD_DIR)/libs/JSystem/J2DGraph/%.o: libs/JSystem/J2DGraph/%.cpp
@mkdir -p $(@D)
@echo building... $<
@iconv -f UTF-8 -t CP932 < $< > $@.iconv.cpp
@$(CC) $(CFLAGS) $(LIBJ2DGRAPH_A_CFLAGS) -c -o $@ $@.iconv.cpp
@$(ICONV) -f UTF-8 -t CP932 < $< > $(basename $@).cpp
@$(CC) $(CFLAGS) $(LIBJ2DGRAPH_A_CFLAGS) -c -o $@ $(basename $@).cpp
+2 -2
View File
@@ -44,6 +44,6 @@ $(BUILD_DIR)/libJ3DGraphAnimator.a: $(LIBJ3DGRAPHANIMATOR_A_O_FILES)
$(BUILD_DIR)/libs/JSystem/J3DGraphAnimator/%.o: libs/JSystem/J3DGraphAnimator/%.cpp
@mkdir -p $(@D)
@echo building... $<
@iconv -f UTF-8 -t CP932 < $< > $@.iconv.cpp
@$(CC) $(CFLAGS) $(LIBJ3DGRAPHANIMATOR_A_CFLAGS) -c -o $@ $@.iconv.cpp
@$(ICONV) -f UTF-8 -t CP932 < $< > $(basename $@).cpp
@$(CC) $(CFLAGS) $(LIBJ3DGRAPHANIMATOR_A_CFLAGS) -c -o $@ $(basename $@).cpp
+2 -2
View File
@@ -50,6 +50,6 @@ $(BUILD_DIR)/libJ3DGraphBase.a: $(LIBJ3DGRAPHBASE_A_O_FILES)
$(BUILD_DIR)/libs/JSystem/J3DGraphBase/%.o: libs/JSystem/J3DGraphBase/%.cpp
@mkdir -p $(@D)
@echo building... $<
@iconv -f UTF-8 -t CP932 < $< > $@.iconv.cpp
@$(CC) $(CFLAGS) $(LIBJ3DGRAPHBASE_A_CFLAGS) -c -o $@ $@.iconv.cpp
@$(ICONV) -f UTF-8 -t CP932 < $< > $(basename $@).cpp
@$(CC) $(CFLAGS) $(LIBJ3DGRAPHBASE_A_CFLAGS) -c -o $@ $(basename $@).cpp
+2 -2
View File
@@ -38,6 +38,6 @@ $(BUILD_DIR)/libJ3DGraphLoader.a: $(LIBJ3DGRAPHLOADER_A_O_FILES)
$(BUILD_DIR)/libs/JSystem/J3DGraphLoader/%.o: libs/JSystem/J3DGraphLoader/%.cpp
@mkdir -p $(@D)
@echo building... $<
@iconv -f UTF-8 -t CP932 < $< > $@.iconv.cpp
@$(CC) $(CFLAGS) $(LIBJ3DGRAPHLOADER_A_CFLAGS) -c -o $@ $@.iconv.cpp
@$(ICONV) -f UTF-8 -t CP932 < $< > $(basename $@).cpp
@$(CC) $(CFLAGS) $(LIBJ3DGRAPHLOADER_A_CFLAGS) -c -o $@ $(basename $@).cpp
+2 -2
View File
@@ -26,6 +26,6 @@ $(BUILD_DIR)/libJ3DU.a: $(LIBJ3DU_A_O_FILES)
$(BUILD_DIR)/libs/JSystem/J3DU/%.o: libs/JSystem/J3DU/%.cpp
@mkdir -p $(@D)
@echo building... $<
@iconv -f UTF-8 -t CP932 < $< > $@.iconv.cpp
@$(CC) $(CFLAGS) $(LIBJ3DU_A_CFLAGS) -c -o $@ $@.iconv.cpp
@$(ICONV) -f UTF-8 -t CP932 < $< > $(basename $@).cpp
@$(CC) $(CFLAGS) $(LIBJ3DU_A_CFLAGS) -c -o $@ $(basename $@).cpp
+2 -2
View File
@@ -158,6 +158,6 @@ $(BUILD_DIR)/libJAudio2.a: $(LIBJAUDIO2_A_O_FILES)
$(BUILD_DIR)/libs/JSystem/JAudio2/%.o: libs/JSystem/JAudio2/%.cpp
@mkdir -p $(@D)
@echo building... $<
@iconv -f UTF-8 -t CP932 < $< > $@.iconv.cpp
@$(CC) $(CFLAGS) $(LIBJAUDIO2_A_CFLAGS) -c -o $@ $@.iconv.cpp
@$(ICONV) -f UTF-8 -t CP932 < $< > $(basename $@).cpp
@$(CC) $(CFLAGS) $(LIBJAUDIO2_A_CFLAGS) -c -o $@ $(basename $@).cpp
+2 -2
View File
@@ -26,6 +26,6 @@ $(BUILD_DIR)/libJFramework.a: $(LIBJFRAMEWORK_A_O_FILES)
$(BUILD_DIR)/libs/JSystem/JFramework/%.o: libs/JSystem/JFramework/%.cpp
@mkdir -p $(@D)
@echo building... $<
@iconv -f UTF-8 -t CP932 < $< > $@.iconv.cpp
@$(CC) $(CFLAGS) $(LIBJFRAMEWORK_A_CFLAGS) -c -o $@ $@.iconv.cpp
@$(ICONV) -f UTF-8 -t CP932 < $< > $(basename $@).cpp
@$(CC) $(CFLAGS) $(LIBJFRAMEWORK_A_CFLAGS) -c -o $@ $(basename $@).cpp
+2 -2
View File
@@ -28,6 +28,6 @@ $(BUILD_DIR)/libJGadget.a: $(LIBJGADGET_A_O_FILES)
$(BUILD_DIR)/libs/JSystem/JGadget/%.o: libs/JSystem/JGadget/%.cpp
@mkdir -p $(@D)
@echo building... $<
@iconv -f UTF-8 -t CP932 < $< > $@.iconv.cpp
@$(CC) $(CFLAGS) $(LIBJGADGET_A_CFLAGS) -c -o $@ $@.iconv.cpp
@$(ICONV) -f UTF-8 -t CP932 < $< > $(basename $@).cpp
@$(CC) $(CFLAGS) $(LIBJGADGET_A_CFLAGS) -c -o $@ $(basename $@).cpp
+2 -2
View File
@@ -72,6 +72,6 @@ $(BUILD_DIR)/libJKernel.a: $(LIBJKERNEL_A_O_FILES)
$(BUILD_DIR)/libs/JSystem/JKernel/%.o: libs/JSystem/JKernel/%.cpp
@mkdir -p $(@D)
@echo building... $<
@iconv -f UTF-8 -t CP932 < $< > $@.iconv.cpp
@$(CC) $(CFLAGS) $(LIBJKERNEL_A_CFLAGS) -c -o $@ $@.iconv.cpp
@$(ICONV) -f UTF-8 -t CP932 < $< > $(basename $@).cpp
@$(CC) $(CFLAGS) $(LIBJKERNEL_A_CFLAGS) -c -o $@ $(basename $@).cpp
+2 -2
View File
@@ -28,6 +28,6 @@ $(BUILD_DIR)/libJMath.a: $(LIBJMATH_A_O_FILES)
$(BUILD_DIR)/libs/JSystem/JMath/%.o: libs/JSystem/JMath/%.cpp
@mkdir -p $(@D)
@echo building... $<
@iconv -f UTF-8 -t CP932 < $< > $@.iconv.cpp
@$(CC) $(CFLAGS) $(LIBJMATH_A_CFLAGS) -c -o $@ $@.iconv.cpp
@$(ICONV) -f UTF-8 -t CP932 < $< > $(basename $@).cpp
@$(CC) $(CFLAGS) $(LIBJMATH_A_CFLAGS) -c -o $@ $(basename $@).cpp
+2 -2
View File
@@ -32,6 +32,6 @@ $(BUILD_DIR)/libJMessage.a: $(LIBJMESSAGE_A_O_FILES)
$(BUILD_DIR)/libs/JSystem/JMessage/%.o: libs/JSystem/JMessage/%.cpp
@mkdir -p $(@D)
@echo building... $<
@iconv -f UTF-8 -t CP932 < $< > $@.iconv.cpp
@$(CC) $(CFLAGS) $(LIBJMESSAGE_A_CFLAGS) -c -o $@ $@.iconv.cpp
@$(ICONV) -f UTF-8 -t CP932 < $< > $(basename $@).cpp
@$(CC) $(CFLAGS) $(LIBJMESSAGE_A_CFLAGS) -c -o $@ $(basename $@).cpp
+2 -2
View File
@@ -52,6 +52,6 @@ $(BUILD_DIR)/libJParticle.a: $(LIBJPARTICLE_A_O_FILES)
$(BUILD_DIR)/libs/JSystem/JParticle/%.o: libs/JSystem/JParticle/%.cpp
@mkdir -p $(@D)
@echo building... $<
@iconv -f UTF-8 -t CP932 < $< > $@.iconv.cpp
@$(CC) $(CFLAGS) $(LIBJPARTICLE_A_CFLAGS) -c -o $@ $@.iconv.cpp
@$(ICONV) -f UTF-8 -t CP932 < $< > $(basename $@).cpp
@$(CC) $(CFLAGS) $(LIBJPARTICLE_A_CFLAGS) -c -o $@ $(basename $@).cpp
+2 -2
View File
@@ -36,6 +36,6 @@ $(BUILD_DIR)/libJStage.a: $(LIBJSTAGE_A_O_FILES)
$(BUILD_DIR)/libs/JSystem/JStage/%.o: libs/JSystem/JStage/%.cpp
@mkdir -p $(@D)
@echo building... $<
@iconv -f UTF-8 -t CP932 < $< > $@.iconv.cpp
@$(CC) $(CFLAGS) $(LIBJSTAGE_A_CFLAGS) -c -o $@ $@.iconv.cpp
@$(ICONV) -f UTF-8 -t CP932 < $< > $(basename $@).cpp
@$(CC) $(CFLAGS) $(LIBJSTAGE_A_CFLAGS) -c -o $@ $(basename $@).cpp
+2 -2
View File
@@ -54,6 +54,6 @@ $(BUILD_DIR)/libJStudio.a: $(LIBJSTUDIO_A_O_FILES)
$(BUILD_DIR)/libs/JSystem/JStudio/JStudio/%.o: libs/JSystem/JStudio/JStudio/%.cpp
@mkdir -p $(@D)
@echo building... $<
@iconv -f UTF-8 -t CP932 < $< > $@.iconv.cpp
@$(CC) $(CFLAGS) $(LIBJSTUDIO_A_CFLAGS) -c -o $@ $@.iconv.cpp
@$(ICONV) -f UTF-8 -t CP932 < $< > $(basename $@).cpp
@$(CC) $(CFLAGS) $(LIBJSTUDIO_A_CFLAGS) -c -o $@ $(basename $@).cpp
@@ -26,6 +26,6 @@ $(BUILD_DIR)/libJStudio_JAudio2.a: $(LIBJSTUDIO_JAUDIO2_A_O_FILES)
$(BUILD_DIR)/libs/JSystem/JStudio/JStudio_JAudio2/%.o: libs/JSystem/JStudio/JStudio_JAudio2/%.cpp
@mkdir -p $(@D)
@echo building... $<
@iconv -f UTF-8 -t CP932 < $< > $@.iconv.cpp
@$(CC) $(CFLAGS) $(LIBJSTUDIO_JAUDIO2_A_CFLAGS) -c -o $@ $@.iconv.cpp
@$(ICONV) -f UTF-8 -t CP932 < $< > $(basename $@).cpp
@$(CC) $(CFLAGS) $(LIBJSTUDIO_JAUDIO2_A_CFLAGS) -c -o $@ $(basename $@).cpp
@@ -26,6 +26,6 @@ $(BUILD_DIR)/libJStudio_JParticle.a: $(LIBJSTUDIO_JPARTICLE_A_O_FILES)
$(BUILD_DIR)/libs/JSystem/JStudio/JStudio_JParticle/%.o: libs/JSystem/JStudio/JStudio_JParticle/%.cpp
@mkdir -p $(@D)
@echo building... $<
@iconv -f UTF-8 -t CP932 < $< > $@.iconv.cpp
@$(CC) $(CFLAGS) $(LIBJSTUDIO_JPARTICLE_A_CFLAGS) -c -o $@ $@.iconv.cpp
@$(ICONV) -f UTF-8 -t CP932 < $< > $(basename $@).cpp
@$(CC) $(CFLAGS) $(LIBJSTUDIO_JPARTICLE_A_CFLAGS) -c -o $@ $(basename $@).cpp
+2 -2
View File
@@ -36,6 +36,6 @@ $(BUILD_DIR)/libJStudio_JStage.a: $(LIBJSTUDIO_JSTAGE_A_O_FILES)
$(BUILD_DIR)/libs/JSystem/JStudio/JStudio_JStage/%.o: libs/JSystem/JStudio/JStudio_JStage/%.cpp
@mkdir -p $(@D)
@echo building... $<
@iconv -f UTF-8 -t CP932 < $< > $@.iconv.cpp
@$(CC) $(CFLAGS) $(LIBJSTUDIO_JSTAGE_A_CFLAGS) -c -o $@ $@.iconv.cpp
@$(ICONV) -f UTF-8 -t CP932 < $< > $(basename $@).cpp
@$(CC) $(CFLAGS) $(LIBJSTUDIO_JSTAGE_A_CFLAGS) -c -o $@ $(basename $@).cpp
+2 -2
View File
@@ -30,6 +30,6 @@ $(BUILD_DIR)/libJSupport.a: $(LIBJSUPPORT_A_O_FILES)
$(BUILD_DIR)/libs/JSystem/JSupport/%.o: libs/JSystem/JSupport/%.cpp
@mkdir -p $(@D)
@echo building... $<
@iconv -f UTF-8 -t CP932 < $< > $@.iconv.cpp
@$(CC) $(CFLAGS) $(LIBJSUPPORT_A_CFLAGS) -c -o $@ $@.iconv.cpp
@$(ICONV) -f UTF-8 -t CP932 < $< > $(basename $@).cpp
@$(CC) $(CFLAGS) $(LIBJSUPPORT_A_CFLAGS) -c -o $@ $(basename $@).cpp

Some files were not shown because too many files have changed in this diff Show More