Files
Diddy-Kong-Racing/tools/Makefile
T
e30f1c535a DKR Assets Tool v0.5.2 (Basic glTF support) (#610)
* Removed old unused files

* Added gltf support

* Reverted dkr_assets_tool_settings.json to previous

* Added animated model example

* document audio_vehicle.c (#588)

* wip

* wip

* wip

* wip

* document audio_vehicle.c

* update score once again

* unify function prefix

* small tweaks

* match func_80060910 and func_80060AC8 (#589)

* match func_80060AC8

* reworked func_80060C58

* match func_80060910

* non equivalent func_8006017C

* format

* match calc_env_mapping_for_object

* Homogenate batch flags and render flags and begin the painful task of documenting waves. (#590)

* part one of wave pain

* 2

* littel bit more

* m

* h

* l

* aagghh

* yeah

* :)

* bruh

* b

* m

* faith

* z

* b

* rename batch flags

* Update waves.c

* fix conflicts

* match func_8000B38C (#592)

* match func_8000B38C

* format code

* update score

* match calc_dynamic_lighting_for_object_1 (#594)

* match calc_dynamic_lighting_for_object_1

* format and score

* update score

* update score again

* Document some Boost data (#593)

* Run formatter

* Document some boost info

* decompile and document math_util.c (#595)

* Match func_8002F440 (#596)

* Add a WIP attempt of func_8004447C, and add some scratch links

* match func_8002F440 and run formatter

* Cleanup some comments

* Update score, fix warnings, and run formatter again

* Remove some bad comments

* match: func_8007FFEC (#599)

* feat: allow score script to generate treemap file for decomp progress (#598)

* Various touchups here and there, some renames in camera.c (#597)

* the beginning of the void

* update asset tool

* void :)

* there

* cam

* model

* more

* fix warns

* ok

* whoops missed a rename

* Add a few NON_EQUIVALENT functions from scratches to keep them up to date (#602)

* WIP func_800101AC

* WIP func_800452A0

* cleanup

* Formatter and func_8004CC20 near match

* func_8004CC20 better score and documentation

* func_80049794 WIP and compilable

* Major cleanup of func_80049794

* Formatter

* Update scratch

* Add func_80019808 from scratch

* Cleanup func_80019808

* func_80019808 score improvment

* Improve func_80049794 score (Thanks Dominik!)

* func_8001C6C4 WIP

* func_8001E93C WIP

* small documenting

* Eliminate a lot of Obj64 casts.

* fix: do not pass default to treemap arg (#604)

* Quick fix for score script (#606)

* WIP func_80060EA8

* Quick fix for score script

* name and document lights, CC modes and textures (#607)

* improve match for func_800BDC80 & match func_80060EA8, func_8002F2AC (#609)

* improve match for func_800BDC80 & match func_80060EA8

* match: func_8002F2AC

* match: func_800452A0 & func_80042D20 (#611)

* partial match: func_800452A0, improve from non equiv to non matching

* match: func_800452A0 & func_80042D20

* document: remaining funcs, add decomp.me links (#612)

* match func_8004447C (#615)

* Document camera and sprites (#614)

* Cleanup, and use constants where possible (#617)

* Update func_80060EA8 WIP

* formatter

* More func_80060EA8

* More func_80060EA8

* WIP func_80060EA8

* Minor cleanups and documenting

* minot cleanup

* Define some constant flags properly

* Misc documenting and cleanup

* formatter

* Fix the scratch link for vsprintf (It was DP's)

* Add the WIP version of vsprintf that's 95.82% matching.

* Fix score script (#619)

* Added gltf support

* Allow either commas or vertical pipes for splitting render flags

---------

Co-authored-by: Unnunu <serge_zorkin@mail.ru>
Co-authored-by: Fazana <52551480+FazanaJ@users.noreply.github.com>
Co-authored-by: Ryan Myers <ryan.p.myers@gmail.com>
Co-authored-by: Dominik Peters <github@d-peters.com>
2025-06-12 10:29:08 -04:00

93 lines
2.9 KiB
Makefile

# Make `OPT` -g for better debugging info.
OPT := -O2
# If -g option was set, then add some debugging flags for the stack tracer.
ifneq (,$(findstring -g,$(OPT)))
OPT += -rdynamic -ldl -lelf -ldwarf -DDEBUG -I/usr/include/libdwarf
endif
CC := gcc
CXX := g++
CFLAGS := -I . -Wall -Wextra -Wno-unused-parameter -pedantic -std=c99 $(OPT) -s
# List of specific errors to ignore
IGNORE_W_ERRORS := -Wno-unused-parameter -Wno-misleading-indentation -Wno-extra
CXXFLAGS := -I . -I dkr_assets_tool_src/ -std=c++17 $(OPT)
LDFLAGS := -lm
PROGRAMS := n64crc dkr_assets_tool
UNAME_S := $(shell uname -s)
# MacOS has a slightly different name for grep, so check to see if it needs to be used.
ifeq ($(UNAME_S),Windows_NT)
$(error Native Windows is currently unsupported for building this repository, use WSL instead c:)
else ifeq ($(UNAME_S),Darwin)
DETECTED_OS := macos
CXXFLAGS += -I/opt/homebrew/include
LDFLAGS += -I/opt/homebrew/lib -lpcre2-8
else ifeq ($(UNAME_S),Linux)
DETECTED_OS := linux
CXXFLAGS += -Werror -Wall $(IGNORE_W_ERRORS) -lpcre2-8
UNAME_M := $(shell uname -m)
# If we detect arm as a platform for linux, but not mac, we'll make this -arm to download that version (Mostly used for raspi)
ifneq ($(filter aarch%,$(UNAME_M)),)
DETECTED_OS := linux-arm
endif
endif
BUILD_DIR := dkr_assets_tool_src/_build
ENUMS_HEADER := ../include/enums.h
# From: https://stackoverflow.com/questions/2483182/recursive-wildcards-in-gnu-make/18258352#18258352
rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d))
RECOMP_DIR := ido-recomp/$(DETECTED_OS)
default: all
n64crc_SOURCES := n64crc.c
all: $(PROGRAMS) recomp flips
# make clean for flips doesn't work, so just manually delete it on a clean.
clean:
$(RM) -Rf $(PROGRAMS) $(BUILD_DIR)
$(RM) -rf $(RECOMP_DIR)
$(RM) -f Flips/flips
distclean: clean
n64crc: n64crc.c
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
dkr_assets_tool_CPP_FILES := $(call rwildcard,dkr_assets_tool_src,*.cpp)
dkr_assets_tool_C_FILES := $(call rwildcard,dkr_assets_tool_src,*.c)
dkr_assets_tool_OBJ_FILES := $(foreach file,$(dkr_assets_tool_C_FILES),$(BUILD_DIR)/$(file:.c=.o)) \
$(foreach file,$(dkr_assets_tool_CPP_FILES),$(BUILD_DIR)/$(file:.cpp=.o))
DUMMY != mkdir -p $(sort $(dir $(dkr_assets_tool_OBJ_FILES)))
$(BUILD_DIR)/%.o: %.c
$(CC) -c $^ -o $@ $(CFLAGS)
$(BUILD_DIR)/%.o: %.cpp
$(CXX) -c $< -o $@ $(CXXFLAGS)
dkr_assets_tool: $(dkr_assets_tool_OBJ_FILES)
$(CXX) $^ -o $@ $(CXXFLAGS) $(LDFLAGS) -lpthread
recomp:
@echo "Fetching Recomp..."
wget https://github.com/decompals/ido-static-recomp/releases/download/v1.2/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
#Builds the CLI only version of flips. It will complain about it being debug, but this makes it much faster compile.
flips:
@make -s -C Flips TARGET=cli
.PHONY: all clean distclean default