Update dtk-template & README.md

This commit is contained in:
Luke Street 2024-10-22 22:36:25 -06:00
parent 5240be5905
commit 9d5e8cf129
13 changed files with 726 additions and 388 deletions

View file

@ -16,7 +16,15 @@ import argparse
import sys
from pathlib import Path
from typing import Any, Dict, List
from tools.project import *
from tools.project import (
Object,
ProgressCategory,
ProjectConfig,
calculate_progress,
generate_build,
is_windows,
)
# Game versions
DEFAULT_VERSION = 0
@ -105,6 +113,12 @@ parser.add_argument(
action="store_true",
help="builds equivalent (but non-matching) or modded objects",
)
parser.add_argument(
"--no-progress",
dest="progress",
action="store_false",
help="disable progress calculation",
)
args = parser.parse_args()
config = ProjectConfig()
@ -117,10 +131,10 @@ config.dtk_path = args.dtk
config.objdiff_path = args.objdiff
config.binutils_path = args.binutils
config.compilers_path = args.compilers
config.debug = args.debug
config.generate_map = args.map
config.non_matching = args.non_matching
config.sjiswrap_path = args.sjiswrap
config.progress = args.progress
if not is_windows():
config.wrapper = args.wrapper
# Don't build asm unless we're --non-matching
@ -130,8 +144,8 @@ if not config.non_matching:
# Tool versions
config.binutils_tag = "2.42-1"
config.compilers_tag = "20240706"
config.dtk_tag = "v0.9.6"
config.objdiff_tag = "v2.0.0-beta.6"
config.dtk_tag = "v1.1.4"
config.objdiff_tag = "v2.3.3"
config.sjiswrap_tag = "v1.1.1"
config.wibo_tag = "0.6.11"
@ -149,6 +163,10 @@ config.ldflags = [
"-fp hardware",
"-nodefaults",
]
if args.debug:
config.ldflags.append("-g")
if args.map:
config.ldflags.append("-mapunused")
# Base flags, common to most GC/Wii games.
# Generally leave untouched, with overrides added below.
@ -178,7 +196,7 @@ cflags_base = [
]
# Debug flags
if config.debug:
if args.debug:
cflags_base.extend(["-sym on", "-DDEBUG=1"])
else:
cflags_base.append("-DNDEBUG=1")
@ -324,6 +342,12 @@ Matching = True # Object matches and should be linked
NonMatching = False # Object does not match and should not be linked
Equivalent = config.non_matching # Object should be linked when configured with --non-matching
# Object is only matching for specific versions
def MatchingFor(*versions):
return config.version in versions
config.warn_missing_config = True
config.warn_missing_source = False
config.libs = [