Updated to support hax 2.5, edited README, supports devkitpro 45, etc

This commit is contained in:
Reisyukaku
2016-01-13 17:38:02 -05:00
parent 653bea3e56
commit a6d8d77ac7
24 changed files with 2329 additions and 299 deletions

View File

@@ -9,6 +9,11 @@ endif
TOPDIR ?= $(CURDIR)
include $(DEVKITARM)/3ds_rules
# This should be set externally
name ?= reiNand.dat
filepath ?=
dir_out ?= $(CURDIR)
#---------------------------------------------------------------------------------
# TARGET is the name of the output
# BUILD is the directory where object files & intermediate files will be placed
@@ -26,26 +31,27 @@ include $(DEVKITARM)/3ds_rules
# - icon.png
# - <libctru folder>/default_icon.png
#---------------------------------------------------------------------------------
TARGET := ReiNand
TARGET := $(name:.dat=)
BUILD := build
SOURCES := source
SOURCES := source source/libkhax
DATA := data
INCLUDES := include
APP_TITLE := ReiNAND
APP_DESCRIPTION := N3DS CFW
APP_AUTHOR := Reisyukaku
APP_TITLE ?= $(name:.dat=)
APP_DESCRIPTION ?= Privileged ARM11/ARM9 Code Execution
APP_AUTHOR ?= patois
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard
CFLAGS := -g -Wall -O3 -mword-relocations \
CFLAGS := -g -Wall -Wextra -O3 -mword-relocations \
-fomit-frame-pointer -ffast-math \
$(ARCH)
CFLAGS += $(INCLUDE) -DARM11 -D_3DS -DARM_ARCH -w
CFLAGS += $(INCLUDE) -DARM11 -D_3DS -DARM_ARCH -DLAUNCHER_PATH='"$(filepath)$(name)"'
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11 -w
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
ASFLAGS := -g $(ARCH)
LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
@@ -66,7 +72,7 @@ LIBDIRS := $(CTRULIB)
ifneq ($(BUILD),$(notdir $(CURDIR)))
#---------------------------------------------------------------------------------
export OUTPUT := $(CURDIR)/$(TARGET)
export OUTPUT := $(dir_out)/$(TARGET)
export TOPDIR := $(CURDIR)
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
@@ -77,6 +83,7 @@ export DEPSDIR := $(CURDIR)/$(BUILD)
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
@@ -92,7 +99,8 @@ else
endif
#---------------------------------------------------------------------------------
export OFILES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
export OFILES := $(addsuffix .o,$(BINFILES)) \
$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
@@ -110,7 +118,7 @@ ifeq ($(strip $(ICON)),)
endif
endif
else
export APP_ICON := $(TOPDIR)/$(ICON)
export APP_ICON := $(ICON)
endif
.PHONY: $(BUILD) clean all
@@ -126,7 +134,8 @@ $(BUILD):
#---------------------------------------------------------------------------------
clean:
@echo clean ...
@rm -fr $(BUILD) $(TARGET).3dsx $(OUTPUT).smdh $(TARGET).elf
@rm -fr $(BUILD) $(OUTPUT).3dsx $(OUTPUT).smdh
#---------------------------------------------------------------------------------
else
@@ -141,8 +150,7 @@ ifeq ($(strip $(NO_SMDH)),)
all : $(OUTPUT).3dsx $(OUTPUT).smdh
endif
cpu.o cpu_threaded.o: CFLAGS += -Wno-unused-variable -Wno-unused-label
$(OUTPUT).3dsx : $(OUTPUT).elf
$(OUTPUT).elf : $(OFILES)
$(OUTPUT).3dsx : $(OFILES)
#---------------------------------------------------------------------------------
# you need a rule like this for each extension you use as binary data