Skip to content

Commit

Permalink
Fix torch (n64decomp#600)
Browse files Browse the repository at this point in the history
* Fixed torch
  • Loading branch information
MegaMech authored Apr 10, 2024
1 parent 3da5a4f commit ad49522
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 17 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "doxygen-awesome-css"]
path = doxygen-awesome-css
url = https://github.com/jothepro/doxygen-awesome-css.git
[submodule "tools/torch"]
path = tools/torch
url = https://github.com/HarbourMasters/torch
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ BIN2C := $(PYTHON) $(TOOLS_DIR)/bin2c.py
EXTRACT_DATA_FOR_MIO := $(TOOLS_DIR)/extract_data_for_mio
ASSET_EXTRACT := $(PYTHON) $(TOOLS_DIR)/new_extract_assets.py
LINKONLY_GENERATOR := $(PYTHON) $(TOOLS_DIR)/linkonly_generator.py
TORCH := tools/torch/torch
TORCH := tools/torch/cmake-build-release/torch
EMULATOR = mupen64plus
EMU_FLAGS = --noosd
LOADER = loader64
Expand Down Expand Up @@ -399,7 +399,7 @@ endif

assets:
@echo "Extracting torch assets..."
@$(TORCH) code $(BASEROM) -v
@$(TORCH) code $(BASEROM)
@$(TORCH) header $(BASEROM)
@$(TORCH) modding export $(BASEROM)

Expand Down
22 changes: 7 additions & 15 deletions tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,17 @@ n64cksum_CFLAGS := -DN64CKSUM_STANDALONE

extract_data_for_mio_SOURCES := extract_data_for_mio.c

ifeq ($(OS),Windows_NT)
DETECTED_OS=windows
# Set Windows temporary directory to its environment variable
export TMPDIR=$(TEMP)
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
DETECTED_OS=linux
else ifeq ($(UNAME_S),Darwin)
DETECTED_OS=macos
endif
endif

# Build tools and recomp
all: $(PROGRAMS)
all: $(PROGRAMS) torch

torch:
@echo "Building Torch..."
$(MAKE) -C torch type=release -j$(N_THREADS)

# Remove generated files
clean:
$(RM) $(PROGRAMS)
$(RM) -rf torch/cmake-build-release



Expand All @@ -63,4 +55,4 @@ endef

$(foreach p,$(PROGRAMS),$(eval $(call COMPILE,$(p))))

.PHONY: all clean default
.PHONY: all clean default torch
1 change: 1 addition & 0 deletions tools/torch
Submodule torch added at 74b0c1
Binary file removed tools/torch/torch
Binary file not shown.

0 comments on commit ad49522

Please sign in to comment.