Skip to content

Commit

Permalink
Review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
anacierdem authored and rasky committed Oct 20, 2024
1 parent 0454a6f commit acbe8f9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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
Expand Down
11 changes: 9 additions & 2 deletions n64.mk
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit acbe8f9

Please sign in to comment.