From acbe8f9889edae4fc96fa080a098c993a8953bac Mon Sep 17 00:00:00 2001 From: Ali Naci Erdem Date: Sun, 20 Oct 2024 12:09:39 +0300 Subject: [PATCH] Review changes --- Makefile | 6 +++++- n64.mk | 11 +++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 0ff54882a..ba97dc351 100755 --- a/Makefile +++ b/Makefile @@ -3,7 +3,6 @@ all: libdragon V = 1 # force verbose (at least until we have converted all sub-Makefiles) SOURCE_DIR = src BUILD_DIR = build -FILE_PREFIX=libdragon include n64.mk INSTALLDIR = $(N64_INST) @@ -12,6 +11,11 @@ INSTALLDIR = $(N64_INST) # When building libdragon, override it to use the source include files instead (./include) N64_INCLUDEDIR = $(CURDIR)/include +# N64_BACKTRACE_FILE_PREFIX is exposed from n64.mk, so we can use it to set the +# prefix for libdragon. It is still possible to override this when running make +# for libdragon specifically via a make override. +N64_BACKTRACE_FILE_PREFIX=libdragon + LIBDRAGON_CFLAGS = -I$(CURDIR)/src # Activate N64 toolchain for libdragon build diff --git a/n64.mk b/n64.mk index baa75f274..43e8bca0b 100644 --- a/n64.mk +++ b/n64.mk @@ -1,6 +1,5 @@ BUILD_DIR ?= . SOURCE_DIR ?= . -FILE_PREFIX ?= DSO_COMPRESS_LEVEL ?= 1 N64_ROM_TITLE = "Made with libdragon" # Override this with the name of your game or project @@ -14,6 +13,14 @@ N64_ROM_CONTROLLER2 = # Sets the type of Controller 2 in the Advanced Homebrew H N64_ROM_CONTROLLER3 = # Sets the type of Controller 3 in the Advanced Homebrew Header. This could influence emulator behaviour such as Ares' N64_ROM_CONTROLLER4 = # Sets the type of Controller 4 in the Advanced Homebrew Header. This could influence emulator behaviour such as Ares' +# Override this to use a different file prefix for the debug symbols. This is +# useful when building multiple projects in the same directory and you can set +# this to the project name to differentiate between similar paths. Example: +# .PHONY: tiny3d +# tiny3d: +# $(MAKE) -C $(T3D_INST) N64_BACKTRACE_FILE_PREFIX=tiny3d +N64_BACKTRACE_FILE_PREFIX= + # Override this to use a toolchain installed separately from libdragon N64_GCCPREFIX ?= $(N64_INST) N64_ROOTDIR = $(N64_INST) @@ -50,7 +57,7 @@ N64_DSOMSYM = $(N64_BINDIR)/n64dso-msym N64_C_AND_CXX_FLAGS = -march=vr4300 -mtune=vr4300 -I$(N64_INCLUDEDIR) -include ktls.h N64_C_AND_CXX_FLAGS += -falign-functions=32 # NOTE: if you change this, also change backtrace() in backtrace.c -N64_C_AND_CXX_FLAGS += -ffunction-sections -fdata-sections -g -ffile-prefix-map="$(CURDIR)"=$(FILE_PREFIX) +N64_C_AND_CXX_FLAGS += -ffunction-sections -fdata-sections -g -ffile-prefix-map="$(CURDIR)"=$(N64_BACKTRACE_FILE_PREFIX) N64_C_AND_CXX_FLAGS += -ffast-math -ftrapping-math -fno-associative-math N64_C_AND_CXX_FLAGS += -DN64 -O2 -Wall -Werror -Wno-error=deprecated-declarations -fdiagnostics-color=always N64_C_AND_CXX_FLAGS += -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=unused-function -Wno-error=unused-parameter -Wno-error=unused-but-set-parameter -Wno-error=unused-label -Wno-error=unused-local-typedefs -Wno-error=unused-const-variable