2015-08-05 03:57:37 +02:00
|
|
|
rwildcard = $(foreach d, $(wildcard $1*), $(filter $(subst *, %, $2), $d) $(call rwildcard, $d/, $2))
|
|
|
|
|
2016-04-08 19:52:37 +02:00
|
|
|
ifeq ($(strip $(DEVKITARM)),)
|
|
|
|
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
|
|
|
endif
|
|
|
|
|
|
|
|
include $(DEVKITARM)/3ds_rules
|
|
|
|
|
2015-08-05 03:57:37 +02:00
|
|
|
CC := arm-none-eabi-gcc
|
|
|
|
AS := arm-none-eabi-as
|
|
|
|
LD := arm-none-eabi-ld
|
|
|
|
OC := arm-none-eabi-objcopy
|
|
|
|
|
2016-03-20 01:00:45 +01:00
|
|
|
name := AuReiNand
|
2016-03-27 18:39:16 +02:00
|
|
|
version := $(shell git describe --abbrev=0 --tags)
|
2016-01-16 13:57:56 +01:00
|
|
|
|
2015-08-05 03:57:37 +02:00
|
|
|
dir_source := source
|
2016-03-23 20:23:27 +01:00
|
|
|
dir_patches := patches
|
|
|
|
dir_loader := loader
|
2016-04-01 14:27:31 +02:00
|
|
|
dir_screeninit := screeninit
|
2016-03-29 17:43:53 +02:00
|
|
|
dir_injector := injector
|
2016-01-16 13:57:56 +01:00
|
|
|
dir_mset := CakeHax
|
|
|
|
dir_ninjhax := CakeBrah
|
2016-03-23 20:23:27 +01:00
|
|
|
dir_build := build
|
|
|
|
dir_out := out
|
2015-08-05 03:57:37 +02:00
|
|
|
|
|
|
|
ASFLAGS := -mlittle-endian -mcpu=arm946e-s -march=armv5te
|
2016-04-11 15:53:59 +02:00
|
|
|
CFLAGS := -Wall -Wextra -MMD -MP -marm $(ASFLAGS) -fno-builtin -fshort-wchar -std=c11 -Wno-main -O2 -flto -ffast-math
|
Added region/language emulation feature, thanks to the hard work of @TuxSH
Create a "locales" folder inside aurei, and one .txt for each game, with the title id of the game. The txt must be exactly 6 bytes long: 3 characters for the region ("JPN", "USA", "EUR", "AUS", "CHN", "KOR", "TWN"), a space, and two for the language ("JP", "EN", "FR", "DE", "IT", "ES", "ZH", "KO", "NL", "PT", "RU", "TW"). You can enable the feature globally in the config menu. This should also make DLCs for foreign games work.
2016-04-14 00:46:36 +02:00
|
|
|
LDFLAGS := -nostartfiles
|
2016-03-20 01:00:45 +01:00
|
|
|
FLAGS := name=$(name).dat dir_out=$(abspath $(dir_out)) ICON=$(abspath icon.png) APP_DESCRIPTION="Noob-friendly 3DS CFW." APP_AUTHOR="Reisyukaku/Aurora Wright" --no-print-directory
|
2015-08-05 03:57:37 +02:00
|
|
|
|
Added region/language emulation feature, thanks to the hard work of @TuxSH
Create a "locales" folder inside aurei, and one .txt for each game, with the title id of the game. The txt must be exactly 6 bytes long: 3 characters for the region ("JPN", "USA", "EUR", "AUS", "CHN", "KOR", "TWN"), a space, and two for the language ("JP", "EN", "FR", "DE", "IT", "ES", "ZH", "KO", "NL", "PT", "RU", "TW"). You can enable the feature globally in the config menu. This should also make DLCs for foreign games work.
2016-04-14 00:46:36 +02:00
|
|
|
objects = $(patsubst $(dir_source)/%.s, $(dir_build)/%.o, \
|
|
|
|
$(patsubst $(dir_source)/%.c, $(dir_build)/%.o, \
|
|
|
|
$(call rwildcard, $(dir_source), *.s *.c)))
|
2015-08-05 03:57:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
.PHONY: all
|
2016-03-23 15:01:28 +01:00
|
|
|
all: launcher a9lh ninjhax
|
2015-08-05 03:57:37 +02:00
|
|
|
|
|
|
|
.PHONY: launcher
|
2016-03-24 00:11:02 +01:00
|
|
|
launcher: $(dir_out)/$(name).dat
|
2015-08-05 12:31:17 +02:00
|
|
|
|
2016-02-19 01:29:53 +01:00
|
|
|
.PHONY: a9lh
|
|
|
|
a9lh: $(dir_out)/arm9loaderhax.bin
|
|
|
|
|
2015-08-05 12:31:17 +02:00
|
|
|
.PHONY: ninjhax
|
2016-01-16 13:57:56 +01:00
|
|
|
ninjhax: $(dir_out)/3ds/$(name)
|
2015-08-05 03:57:37 +02:00
|
|
|
|
2016-03-24 00:11:02 +01:00
|
|
|
.PHONY: release
|
|
|
|
release: $(dir_out)/$(name).zip
|
|
|
|
|
2016-04-11 05:15:44 +02:00
|
|
|
.PHONY: pathchanger
|
|
|
|
pathchanger: $(dir_out)/pathchanger
|
|
|
|
|
2015-08-05 03:57:37 +02:00
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
@$(MAKE) $(FLAGS) -C $(dir_mset) clean
|
2015-08-05 12:31:17 +02:00
|
|
|
@$(MAKE) $(FLAGS) -C $(dir_ninjhax) clean
|
2016-03-20 01:00:45 +01:00
|
|
|
@$(MAKE) -C $(dir_loader) clean
|
2016-04-01 14:27:31 +02:00
|
|
|
@$(MAKE) -C $(dir_screeninit) clean
|
2016-03-29 17:43:53 +02:00
|
|
|
@$(MAKE) -C $(dir_injector) clean
|
Added region/language emulation feature, thanks to the hard work of @TuxSH
Create a "locales" folder inside aurei, and one .txt for each game, with the title id of the game. The txt must be exactly 6 bytes long: 3 characters for the region ("JPN", "USA", "EUR", "AUS", "CHN", "KOR", "TWN"), a space, and two for the language ("JP", "EN", "FR", "DE", "IT", "ES", "ZH", "KO", "NL", "PT", "RU", "TW"). You can enable the feature globally in the config menu. This should also make DLCs for foreign games work.
2016-04-14 00:46:36 +02:00
|
|
|
@rm -rf $(dir_out) $(dir_build)
|
2015-08-05 03:57:37 +02:00
|
|
|
|
2016-03-23 20:23:27 +01:00
|
|
|
$(dir_out):
|
|
|
|
@mkdir -p "$(dir_out)/aurei/payloads"
|
|
|
|
|
2016-04-11 05:15:44 +02:00
|
|
|
$(dir_out)/pathchanger: $(dir_out)
|
|
|
|
@cc pathchanger/pathchanger.c -o out/pathchanger
|
|
|
|
|
2016-03-23 14:59:52 +01:00
|
|
|
$(dir_out)/$(name).dat: $(dir_build)/main.bin $(dir_out)
|
2015-08-05 03:57:37 +02:00
|
|
|
@$(MAKE) $(FLAGS) -C $(dir_mset) launcher
|
2016-03-23 20:23:27 +01:00
|
|
|
@dd if=$(dir_build)/main.bin of=$@ bs=512 seek=144
|
2016-02-19 01:29:53 +01:00
|
|
|
|
2016-03-23 14:59:52 +01:00
|
|
|
$(dir_out)/arm9loaderhax.bin: $(dir_build)/main.bin $(dir_out)
|
2016-04-05 02:20:05 +02:00
|
|
|
@cp -a $(dir_build)/main.bin $@
|
2016-02-19 01:29:53 +01:00
|
|
|
|
2016-03-23 14:59:52 +01:00
|
|
|
$(dir_out)/3ds/$(name): $(dir_out)
|
Added region/language emulation feature, thanks to the hard work of @TuxSH
Create a "locales" folder inside aurei, and one .txt for each game, with the title id of the game. The txt must be exactly 6 bytes long: 3 characters for the region ("JPN", "USA", "EUR", "AUS", "CHN", "KOR", "TWN"), a space, and two for the language ("JP", "EN", "FR", "DE", "IT", "ES", "ZH", "KO", "NL", "PT", "RU", "TW"). You can enable the feature globally in the config menu. This should also make DLCs for foreign games work.
2016-04-14 00:46:36 +02:00
|
|
|
@mkdir -p "$@"
|
2016-01-16 13:57:56 +01:00
|
|
|
@$(MAKE) $(FLAGS) -C $(dir_ninjhax)
|
Added region/language emulation feature, thanks to the hard work of @TuxSH
Create a "locales" folder inside aurei, and one .txt for each game, with the title id of the game. The txt must be exactly 6 bytes long: 3 characters for the region ("JPN", "USA", "EUR", "AUS", "CHN", "KOR", "TWN"), a space, and two for the language ("JP", "EN", "FR", "DE", "IT", "ES", "ZH", "KO", "NL", "PT", "RU", "TW"). You can enable the feature globally in the config menu. This should also make DLCs for foreign games work.
2016-04-14 00:46:36 +02:00
|
|
|
@mv $(dir_out)/$(name).3dsx $(dir_out)/$(name).smdh $@
|
2016-02-08 03:37:03 +01:00
|
|
|
|
2016-03-24 00:11:02 +01:00
|
|
|
$(dir_out)/$(name).zip: launcher a9lh ninjhax
|
Added region/language emulation feature, thanks to the hard work of @TuxSH
Create a "locales" folder inside aurei, and one .txt for each game, with the title id of the game. The txt must be exactly 6 bytes long: 3 characters for the region ("JPN", "USA", "EUR", "AUS", "CHN", "KOR", "TWN"), a space, and two for the language ("JP", "EN", "FR", "DE", "IT", "ES", "ZH", "KO", "NL", "PT", "RU", "TW"). You can enable the feature globally in the config menu. This should also make DLCs for foreign games work.
2016-04-14 00:46:36 +02:00
|
|
|
@cd "$(@D)" && zip -9 -r $(name) *
|
2016-03-24 00:11:02 +01:00
|
|
|
|
2016-03-29 17:43:53 +02:00
|
|
|
$(dir_build)/patches.h: $(dir_patches)/emunand.s $(dir_patches)/reboot.s $(dir_injector)/Makefile
|
Added region/language emulation feature, thanks to the hard work of @TuxSH
Create a "locales" folder inside aurei, and one .txt for each game, with the title id of the game. The txt must be exactly 6 bytes long: 3 characters for the region ("JPN", "USA", "EUR", "AUS", "CHN", "KOR", "TWN"), a space, and two for the language ("JP", "EN", "FR", "DE", "IT", "ES", "ZH", "KO", "NL", "PT", "RU", "TW"). You can enable the feature globally in the config menu. This should also make DLCs for foreign games work.
2016-04-14 00:46:36 +02:00
|
|
|
@mkdir -p "$(@D)"
|
2016-02-08 03:37:03 +01:00
|
|
|
@armips $<
|
2016-03-23 14:59:52 +01:00
|
|
|
@armips $(word 2,$^)
|
2016-03-29 17:43:53 +02:00
|
|
|
@$(MAKE) -C $(dir_injector)
|
Added region/language emulation feature, thanks to the hard work of @TuxSH
Create a "locales" folder inside aurei, and one .txt for each game, with the title id of the game. The txt must be exactly 6 bytes long: 3 characters for the region ("JPN", "USA", "EUR", "AUS", "CHN", "KOR", "TWN"), a space, and two for the language ("JP", "EN", "FR", "DE", "IT", "ES", "ZH", "KO", "NL", "PT", "RU", "TW"). You can enable the feature globally in the config menu. This should also make DLCs for foreign games work.
2016-04-14 00:46:36 +02:00
|
|
|
@mv emunand.bin reboot.bin $(dir_injector)/injector.cxi $(@D)
|
|
|
|
@bin2c -o $@ -n emunand $(@D)/emunand.bin -n reboot $(@D)/reboot.bin -n injector $(@D)/injector.cxi
|
2016-03-08 15:13:55 +01:00
|
|
|
|
2016-03-23 14:59:52 +01:00
|
|
|
$(dir_build)/loader.h: $(dir_loader)/Makefile
|
2016-03-20 01:00:45 +01:00
|
|
|
@$(MAKE) -C $(dir_loader)
|
Added region/language emulation feature, thanks to the hard work of @TuxSH
Create a "locales" folder inside aurei, and one .txt for each game, with the title id of the game. The txt must be exactly 6 bytes long: 3 characters for the region ("JPN", "USA", "EUR", "AUS", "CHN", "KOR", "TWN"), a space, and two for the language ("JP", "EN", "FR", "DE", "IT", "ES", "ZH", "KO", "NL", "PT", "RU", "TW"). You can enable the feature globally in the config menu. This should also make DLCs for foreign games work.
2016-04-14 00:46:36 +02:00
|
|
|
@mv $(dir_loader)/loader.bin $(@D)
|
|
|
|
@bin2c -o $@ -n loader $(@D)/loader.bin
|
2015-08-05 03:57:37 +02:00
|
|
|
|
2016-04-01 14:27:31 +02:00
|
|
|
$(dir_build)/screeninit.h: $(dir_screeninit)/Makefile
|
|
|
|
@$(MAKE) -C $(dir_screeninit)
|
Added region/language emulation feature, thanks to the hard work of @TuxSH
Create a "locales" folder inside aurei, and one .txt for each game, with the title id of the game. The txt must be exactly 6 bytes long: 3 characters for the region ("JPN", "USA", "EUR", "AUS", "CHN", "KOR", "TWN"), a space, and two for the language ("JP", "EN", "FR", "DE", "IT", "ES", "ZH", "KO", "NL", "PT", "RU", "TW"). You can enable the feature globally in the config menu. This should also make DLCs for foreign games work.
2016-04-14 00:46:36 +02:00
|
|
|
@mv $(dir_screeninit)/screeninit.bin $(@D)
|
|
|
|
@bin2c -o $@ -n screeninit $(@D)/screeninit.bin
|
2016-04-01 14:27:31 +02:00
|
|
|
|
2015-08-05 03:57:37 +02:00
|
|
|
$(dir_build)/main.bin: $(dir_build)/main.elf
|
|
|
|
$(OC) -S -O binary $< $@
|
|
|
|
|
Added region/language emulation feature, thanks to the hard work of @TuxSH
Create a "locales" folder inside aurei, and one .txt for each game, with the title id of the game. The txt must be exactly 6 bytes long: 3 characters for the region ("JPN", "USA", "EUR", "AUS", "CHN", "KOR", "TWN"), a space, and two for the language ("JP", "EN", "FR", "DE", "IT", "ES", "ZH", "KO", "NL", "PT", "RU", "TW"). You can enable the feature globally in the config menu. This should also make DLCs for foreign games work.
2016-04-14 00:46:36 +02:00
|
|
|
$(dir_build)/main.elf: $(objects)
|
|
|
|
$(CC) $(LDFLAGS) -T linker.ld $(OUTPUT_OPTION) $^
|
2015-08-05 03:57:37 +02:00
|
|
|
|
2016-04-06 14:51:07 +02:00
|
|
|
$(dir_build)/memory.o : CFLAGS += -O3
|
2016-04-05 05:27:28 +02:00
|
|
|
$(dir_build)/config.o : CFLAGS += -DCONFIG_TITLE="\"$(name) $(version) configuration\""
|
2016-04-02 17:58:06 +02:00
|
|
|
|
2016-04-01 14:27:31 +02:00
|
|
|
$(dir_build)/%.o: $(dir_source)/%.c $(dir_build)/patches.h $(dir_build)/loader.h $(dir_build)/screeninit.h
|
2015-08-05 03:57:37 +02:00
|
|
|
@mkdir -p "$(@D)"
|
|
|
|
$(COMPILE.c) $(OUTPUT_OPTION) $<
|
|
|
|
|
|
|
|
$(dir_build)/%.o: $(dir_source)/%.s
|
|
|
|
@mkdir -p "$(@D)"
|
|
|
|
$(COMPILE.s) $(OUTPUT_OPTION) $<
|
2016-02-19 01:29:53 +01:00
|
|
|
|
2015-08-05 03:57:37 +02:00
|
|
|
$(dir_build)/fatfs/%.o: $(dir_source)/fatfs/%.c
|
|
|
|
@mkdir -p "$(@D)"
|
2016-04-11 15:53:59 +02:00
|
|
|
$(COMPILE.c) $(OUTPUT_OPTION) $<
|
2015-08-05 03:57:37 +02:00
|
|
|
|
|
|
|
$(dir_build)/fatfs/%.o: $(dir_source)/fatfs/%.s
|
|
|
|
@mkdir -p "$(@D)"
|
2016-04-11 05:15:44 +02:00
|
|
|
$(COMPILE.s) $(OUTPUT_OPTION) $<
|
2015-08-05 03:57:37 +02:00
|
|
|
include $(call rwildcard, $(dir_build), *.d)
|