mirror of
https://github.com/zeldaret/oot.git
synced 2025-05-10 19:13:42 +00:00
Add make_options.mk (#2016)
* make-options.mk * fix file name * Make more settings overwritable with .make_options.mk and group them together * PAL -> EU --------- Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
This commit is contained in:
parent
6c4935dc18
commit
6a8c556bdb
2 changed files with 43 additions and 38 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -9,6 +9,7 @@ __pycache__/
|
||||||
.idea/
|
.idea/
|
||||||
|
|
||||||
# Project-specific ignores
|
# Project-specific ignores
|
||||||
|
.make_options.mk
|
||||||
extracted/
|
extracted/
|
||||||
build/
|
build/
|
||||||
expected/
|
expected/
|
||||||
|
|
80
Makefile
80
Makefile
|
@ -5,31 +5,66 @@ SHELL = /bin/bash
|
||||||
.SHELLFLAGS = -o pipefail -c
|
.SHELLFLAGS = -o pipefail -c
|
||||||
|
|
||||||
# Build options can either be changed by modifying the makefile, or by building with 'make SETTING=value'
|
# Build options can either be changed by modifying the makefile, or by building with 'make SETTING=value'
|
||||||
|
# It is also possible to override default settings in a file called .make_options.mk with 'SETTING=value'.
|
||||||
|
|
||||||
|
-include .make_options.mk
|
||||||
|
|
||||||
# If COMPARE is 1, check the output md5sum after building
|
# If COMPARE is 1, check the output md5sum after building
|
||||||
COMPARE := 1
|
COMPARE ?= 1
|
||||||
# If NON_MATCHING is 1, define the NON_MATCHING C flag when building
|
# If NON_MATCHING is 1, define the NON_MATCHING C flag when building
|
||||||
NON_MATCHING := 0
|
NON_MATCHING ?= 0
|
||||||
# If ORIG_COMPILER is 1, compile with QEMU_IRIX and the original compiler
|
# If ORIG_COMPILER is 1, compile with QEMU_IRIX and the original compiler
|
||||||
ORIG_COMPILER := 0
|
ORIG_COMPILER ?= 0
|
||||||
# If COMPILER is "gcc", compile with GCC instead of IDO.
|
# If COMPILER is "gcc", compile with GCC instead of IDO.
|
||||||
COMPILER := ido
|
COMPILER ?= ido
|
||||||
# Target game version. Currently the following versions are supported:
|
# Target game version. Currently the following versions are supported:
|
||||||
# gc-eu GameCube Europe/PAL
|
# gc-eu GameCube Europe/PAL
|
||||||
# gc-eu-mq GameCube Europe/PAL Master Quest
|
# gc-eu-mq GameCube Europe/PAL Master Quest
|
||||||
# gc-eu-mq-dbg GameCube Europe/PAL Master Quest Debug (default)
|
# gc-eu-mq-dbg GameCube Europe/PAL Master Quest Debug (default)
|
||||||
# The following versions are work-in-progress and not yet matching:
|
# The following versions are work-in-progress and not yet matching:
|
||||||
# gc-us GameCube US
|
# gc-us GameCube US
|
||||||
VERSION := gc-eu-mq-dbg
|
VERSION ?= gc-eu-mq-dbg
|
||||||
# Number of threads to extract and compress with
|
# Number of threads to extract and compress with
|
||||||
N_THREADS := $(shell nproc)
|
N_THREADS ?= $(shell nproc)
|
||||||
# Check code syntax with host compiler
|
# Check code syntax with host compiler
|
||||||
RUN_CC_CHECK := 1
|
RUN_CC_CHECK ?= 1
|
||||||
|
# Set prefix to mips binutils binaries (mips-linux-gnu-ld => 'mips-linux-gnu-') - Change at your own risk!
|
||||||
|
# In nearly all cases, not having 'mips-linux-gnu-*' binaries on the PATH is indicative of missing dependencies
|
||||||
|
MIPS_BINUTILS_PREFIX ?= mips-linux-gnu-
|
||||||
|
# Emulator w/ flags
|
||||||
|
N64_EMULATOR ?=
|
||||||
|
# Set to override game region in the ROM header. Options: JP, US, EU
|
||||||
|
# REGION ?= US
|
||||||
|
|
||||||
CFLAGS ?=
|
CFLAGS ?=
|
||||||
CPPFLAGS ?=
|
CPPFLAGS ?=
|
||||||
CPP_DEFINES ?=
|
CPP_DEFINES ?=
|
||||||
|
|
||||||
|
# Version-specific settings
|
||||||
|
ifeq ($(VERSION),gc-us)
|
||||||
|
REGION ?= US
|
||||||
|
PAL := 0
|
||||||
|
MQ := 0
|
||||||
|
DEBUG := 0
|
||||||
|
else ifeq ($(VERSION),gc-eu)
|
||||||
|
REGION ?= EU
|
||||||
|
PAL := 1
|
||||||
|
MQ := 0
|
||||||
|
DEBUG := 0
|
||||||
|
else ifeq ($(VERSION),gc-eu-mq)
|
||||||
|
REGION ?= EU
|
||||||
|
PAL := 1
|
||||||
|
MQ := 1
|
||||||
|
DEBUG := 0
|
||||||
|
else ifeq ($(VERSION),gc-eu-mq-dbg)
|
||||||
|
REGION ?= EU
|
||||||
|
PAL := 1
|
||||||
|
MQ := 1
|
||||||
|
DEBUG := 1
|
||||||
|
else
|
||||||
|
$(error Unsupported version $(VERSION))
|
||||||
|
endif
|
||||||
|
|
||||||
# ORIG_COMPILER cannot be combined with a non-IDO compiler. Check for this case and error out if found.
|
# ORIG_COMPILER cannot be combined with a non-IDO compiler. Check for this case and error out if found.
|
||||||
ifneq ($(COMPILER),ido)
|
ifneq ($(COMPILER),ido)
|
||||||
ifeq ($(ORIG_COMPILER),1)
|
ifeq ($(ORIG_COMPILER),1)
|
||||||
|
@ -42,40 +77,11 @@ ifeq ($(COMPILER),gcc)
|
||||||
NON_MATCHING := 1
|
NON_MATCHING := 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Set prefix to mips binutils binaries (mips-linux-gnu-ld => 'mips-linux-gnu-') - Change at your own risk!
|
|
||||||
# In nearly all cases, not having 'mips-linux-gnu-*' binaries on the PATH is indicative of missing dependencies
|
|
||||||
MIPS_BINUTILS_PREFIX := mips-linux-gnu-
|
|
||||||
|
|
||||||
ifeq ($(NON_MATCHING),1)
|
ifeq ($(NON_MATCHING),1)
|
||||||
CPP_DEFINES += -DNON_MATCHING -DAVOID_UB
|
CPP_DEFINES += -DNON_MATCHING -DAVOID_UB
|
||||||
COMPARE := 0
|
COMPARE := 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Version-specific settings
|
|
||||||
ifeq ($(VERSION),gc-us)
|
|
||||||
REGION := US
|
|
||||||
PAL := 0
|
|
||||||
MQ := 0
|
|
||||||
DEBUG := 0
|
|
||||||
else ifeq ($(VERSION),gc-eu)
|
|
||||||
REGION := EU
|
|
||||||
PAL := 1
|
|
||||||
MQ := 0
|
|
||||||
DEBUG := 0
|
|
||||||
else ifeq ($(VERSION),gc-eu-mq)
|
|
||||||
REGION := EU
|
|
||||||
PAL := 1
|
|
||||||
MQ := 1
|
|
||||||
DEBUG := 0
|
|
||||||
else ifeq ($(VERSION),gc-eu-mq-dbg)
|
|
||||||
REGION := EU
|
|
||||||
PAL := 1
|
|
||||||
MQ := 1
|
|
||||||
DEBUG := 1
|
|
||||||
else
|
|
||||||
$(error Unsupported version $(VERSION))
|
|
||||||
endif
|
|
||||||
|
|
||||||
PROJECT_DIR := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
|
PROJECT_DIR := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||||
BUILD_DIR := build/$(VERSION)
|
BUILD_DIR := build/$(VERSION)
|
||||||
EXPECTED_DIR := expected/$(BUILD_DIR)
|
EXPECTED_DIR := expected/$(BUILD_DIR)
|
||||||
|
@ -157,8 +163,6 @@ OBJCOPY := $(MIPS_BINUTILS_PREFIX)objcopy
|
||||||
OBJDUMP := $(MIPS_BINUTILS_PREFIX)objdump
|
OBJDUMP := $(MIPS_BINUTILS_PREFIX)objdump
|
||||||
NM := $(MIPS_BINUTILS_PREFIX)nm
|
NM := $(MIPS_BINUTILS_PREFIX)nm
|
||||||
|
|
||||||
N64_EMULATOR ?=
|
|
||||||
|
|
||||||
INC := -Iinclude -Iinclude/libc -Isrc -I$(BUILD_DIR) -I. -I$(EXTRACTED_DIR)
|
INC := -Iinclude -Iinclude/libc -Isrc -I$(BUILD_DIR) -I. -I$(EXTRACTED_DIR)
|
||||||
|
|
||||||
# Check code syntax with host compiler
|
# Check code syntax with host compiler
|
||||||
|
|
Loading…
Add table
Reference in a new issue