summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorTharo <17233964+Thar0@users.noreply.github.com>2024-12-14 01:28:28 +0000
committerGitHub <noreply@github.com>2024-12-13 20:28:28 -0500
commit9170902f8d4375a145b513963646dbf58949fb9a (patch)
tree17ae52ae639847b1ad35ba3d550e187c75905a0f /Makefile
parentdf5d4cb4673bc74d1e2f4d11cf6f5fe8376cd1df (diff)
Move build.c definitions to the makefile, introduce and use libultra version defines in libultra instead of PLATFORM defines (#2353)
* Move build.c definitions to the makefile, introduce and use libultra version defines in libultra instead of PLATFORM defines * MAJOR+MINOR versions -> VERSION+PATCH, stringify build defines in makefile, let the libultra version determine the OPTFLAGS for libultra files * Clang format moment * Remove LIBULTRA_VERSION_ID, tweak OS_VERSION and libultra version definitions * Better fix for formatting problems
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile56
1 files changed, 54 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 7a80f5ad8..1ec16e5bf 100644
--- a/Makefile
+++ b/Makefile
@@ -66,60 +66,109 @@ ifeq ($(VERSION),ntsc-1.0)
REGION ?= JP
PLATFORM := N64
DEBUG_FEATURES ?= 0
+ BUILD_DATE := 98-10-21
+ BUILD_TIME := 04:56:31
+ REVISION := 0
else ifeq ($(VERSION),ntsc-1.1)
REGIONAL_CHECKSUM := 1
REGION ?= JP
PLATFORM := N64
DEBUG_FEATURES ?= 0
+ BUILD_DATE := 98-10-26
+ BUILD_TIME := 10:58:45
+ REVISION := 1
else ifeq ($(VERSION),pal-1.0)
REGION ?= EU
PLATFORM := N64
DEBUG_FEATURES ?= 0
+ BUILD_DATE := 98-11-10
+ BUILD_TIME := 14:34:22
+ REVISION := 0
else ifeq ($(VERSION),ntsc-1.2)
REGIONAL_CHECKSUM := 1
REGION ?= JP
PLATFORM := N64
DEBUG_FEATURES ?= 0
+ BUILD_DATE := 98-11-12
+ BUILD_TIME := 18:17:03
+ REVISION := 2
else ifeq ($(VERSION),pal-1.1)
REGION ?= EU
PLATFORM := N64
DEBUG_FEATURES ?= 0
+ BUILD_DATE := 98-11-18
+ BUILD_TIME := 17:36:49
+ REVISION := 1
else ifeq ($(VERSION),gc-jp)
REGION ?= JP
PLATFORM := GC
DEBUG_FEATURES ?= 0
+ BUILD_DATE := 02-10-29
+ BUILD_TIME := 23:49:53
+ REVISION := 15
else ifeq ($(VERSION),gc-jp-mq)
REGION ?= JP
PLATFORM := GC
DEBUG_FEATURES ?= 0
+ BUILD_DATE := 02-10-30
+ BUILD_TIME := 00:15:15
+ REVISION := 15
else ifeq ($(VERSION),gc-us)
REGION ?= US
PLATFORM := GC
DEBUG_FEATURES ?= 0
+ BUILD_DATE := 02-12-19
+ BUILD_TIME := 13:28:09
+ REVISION := 15
else ifeq ($(VERSION),gc-us-mq)
REGION ?= US
PLATFORM := GC
DEBUG_FEATURES ?= 0
+ BUILD_DATE := 02-12-19
+ BUILD_TIME := 14:05:42
+ REVISION := 15
else ifeq ($(VERSION),gc-eu-mq-dbg)
REGION ?= EU
PLATFORM := GC
DEBUG_FEATURES ?= 1
+ BUILD_DATE := 03-02-21
+ BUILD_TIME := 00:16:31
+ REVISION := 15
else ifeq ($(VERSION),gc-eu)
REGION ?= EU
PLATFORM := GC
DEBUG_FEATURES ?= 0
+ BUILD_DATE := 03-02-21
+ BUILD_TIME := 20:12:23
+ REVISION := 15
else ifeq ($(VERSION),gc-eu-mq)
REGION ?= EU
PLATFORM := GC
DEBUG_FEATURES ?= 0
+ BUILD_DATE := 03-02-21
+ BUILD_TIME := 20:37:19
+ REVISION := 15
else ifeq ($(VERSION),gc-jp-ce)
REGION ?= JP
PLATFORM := GC
DEBUG_FEATURES ?= 0
+ BUILD_DATE := 03-10-08
+ BUILD_TIME := 21:53:00
+ REVISION := 15
else
$(error Unsupported version $(VERSION))
endif
+ifeq ($(PLATFORM),N64)
+ BUILD_CREATOR := zelda@srd44
+ LIBULTRA_VERSION := I
+ LIBULTRA_PATCH := 1
+else
+ BUILD_CREATOR := zelda@srd022j
+ LIBULTRA_VERSION := L
+ LIBULTRA_PATCH := 0
+endif
+
# ORIG_COMPILER cannot be combined with a non-IDO compiler. Check for this case and error out if found.
ifneq ($(COMPILER),ido)
ifeq ($(ORIG_COMPILER),1)
@@ -149,8 +198,11 @@ CPPFLAGS += -P -xc -fno-dollars-in-identifiers
# Converts e.g. ntsc-1.0 to NTSC_1_0
VERSION_MACRO := $(shell echo $(VERSION) | tr a-z-. A-Z__)
-CPP_DEFINES += -DOOT_VERSION=$(VERSION_MACRO)
+CPP_DEFINES += -DOOT_VERSION=$(VERSION_MACRO) -DOOT_REVISION=$(REVISION)
CPP_DEFINES += -DOOT_REGION=REGION_$(REGION)
+CPP_DEFINES += -DBUILD_CREATOR="\"$(BUILD_CREATOR)\"" -DBUILD_DATE="\"$(BUILD_DATE)\"" -DBUILD_TIME="\"$(BUILD_TIME)\""
+CPP_DEFINES += -DLIBULTRA_VERSION=LIBULTRA_VERSION_$(LIBULTRA_VERSION)
+CPP_DEFINES += -DLIBULTRA_PATCH=$(LIBULTRA_PATCH)
ifeq ($(PLATFORM),N64)
CPP_DEFINES += -DPLATFORM_N64=1 -DPLATFORM_GC=0
@@ -494,7 +546,7 @@ $(BUILD_DIR)/src/libultra/libc/ll.o: MIPS_VERSION := -mips3 -32
$(BUILD_DIR)/src/libultra/libc/llcvt.o: OPTFLAGS := -O1
$(BUILD_DIR)/src/libultra/libc/llcvt.o: MIPS_VERSION := -mips3 -32
-ifeq ($(PLATFORM),N64)
+ifeq ($(LIBULTRA_VERSION),I)
$(BUILD_DIR)/src/libultra/gu/%.o: OPTFLAGS := -O3
$(BUILD_DIR)/src/libultra/io/%.o: OPTFLAGS := -O1
$(BUILD_DIR)/src/libultra/libc/%.o: OPTFLAGS := -O3