Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 10 additions & 33 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -284,39 +284,10 @@ else
ACPP := $(QEMU_IRIX) -silent -L $(IRIX_ROOT) $(IRIX_ROOT)/usr/lib/acpp
COPT := $(QEMU_IRIX) -silent -L $(IRIX_ROOT) $(IRIX_ROOT)/usr/lib/copt
else
# Detect host platform for IDO recomp binaries (allow override via IDO_PLATFORM)
ifndef IDO_PLATFORM
DETECTED_OS := $(shell uname -s)
ifeq ($(DETECTED_OS),Linux)
DETECTED_ARCH := $(shell uname -m)
ifeq ($(DETECTED_ARCH),aarch64)
IDO_PLATFORM := linux-arm
else
IDO_PLATFORM := linux
endif
else ifeq ($(DETECTED_OS),Darwin)
IDO_PLATFORM := macos
else ifneq (,$(findstring MINGW,$(DETECTED_OS)))
IDO_PLATFORM := windows
else ifneq (,$(findstring MSYS,$(DETECTED_OS)))
IDO_PLATFORM := windows
else ifneq (,$(findstring CYGWIN,$(DETECTED_OS)))
IDO_PLATFORM := windows
else
$(error Unsupported platform: $(DETECTED_OS))
endif
endif

# Windows binaries carry the .exe suffix
IDO_EXE_SUFFIX :=
ifeq ($(IDO_PLATFORM),windows)
IDO_EXE_SUFFIX := .exe
endif

IDO_ROOT := $(TOOLS_DIR)/ido-5.3-recomp-$(IDO_PLATFORM)
CC := $(IDO_ROOT)/cc$(IDO_EXE_SUFFIX)
ACPP := $(IDO_ROOT)/acpp$(IDO_EXE_SUFFIX)
COPT := $(IDO_ROOT)/copt$(IDO_EXE_SUFFIX)
IDO_ROOT := $(TOOLS_DIR)/ido-static-recomp/build/out
CC := $(IDO_ROOT)/cc
ACPP := $(IDO_ROOT)/acpp
COPT := $(IDO_ROOT)/copt
endif
endif
LD := $(CROSS)ld
Expand Down Expand Up @@ -387,6 +358,12 @@ VADPCM_ENC := $(TOOLS_DIR)/vadpcm_enc
EXTRACT_DATA_FOR_MIO := $(TOOLS_DIR)/extract_data_for_mio
SKYCONV := $(TOOLS_DIR)/skyconv
FLIPS := $(TOOLS_DIR)/flips
# Use the system installed armips if available. Otherwise use the one provided with this repository.
ifneq (,$(call find-command,armips))
RSPASM := armips
else
RSPASM := $(TOOLS_DIR)/armips
endif
ENDIAN_BITWIDTH := $(BUILD_DIR)/endian-and-bitwidth
EMULATOR = mupen64plus
EMU_FLAGS = --noosd
Expand Down
4 changes: 0 additions & 4 deletions tools/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,3 @@
!/ido5.3_compiler/usr/lib/*.so
!/ido5.3_compiler/usr/lib/*.so.1
!/ido5.3_compiler/**/*.o
!/ido-5.3-recomp-linux/*
!/ido-5.3-recomp-linux-arm/*
!/ido-5.3-recomp-macos/*
!/ido-5.3-recomp-windows/*
26 changes: 22 additions & 4 deletions tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ CC := gcc
CXX := g++
CFLAGS := -I . -I sm64tools -Wall -Wextra -Wno-unused-parameter -pedantic -O2 -s
LDFLAGS := -lm
ALL_PROGRAMS := textconv patch_elf_32bit aifc_decode aiff_extract_codebook vadpcm_enc tabledesign extract_data_for_mio skyconv slienc
ALL_PROGRAMS := armips textconv patch_elf_32bit aifc_decode aiff_extract_codebook vadpcm_enc tabledesign extract_data_for_mio skyconv slienc
LIBAUDIOFILE := audiofile/libaudiofile.a

BUILD_PROGRAMS := $(ALL_PROGRAMS)
# Only build armips from tools if it is not found on the system
ifeq ($(call find-command,armips),)
BUILD_PROGRAMS := $(ALL_PROGRAMS)
else
BUILD_PROGRAMS := $(filter-out armips,$(ALL_PROGRAMS))
endif

default: all

Expand All @@ -34,6 +39,14 @@ extract_data_for_mio_SOURCES := extract_data_for_mio.c

skyconv_SOURCES := skyconv.c sm64tools/n64graphics.c sm64tools/utils.c

armips: CC := $(CXX)
armips_SOURCES := armips.cpp
armips_CFLAGS := -std=gnu++11 -fno-exceptions -fno-rtti -pipe
armips_LDFLAGS := -pthread
ifeq ($(HOST_ENV),MinGW)
armips_LDFLAGS += -municode
endif

ifeq ($(shell uname -s),Linux)
BUILD_PROGRAMS += flips
endif
Expand All @@ -52,20 +65,25 @@ slienc_CFLAGS :=

all-except-recomp: $(LIBAUDIOFILE) $(BUILD_PROGRAMS)

all: all-except-recomp
all: all-except-recomp ido-static-recomp

clean:
$(RM) $(ALL_PROGRAMS)
$(MAKE) -C audiofile clean
$(MAKE) -C ido-static-recomp clean

define COMPILE
$(1): $($1_SOURCES)
$$(CC) $(CFLAGS) $($1_CFLAGS) $$^ -o $$@ $($1_LDFLAGS) $(LDFLAGS)
endef

ido-static-recomp:
@$(MAKE) -C ido-static-recomp setup
@$(MAKE) -C ido-static-recomp

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

$(LIBAUDIOFILE):
@$(MAKE) -C audiofile

.PHONY: all all-except-recomp clean default
.PHONY: all all-except-recomp clean default ido-static-recomp
Binary file removed tools/ido-5.3-recomp-linux-arm/acpp
Binary file not shown.
Binary file removed tools/ido-5.3-recomp-linux-arm/as0
Binary file not shown.
Binary file removed tools/ido-5.3-recomp-linux-arm/as1
Binary file not shown.
Binary file removed tools/ido-5.3-recomp-linux-arm/c++filt
Binary file not shown.
Binary file removed tools/ido-5.3-recomp-linux-arm/cc
Binary file not shown.
Binary file removed tools/ido-5.3-recomp-linux-arm/cfe
Binary file not shown.
Binary file removed tools/ido-5.3-recomp-linux-arm/copt
Binary file not shown.
Binary file removed tools/ido-5.3-recomp-linux-arm/crt1.o
Binary file not shown.
Binary file removed tools/ido-5.3-recomp-linux-arm/crtn.o
Binary file not shown.
Loading