Add build options to Makefile

For stuff like testing PASLR, *hax2x, khc3ds, etc.

Also fix a corner-case bug when changing the 3dsx app from itself to
itself, if its TID corresponds to the default.
This commit is contained in:
TuxSH 2023-01-07 01:58:11 +00:00
parent da0b1a1389
commit 5cdbfab54b
17 changed files with 166 additions and 51 deletions

View File

@ -2,6 +2,19 @@ ifneq ($(strip $(shell firmtool -v 2>&1 | grep usage)),)
$(error "Please install firmtool v1.1 or greater") $(error "Please install firmtool v1.1 or greater")
endif endif
# Disable kext and firmlaunch patches, all custom sysmodules except Loader, enable PASLR.
# Dangerous. Don't enable this unless you know what you're doing!
export BUILD_FOR_EXPLOIT_DEV ?= 0
# Build with O0 & frame pointer information for use with GDB
export BUILD_FOR_GDB ?= 0
# Default 3DSX TitleID for hb:ldr
export HBLDR_DEFAULT_3DSX_TID ?= 000400000D921E00
# What to call the title corresponding to HBLDR_DEFAULT_3DSX_TID
export HBLDR_DEFAULT_3DSX_TITLE_NAME ?= "hblauncher_loader"
NAME := $(notdir $(CURDIR)) NAME := $(notdir $(CURDIR))
REVISION := $(shell git describe --tags --match v[0-9]* --abbrev=8 | sed 's/-[0-9]*-g/-/') REVISION := $(shell git describe --tags --match v[0-9]* --abbrev=8 | sed 's/-[0-9]*-g/-/')

View File

@ -26,7 +26,7 @@ INCLUDES := include include/svc
# options for code generation # options for code generation
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft
DEFINES := -DARM11 -D_3DS DEFINES := -DARM11 -D__3DS__
CFLAGS := -g -std=gnu11 -Wall -Wextra -Werror -O2 -mword-relocations \ CFLAGS := -g -std=gnu11 -Wall -Wextra -Werror -O2 -mword-relocations \
-fomit-frame-pointer -ffunction-sections -fdata-sections \ -fomit-frame-pointer -ffunction-sections -fdata-sections \

View File

@ -35,6 +35,9 @@ ifeq ($(strip $(shell git describe --tags --match v[0-9]* | grep -)),)
export IS_RELEASE := 1 export IS_RELEASE := 1
endif endif
# Default 3DSX TitleID for hb:ldr (note: also defined in top-level Makefile)
export HBLDR_DEFAULT_3DSX_TID ?= 000400000D921E00
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
# TARGET is the name of the output # TARGET is the name of the output
# BUILD is the directory where object files & intermediate files will be placed # BUILD is the directory where object files & intermediate files will be placed
@ -53,7 +56,12 @@ INCLUDES := include
# options for code generation # options for code generation
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
ARCH := -marm -march=armv5te -mtune=arm946e-s ARCH := -marm -march=armv5te -mtune=arm946e-s
DEFINES := -DARM9 -D_3DS
ifeq ($(BUILD_FOR_EXPLOIT_DEV),1)
DEFINES := -DARM9 -D__3DS__ -DHBLDR_DEFAULT_3DSX_TID="0x$(HBLDR_DEFAULT_3DSX_TID)ULL" -DBUILD_FOR_EXPLOIT_DEV=1
else
DEFINES := -DARM9 -D__3DS__ -DHBLDR_DEFAULT_3DSX_TID="0x$(HBLDR_DEFAULT_3DSX_TID)ULL"
endif
FALSEPOSITIVES := -Wno-array-bounds -Wno-stringop-overflow -Wno-stringop-overread FALSEPOSITIVES := -Wno-array-bounds -Wno-stringop-overflow -Wno-stringop-overread
CFLAGS := -g -std=gnu11 -Wall -Wextra -Werror -O2 -mword-relocations \ CFLAGS := -g -std=gnu11 -Wall -Wextra -Werror -O2 -mword-relocations \

View File

@ -28,7 +28,6 @@
#include "types.h" #include "types.h"
#define HBLDR_DEFAULT_3DSX_TID 0x000400000D921E00ull
#define AUTOBOOT_DEFAULT_TWL_TID 0x0003000448424C41ull #define AUTOBOOT_DEFAULT_TWL_TID 0x0003000448424C41ull
#define CONFIG(a) (((configData.config >> (a)) & 1) != 0) #define CONFIG(a) (((configData.config >> (a)) & 1) != 0)

View File

@ -352,8 +352,7 @@ static inline void mergeSection0(FirmwareType firmType, u32 firmVersion, bool lo
u32 patchNativeFirm(u32 firmVersion, FirmwareSource nandType, bool loadFromStorage, bool isFirmProtEnabled, bool needToInitSd, bool doUnitinfoPatch) u32 patchNativeFirm(u32 firmVersion, FirmwareSource nandType, bool loadFromStorage, bool isFirmProtEnabled, bool needToInitSd, bool doUnitinfoPatch)
{ {
u8 *arm9Section = (u8 *)firm + firm->section[2].offset, u8 *arm9Section = (u8 *)firm + firm->section[2].offset;
*arm11Section1 = (u8 *)firm + firm->section[1].offset;
if(ISN3DS) if(ISN3DS)
{ {
@ -367,22 +366,27 @@ u32 patchNativeFirm(u32 firmVersion, FirmwareSource nandType, bool loadFromStora
process9MemAddr; process9MemAddr;
u8 *process9Offset = getProcess9Info(arm9Section, firm->section[2].size, &process9Size, &process9MemAddr); u8 *process9Offset = getProcess9Info(arm9Section, firm->section[2].size, &process9Size, &process9MemAddr);
//Find the Kernel11 SVC table and handler, exceptions page and free space locations
u32 baseK11VA;
u8 *freeK11Space;
u32 *arm11SvcHandler,
*arm11ExceptionsPage,
*arm11SvcTable = getKernel11Info(arm11Section1, firm->section[1].size, &baseK11VA, &freeK11Space, &arm11SvcHandler, &arm11ExceptionsPage);
u32 kernel9Size = (u32)(process9Offset - arm9Section) - sizeof(Cxi) - 0x200, u32 kernel9Size = (u32)(process9Offset - arm9Section) - sizeof(Cxi) - 0x200,
ret = 0; ret = 0;
#ifndef BUILD_FOR_EXPLOIT_DEV
//Skip on FIRMs < 4.0 //Skip on FIRMs < 4.0
if(ISN3DS || firmVersion >= 0x1D) if(ISN3DS || firmVersion >= 0x1D)
{ {
//Find the Kernel11 SVC table and handler, exceptions page and free space locations
u8 *arm11Section1 = (u8 *)firm + firm->section[1].offset;
u32 baseK11VA;
u8 *freeK11Space;
u32 *arm11SvcHandler,
*arm11ExceptionsPage,
*arm11SvcTable = getKernel11Info(arm11Section1, firm->section[1].size, &baseK11VA, &freeK11Space, &arm11SvcHandler, &arm11ExceptionsPage);
ret += installK11Extension(arm11Section1, firm->section[1].size, needToInitSd, baseK11VA, arm11ExceptionsPage, &freeK11Space); ret += installK11Extension(arm11Section1, firm->section[1].size, needToInitSd, baseK11VA, arm11ExceptionsPage, &freeK11Space);
ret += patchKernel11(arm11Section1, firm->section[1].size, baseK11VA, arm11SvcTable, arm11ExceptionsPage); ret += patchKernel11(arm11Section1, firm->section[1].size, baseK11VA, arm11SvcTable, arm11ExceptionsPage);
} }
#else
(void)needToInitSd;
#endif
//Apply signature patches //Apply signature patches
ret += patchSignatureChecks(process9Offset, process9Size); ret += patchSignatureChecks(process9Offset, process9Size);
@ -393,8 +397,10 @@ u32 patchNativeFirm(u32 firmVersion, FirmwareSource nandType, bool loadFromStora
//Apply FIRM0/1 writes patches on SysNAND to protect A9LH //Apply FIRM0/1 writes patches on SysNAND to protect A9LH
else if(isFirmProtEnabled) ret += patchFirmWrites(process9Offset, process9Size); else if(isFirmProtEnabled) ret += patchFirmWrites(process9Offset, process9Size);
#ifndef BUILD_FOR_EXPLOIT_DEV
//Apply firmlaunch patches //Apply firmlaunch patches
ret += patchFirmlaunches(process9Offset, process9Size, process9MemAddr); ret += patchFirmlaunches(process9Offset, process9Size, process9MemAddr);
#endif
//Apply dev unit check patches related to NCCH encryption //Apply dev unit check patches related to NCCH encryption
if(!ISDEVUNIT) if(!ISDEVUNIT)

View File

@ -27,7 +27,7 @@ INCLUDES := include include/svc
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
# -mgeneral-regs-only so that the C code is guaranteed not to use FPU regs # -mgeneral-regs-only so that the C code is guaranteed not to use FPU regs
ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -mgeneral-regs-only ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -mgeneral-regs-only
DEFINES := -DARM11 -D_3DS DEFINES := -DARM11 -D__3DS__
FALSEPOSITIVES := -Wno-array-bounds -Wno-stringop-overflow -Wno-stringop-overread FALSEPOSITIVES := -Wno-array-bounds -Wno-stringop-overflow -Wno-stringop-overread
CFLAGS := -g -std=gnu11 -Wall -Wextra -Werror -O2 -mword-relocations \ CFLAGS := -g -std=gnu11 -Wall -Wextra -Werror -O2 -mword-relocations \

View File

@ -1,9 +1,15 @@
SUBFOLDERS := loader sm pm pxi rosalina ifeq ($(BUILD_FOR_EXPLOIT_DEV),1)
CXIS := $(foreach dir, $(SUBFOLDERS), $(dir)/$(dir).cxi) # Keep Loader so that we can execute 3DSX
SUBFOLDERS := loader
else
SUBFOLDERS := loader sm pm pxi rosalina
endif
.PHONY: all clean $(SUBFOLDERS) CXIS := $(foreach dir, $(SUBFOLDERS), $(dir)/$(dir).cxi)
all: sysmodules.bin .PHONY: all clean $(SUBFOLDERS)
all: sysmodules.bin
clean: clean:
@$(foreach dir, $(SUBFOLDERS), $(MAKE) -C $(dir) clean &&) true @$(foreach dir, $(SUBFOLDERS), $(MAKE) -C $(dir) clean &&) true

View File

@ -9,6 +9,9 @@ endif
TOPDIR ?= $(CURDIR) TOPDIR ?= $(CURDIR)
include $(DEVKITARM)/3ds_rules include $(DEVKITARM)/3ds_rules
# Default 3DSX TitleID for hb:ldr (note: also defined in top-level Makefile)
export HBLDR_DEFAULT_3DSX_TID ?= 000400000D921E00
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
# TARGET is the name of the output # TARGET is the name of the output
# BUILD is the directory where object files & intermediate files will be placed # BUILD is the directory where object files & intermediate files will be placed
@ -26,13 +29,35 @@ INCLUDES := include
# options for code generation # options for code generation
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft
DEFINES := -D__3DS__
COMMON_FLAGS = -g -Wall -Wextra -Werror -O2 -mword-relocations \ ifeq ($(BUILD_FOR_EXPLOIT_DEV),1)
-fomit-frame-pointer -ffunction-sections -fdata-sections \ DEFINES := -D__3DS__ -DHBLDR_DEFAULT_3DSX_TID="0x$(HBLDR_DEFAULT_3DSX_TID)ULL" -DBUILD_FOR_EXPLOIT_DEV=1
$(ARCH) $(DEFINES) $(INCLUDE) else
DEFINES := -D__3DS__ -DHBLDR_DEFAULT_3DSX_TID="0x$(HBLDR_DEFAULT_3DSX_TID)ULL"
endif
CFLAGS := -std=gnu11 $(COMMON_FLAGS) ifeq ($(BUILD_FOR_GDB),1)
OPTFLAGS := -O0
LIBS := -lctrud
else
OPTFLAGS := -O2 -fomit-frame-pointer
LIBS := -lctru
endif
COMMON_FLAGS =\
-g \
-Wall \
-Wextra \
-Werror \
-mword-relocations \
-ffunction-sections \
-fdata-sections \
$(OPTFLAGS) \
$(ARCH) \
$(DEFINES) \
$(INCLUDE)
CFLAGS := -std=gnu11 $(COMMON_FLAGS)
CXXFLAGS := -fno-rtti -fno-exceptions -std=gnu++17 $(COMMON_FLAGS) CXXFLAGS := -fno-rtti -fno-exceptions -std=gnu++17 $(COMMON_FLAGS)

View File

@ -5,7 +5,6 @@
#include "ifile.h" #include "ifile.h"
#include "util.h" #include "util.h"
#include "hbldr.h" #include "hbldr.h"
#include "luma_shared_config.h"
extern u32 config, multiConfig, bootConfig; extern u32 config, multiConfig, bootConfig;
extern bool isN3DS, isSdMode; extern bool isN3DS, isSdMode;

View File

@ -18,9 +18,6 @@
#include <3ds/types.h> #include <3ds/types.h>
/// Default TitleID for 3DSX loading
#define HBLDR_DEFAULT_3DSX_TID 0x000400000D921E00ULL
/// Luma shared config type. /// Luma shared config type.
typedef struct LumaSharedConfig { typedef struct LumaSharedConfig {
u64 hbldr_3dsx_tid; ///< Title ID to use for 3DSX loading. u64 hbldr_3dsx_tid; ///< Title ID to use for 3DSX loading.

View File

@ -47,7 +47,7 @@ static bool needsPaslr(u32 *outRegion, const ExHeader_Info *exhi)
*outRegion = region; *outRegion = region;
#ifdef LOADER_ENABLE_PASLR #if defined(LOADER_ENABLE_PASLR) || defined(BUILD_FOR_EXPLOIT_DEV)
// Only applications and system applets (HM, Internet Browser...) are eligible for PASLR // Only applications and system applets (HM, Internet Browser...) are eligible for PASLR
if (region != MEMOP_REGION_APP && region != MEMOP_REGION_SYSTEM) if (region != MEMOP_REGION_APP && region != MEMOP_REGION_SYSTEM)
return false; return false;

View File

@ -28,19 +28,33 @@ INCLUDES := include
ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft
DEFINES := -D__3DS__ DEFINES := -D__3DS__
CFLAGS := -g -std=gnu11 -Wall -Wextra -Werror -Os -mword-relocations \ ifeq ($(BUILD_FOR_GDB),1)
-fomit-frame-pointer -ffunction-sections -fdata-sections \ OPTFLAGS := -O0
$(ARCH) $(DEFINES) LIBS := -lctrud
else
OPTFLAGS := -O2 -fomit-frame-pointer
LIBS := -lctru
endif
CFLAGS += $(INCLUDE) CFLAGS :=\
-g \
-std=gnu11 \
-Wall \
-Wextra \
-Werror \
-mword-relocations \
-ffunction-sections \
-fdata-sections \
$(OPTFLAGS) \
$(ARCH) \
$(DEFINES) \
$(INCLUDE)
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11 CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
ASFLAGS := -g $(ARCH) ASFLAGS := -g $(ARCH)
LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map),-wrap,exit LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map),-wrap,exit
LIBS := -lctru
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing # list of directories containing libraries, this must be the top level containing
# include and lib # include and lib

View File

@ -28,9 +28,27 @@ INCLUDES := include
ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft
DEFINES := -D__3DS__ DEFINES := -D__3DS__
CFLAGS := -g -std=gnu11 -Wall -Wextra -Werror -O2 -mword-relocations \ ifeq ($(BUILD_FOR_GDB),1)
-fomit-frame-pointer -ffunction-sections -fdata-sections \ OPTFLAGS := -O0
$(ARCH) $(DEFINES) LIBS := -lctrud
else
OPTFLAGS := -O2 -fomit-frame-pointer
LIBS := -lctru
endif
CFLAGS :=\
-g \
-std=gnu11 \
-Wall \
-Wextra \
-Werror \
-mword-relocations \
-ffunction-sections \
-fdata-sections \
$(OPTFLAGS) \
$(ARCH) \
$(DEFINES) \
$(INCLUDE)
CFLAGS += $(INCLUDE) CFLAGS += $(INCLUDE)
@ -39,8 +57,6 @@ CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
ASFLAGS := -g $(ARCH) ASFLAGS := -g $(ARCH)
LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map),-wrap,exit LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map),-wrap,exit
LIBS := -lctru
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing # list of directories containing libraries, this must be the top level containing
# include and lib # include and lib

View File

@ -9,6 +9,12 @@ endif
TOPDIR ?= $(CURDIR) TOPDIR ?= $(CURDIR)
include $(DEVKITARM)/3ds_rules include $(DEVKITARM)/3ds_rules
# Default 3DSX TitleID for hb:ldr (note: also defined in top-level Makefile)
export HBLDR_DEFAULT_3DSX_TID ?= 000400000D921E00
# What to call the title corresponding to HBLDR_DEFAULT_3DSX_TID (note: also defined in top-level Makefile)
export HBLDR_DEFAULT_3DSX_TITLE_NAME ?= "hblauncher_loader"
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
# TARGET is the name of the output # TARGET is the name of the output
# BUILD is the directory where object files & intermediate files will be placed # BUILD is the directory where object files & intermediate files will be placed
@ -26,7 +32,7 @@ INCLUDES := include include/gdb include/menus include/redshift
# options for code generation # options for code generation
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft
DEFINES := -D__3DS__ DEFINES := -D__3DS__ -DHBLDR_DEFAULT_3DSX_TID="0x$(HBLDR_DEFAULT_3DSX_TID)ULL" -DHBLDR_DEFAULT_3DSX_TITLE_NAME="\"$(HBLDR_DEFAULT_3DSX_TITLE_NAME)\""
FALSEPOSITIVES := -Wno-array-bounds -Wno-stringop-overflow -Wno-stringop-overread FALSEPOSITIVES := -Wno-array-bounds -Wno-stringop-overflow -Wno-stringop-overread
CFLAGS := -g -std=gnu11 -Wall -Wextra -Werror -Wno-unused-value -Os -mword-relocations \ CFLAGS := -g -std=gnu11 -Wall -Wextra -Werror -Wno-unused-value -Os -mword-relocations \

View File

@ -18,9 +18,6 @@
#include <3ds/types.h> #include <3ds/types.h>
/// Default TitleID for 3DSX loading
#define HBLDR_DEFAULT_3DSX_TID 0x000400000D921E00ULL
/// Luma shared config type. /// Luma shared config type.
typedef struct LumaSharedConfig { typedef struct LumaSharedConfig {
u64 hbldr_3dsx_tid; ///< Title ID to use for 3DSX loading. u64 hbldr_3dsx_tid; ///< Title ID to use for 3DSX loading.

View File

@ -120,12 +120,20 @@ Menu miscellaneousMenu = {
}; };
int lastNtpTzOffset = 0; int lastNtpTzOffset = 0;
static inline bool compareTids(u64 tidA, u64 tidB)
{
// Just like p9 clears them, ignore platform/N3DS bits
return ((tidA ^ tidB) & ~0xF0000000ull) == 0;
}
void MiscellaneousMenu_SwitchBoot3dsxTargetTitle(void) void MiscellaneousMenu_SwitchBoot3dsxTargetTitle(void)
{ {
Result res; Result res;
char failureReason[64]; char failureReason[64];
u64 currentTid = Luma_SharedConfig->hbldr_3dsx_tid;
u64 newTid = currentTid;
if(Luma_SharedConfig->hbldr_3dsx_tid == HBLDR_DEFAULT_3DSX_TID) if(compareTids(currentTid, HBLDR_DEFAULT_3DSX_TID))
{ {
FS_ProgramInfo progInfo; FS_ProgramInfo progInfo;
u32 pid; u32 pid;
@ -133,8 +141,8 @@ void MiscellaneousMenu_SwitchBoot3dsxTargetTitle(void)
res = PMDBG_GetCurrentAppInfo(&progInfo, &pid, &launchFlags); res = PMDBG_GetCurrentAppInfo(&progInfo, &pid, &launchFlags);
if(R_SUCCEEDED(res)) if(R_SUCCEEDED(res))
{ {
newTid = progInfo.programId;
Luma_SharedConfig->hbldr_3dsx_tid = progInfo.programId; Luma_SharedConfig->hbldr_3dsx_tid = progInfo.programId;
miscellaneousMenu.items[0].title = "Switch the hb. title to hblauncher_loader";
} }
else else
{ {
@ -145,10 +153,15 @@ void MiscellaneousMenu_SwitchBoot3dsxTargetTitle(void)
else else
{ {
res = 0; res = 0;
Luma_SharedConfig->hbldr_3dsx_tid = HBLDR_DEFAULT_3DSX_TID; newTid = HBLDR_DEFAULT_3DSX_TID;
miscellaneousMenu.items[0].title = "Switch the hb. title to the current app.";
} }
Luma_SharedConfig->hbldr_3dsx_tid = newTid;
if (compareTids(newTid, HBLDR_DEFAULT_3DSX_TID))
miscellaneousMenu.items[0].title = "Switch the hb. title to the current app.";
else
miscellaneousMenu.items[0].title = "Switch the hb. title to " HBLDR_DEFAULT_3DSX_TITLE_NAME;
Draw_Lock(); Draw_Lock();
Draw_ClearFramebuffer(); Draw_ClearFramebuffer();
Draw_FlushFramebuffer(); Draw_FlushFramebuffer();

View File

@ -28,9 +28,27 @@ INCLUDES := include
ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft
DEFINES := -D__3DS__ DEFINES := -D__3DS__
CFLAGS := -g -std=gnu11 -Wall -Wextra -Werror -Os -mword-relocations \ ifeq ($(BUILD_FOR_GDB),1)
-fomit-frame-pointer -ffunction-sections -fdata-sections \ OPTFLAGS := -O0
$(ARCH) $(DEFINES) LIBS := -lctrud
else
OPTFLAGS := -O2 -fomit-frame-pointer
LIBS := -lctru
endif
CFLAGS :=\
-g \
-std=gnu11 \
-Wall \
-Wextra \
-Werror \
-mword-relocations \
-ffunction-sections \
-fdata-sections \
$(OPTFLAGS) \
$(ARCH) \
$(DEFINES) \
$(INCLUDE)
CFLAGS += $(INCLUDE) CFLAGS += $(INCLUDE)
@ -39,8 +57,6 @@ CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
ASFLAGS := -g $(ARCH) ASFLAGS := -g $(ARCH)
LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map),-wrap,exit LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map),-wrap,exit
LIBS := -lctru
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing # list of directories containing libraries, this must be the top level containing
# include and lib # include and lib