2023-12-05 00:36:31 +03:00
|
|
|
CC = gcc
|
2024-02-18 05:19:18 +03:00
|
|
|
MAKE = make
|
|
|
|
N_THREADS ?= $(shell nproc)
|
2023-12-05 00:36:31 +03:00
|
|
|
|
|
|
|
UNAME_S := $(shell uname -s)
|
|
|
|
ifeq ($(OS),Windows_NT)
|
2023-12-26 23:55:57 +03:00
|
|
|
$(error Native Windows is currently unsupported for building this repository, use WSL instead c:)
|
2023-12-05 00:36:31 +03:00
|
|
|
else ifeq ($(UNAME_S),Linux)
|
|
|
|
DETECTED_OS := linux
|
2023-12-26 23:55:57 +03:00
|
|
|
MIO0_FLAGS := --gc-sections
|
2023-12-05 00:36:31 +03:00
|
|
|
else ifeq ($(UNAME_S),Darwin)
|
2023-12-26 23:55:57 +03:00
|
|
|
DETECTED_OS := macos
|
|
|
|
MIO0_FLAGS :=
|
2023-12-05 00:36:31 +03:00
|
|
|
endif
|
|
|
|
|
|
|
|
RECOMP_DIR := ido-recomp/$(DETECTED_OS)
|
|
|
|
|
|
|
|
default: all
|
|
|
|
|
2024-02-18 05:19:18 +03:00
|
|
|
all: recomp mio0 torch
|
2023-12-05 00:36:31 +03:00
|
|
|
|
|
|
|
clean:
|
|
|
|
$(RM) -rf $(RECOMP_DIR)
|
|
|
|
$(RM) mio0
|
2024-02-18 05:19:18 +03:00
|
|
|
$(RM) -rf Torch/build
|
2023-12-05 00:36:31 +03:00
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
|
|
|
|
recomp:
|
|
|
|
@echo "Fetching Recomp..."
|
|
|
|
wget https://github.com/decompals/ido-static-recomp/releases/download/v1.0/ido-5.3-recomp-${DETECTED_OS}.tar.gz
|
|
|
|
mkdir -p $(RECOMP_DIR)
|
|
|
|
tar xf ido-5.3-recomp-${DETECTED_OS}.tar.gz -C $(RECOMP_DIR)
|
|
|
|
$(RM) ido-5.3-recomp-${DETECTED_OS}.tar.gz
|
|
|
|
|
|
|
|
mio0:
|
|
|
|
@echo "Building mio0..."
|
2023-12-26 23:55:57 +03:00
|
|
|
$(CC) -Wall -Wextra -Wno-format-overflow -O2 -ffunction-sections -fdata-sections -DMIO0_STANDALONE -s -Wl,${MIO0_FLAGS} -o mio0 mio0-decompressor/libmio0.c
|
2023-12-05 00:36:31 +03:00
|
|
|
|
2024-02-18 05:19:18 +03:00
|
|
|
torch:
|
|
|
|
@echo "Building torch..."
|
|
|
|
$(MAKE) -C Torch type=release -j$(N_THREADS)
|
|
|
|
|
|
|
|
.PHONY: all clean distclean default torch
|