2021-03-21 10:51:59 +01:00
|
|
|
ifeq ($(strip $(DEVKITPRO)),)
|
|
|
|
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>devkitPro)
|
|
|
|
endif
|
|
|
|
|
|
|
|
include $(DEVKITPRO)/devkitA64/base_tools
|
|
|
|
|
2020-01-16 08:47:14 +01:00
|
|
|
TOPTARGETS := all clean dist-no-debug dist
|
2018-11-08 10:27:36 +01:00
|
|
|
AMSBRANCH := $(shell git symbolic-ref --short HEAD)
|
2019-02-25 05:22:38 +01:00
|
|
|
AMSHASH := $(shell git rev-parse --short HEAD)
|
|
|
|
AMSREV := $(AMSBRANCH)-$(AMSHASH)
|
2018-11-08 10:27:36 +01:00
|
|
|
|
2018-10-21 22:59:59 +02:00
|
|
|
ifneq (, $(strip $(shell git status --porcelain 2>/dev/null)))
|
|
|
|
AMSREV := $(AMSREV)-dirty
|
|
|
|
endif
|
2018-04-23 20:07:49 +02:00
|
|
|
|
2021-09-06 20:21:18 +02:00
|
|
|
COMPONENTS := fusee stratosphere mesosphere exosphere emummc thermosphere troposphere libraries
|
2019-01-25 18:33:35 +01:00
|
|
|
|
|
|
|
all: $(COMPONENTS)
|
2021-09-06 00:45:40 +02:00
|
|
|
$(eval MAJORVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MAJOR\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
|
|
|
|
| tr -s [:blank:] \
|
|
|
|
| cut -d' ' -f3))
|
|
|
|
$(eval MINORVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MINOR\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
|
|
|
|
| tr -s [:blank:] \
|
|
|
|
| cut -d' ' -f3))
|
|
|
|
$(eval MICROVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MICRO\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
|
|
|
|
| tr -s [:blank:] \
|
|
|
|
| cut -d' ' -f3))
|
|
|
|
$(eval S_MAJORVER = $(shell grep 'define ATMOSPHERE_SUPPORTED_HOS_VERSION_MAJOR\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
|
|
|
|
| tr -s [:blank:] \
|
|
|
|
| cut -d' ' -f3))
|
|
|
|
$(eval S_MINORVER = $(shell grep 'define ATMOSPHERE_SUPPORTED_HOS_VERSION_MINOR\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
|
|
|
|
| tr -s [:blank:] \
|
|
|
|
| cut -d' ' -f3))
|
|
|
|
$(eval S_MICROVER = $(shell grep 'define ATMOSPHERE_SUPPORTED_HOS_VERSION_MICRO\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
|
|
|
|
| tr -s [:blank:] \
|
|
|
|
| cut -d' ' -f3))
|
|
|
|
@python fusee/build_package3.py $(CURDIR) release $(AMSHASH) $(MAJORVER) $(MINORVER) $(MICROVER) 0 $(S_MAJORVER) $(S_MINORVER) $(S_MICROVER) 0
|
|
|
|
@echo "Built package3!"
|
2018-10-30 19:25:21 +01:00
|
|
|
|
|
|
|
thermosphere:
|
|
|
|
$(MAKE) -C thermosphere all
|
|
|
|
|
|
|
|
exosphere: thermosphere
|
2020-06-11 10:53:10 +02:00
|
|
|
$(MAKE) -C exosphere all
|
2018-04-23 20:07:49 +02:00
|
|
|
|
2019-12-10 04:13:13 +01:00
|
|
|
stratosphere: exosphere libraries
|
2018-10-30 19:25:21 +01:00
|
|
|
$(MAKE) -C stratosphere all
|
|
|
|
|
2019-12-17 23:36:42 +01:00
|
|
|
mesosphere: exosphere libraries
|
|
|
|
$(MAKE) -C mesosphere all
|
|
|
|
|
2019-01-24 18:05:06 +01:00
|
|
|
troposphere: stratosphere
|
|
|
|
$(MAKE) -C troposphere all
|
|
|
|
|
2021-09-06 20:21:18 +02:00
|
|
|
emummc:
|
|
|
|
$(MAKE) -C emummc all
|
|
|
|
|
2021-08-20 22:13:29 +02:00
|
|
|
fusee: exosphere mesosphere stratosphere
|
2018-10-30 19:25:21 +01:00
|
|
|
$(MAKE) -C $@ all
|
2018-10-17 04:41:06 +02:00
|
|
|
|
2019-12-10 04:13:13 +01:00
|
|
|
libraries:
|
|
|
|
$(MAKE) -C libraries all
|
|
|
|
|
2018-05-19 00:54:38 +02:00
|
|
|
clean:
|
|
|
|
$(MAKE) -C fusee clean
|
2021-06-26 08:48:41 +02:00
|
|
|
$(MAKE) -C emummc clean
|
2021-09-06 00:55:48 +02:00
|
|
|
$(MAKE) -C libraries clean
|
|
|
|
$(MAKE) -C exosphere clean
|
|
|
|
$(MAKE) -C thermosphere clean
|
|
|
|
$(MAKE) -C mesosphere clean
|
|
|
|
$(MAKE) -C stratosphere clean
|
2018-10-17 04:43:57 +02:00
|
|
|
rm -rf out
|
2019-01-25 18:33:35 +01:00
|
|
|
|
2020-01-16 08:47:14 +01:00
|
|
|
dist-no-debug: all
|
2019-12-09 12:58:48 +01:00
|
|
|
$(eval MAJORVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MAJOR\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
|
2018-10-17 04:41:06 +02:00
|
|
|
| tr -s [:blank:] \
|
|
|
|
| cut -d' ' -f3))
|
2019-12-09 12:58:48 +01:00
|
|
|
$(eval MINORVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MINOR\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
|
2018-10-17 04:41:06 +02:00
|
|
|
| tr -s [:blank:] \
|
|
|
|
| cut -d' ' -f3))
|
2019-12-09 12:58:48 +01:00
|
|
|
$(eval MICROVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MICRO\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
|
2018-10-17 04:41:06 +02:00
|
|
|
| tr -s [:blank:] \
|
|
|
|
| cut -d' ' -f3))
|
2018-10-21 22:59:59 +02:00
|
|
|
$(eval AMSVER = $(MAJORVER).$(MINORVER).$(MICROVER)-$(AMSREV))
|
2018-10-17 04:41:06 +02:00
|
|
|
rm -rf atmosphere-$(AMSVER)
|
2018-10-17 04:43:57 +02:00
|
|
|
rm -rf out
|
2018-10-17 04:41:06 +02:00
|
|
|
mkdir atmosphere-$(AMSVER)
|
|
|
|
mkdir atmosphere-$(AMSVER)/atmosphere
|
2019-01-24 18:05:06 +01:00
|
|
|
mkdir atmosphere-$(AMSVER)/switch
|
2019-04-13 00:28:46 +02:00
|
|
|
mkdir -p atmosphere-$(AMSVER)/atmosphere/fatal_errors
|
2019-11-27 22:44:09 +01:00
|
|
|
mkdir -p atmosphere-$(AMSVER)/atmosphere/config_templates
|
2019-12-06 12:29:14 +01:00
|
|
|
mkdir -p atmosphere-$(AMSVER)/atmosphere/config
|
2021-03-21 12:12:30 +01:00
|
|
|
mkdir -p atmosphere-$(AMSVER)/atmosphere/flags
|
2021-09-06 00:45:40 +02:00
|
|
|
cp fusee/fusee.bin atmosphere-$(AMSVER)/atmosphere/reboot_payload.bin
|
|
|
|
cp fusee/package3 atmosphere-$(AMSVER)/atmosphere/package3
|
|
|
|
cp config_templates/stratosphere.ini atmosphere-$(AMSVER)/atmosphere/config_templates/stratosphere.ini
|
2019-12-09 12:58:48 +01:00
|
|
|
cp config_templates/override_config.ini atmosphere-$(AMSVER)/atmosphere/config_templates/override_config.ini
|
|
|
|
cp config_templates/system_settings.ini atmosphere-$(AMSVER)/atmosphere/config_templates/system_settings.ini
|
2020-06-15 08:04:28 +02:00
|
|
|
cp config_templates/exosphere.ini atmosphere-$(AMSVER)/atmosphere/config_templates/exosphere.ini
|
2021-09-09 09:15:35 +02:00
|
|
|
mkdir -p config_templates/kip_patches
|
2019-12-09 12:58:48 +01:00
|
|
|
cp -r config_templates/kip_patches atmosphere-$(AMSVER)/atmosphere/kip_patches
|
|
|
|
cp -r config_templates/hbl_html atmosphere-$(AMSVER)/atmosphere/hbl_html
|
2021-03-21 12:12:30 +01:00
|
|
|
mkdir -p atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/0100000000000008
|
|
|
|
mkdir -p atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/010000000000000D
|
2021-03-21 21:20:44 +01:00
|
|
|
mkdir -p atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/0100000000000017
|
2021-03-21 12:12:30 +01:00
|
|
|
mkdir -p atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/010000000000002B
|
|
|
|
mkdir -p atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/0100000000000032
|
|
|
|
mkdir -p atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/0100000000000034
|
|
|
|
mkdir -p atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/0100000000000036
|
|
|
|
mkdir -p atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/0100000000000037
|
|
|
|
mkdir -p atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/010000000000003C
|
|
|
|
mkdir -p atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/0100000000000042
|
2021-09-12 04:32:14 +02:00
|
|
|
mkdir -p atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/0100000000000420
|
2021-03-21 21:20:44 +01:00
|
|
|
mkdir -p atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/010000000000B240
|
|
|
|
mkdir -p atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/010000000000D623
|
2021-03-21 12:12:30 +01:00
|
|
|
cp stratosphere/boot2/boot2.nsp atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/0100000000000008/exefs.nsp
|
|
|
|
cp stratosphere/dmnt/dmnt.nsp atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/010000000000000D/exefs.nsp
|
2021-03-21 21:20:44 +01:00
|
|
|
cp stratosphere/cs/cs.nsp atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/0100000000000017/exefs.nsp
|
2021-03-21 12:12:30 +01:00
|
|
|
cp stratosphere/erpt/erpt.nsp atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/010000000000002B/exefs.nsp
|
|
|
|
cp stratosphere/eclct.stub/eclct.stub.nsp atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/0100000000000032/exefs.nsp
|
|
|
|
cp stratosphere/fatal/fatal.nsp atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/0100000000000034/exefs.nsp
|
|
|
|
cp stratosphere/creport/creport.nsp atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/0100000000000036/exefs.nsp
|
|
|
|
cp stratosphere/ro/ro.nsp atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/0100000000000037/exefs.nsp
|
|
|
|
cp stratosphere/jpegdec/jpegdec.nsp atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/010000000000003C/exefs.nsp
|
|
|
|
cp stratosphere/pgl/pgl.nsp atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/0100000000000042/exefs.nsp
|
2021-09-12 04:32:14 +02:00
|
|
|
cp stratosphere/LogManager/LogManager.nsp atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/0100000000000420/exefs.nsp
|
2021-03-21 21:20:44 +01:00
|
|
|
cp stratosphere/htc/htc.nsp atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/010000000000B240/exefs.nsp
|
|
|
|
cp stratosphere/TioServer/TioServer.nsp atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/010000000000D623/exefs.nsp
|
2021-03-21 12:12:30 +01:00
|
|
|
@build_romfs atmosphere-$(AMSVER)/stratosphere_romfs atmosphere-$(AMSVER)/atmosphere/stratosphere.romfs
|
|
|
|
rm -r atmosphere-$(AMSVER)/stratosphere_romfs
|
2019-04-22 10:54:44 +02:00
|
|
|
cp troposphere/reboot_to_payload/reboot_to_payload.nro atmosphere-$(AMSVER)/switch/reboot_to_payload.nro
|
2020-07-09 02:11:52 +02:00
|
|
|
cp troposphere/daybreak/daybreak.nro atmosphere-$(AMSVER)/switch/daybreak.nro
|
2021-01-05 18:43:09 +01:00
|
|
|
cd atmosphere-$(AMSVER); zip -r ../atmosphere-$(AMSVER).zip ./*; cd ../;
|
2021-09-06 00:45:40 +02:00
|
|
|
rm -rf atmosphere-$(AMSVER)
|
2020-01-16 08:47:14 +01:00
|
|
|
mkdir out
|
|
|
|
mv atmosphere-$(AMSVER).zip out/atmosphere-$(AMSVER).zip
|
2021-09-06 00:45:40 +02:00
|
|
|
cp fusee/fusee.bin out/fusee.bin
|
2020-01-16 08:47:14 +01:00
|
|
|
|
|
|
|
dist: dist-no-debug
|
|
|
|
$(eval MAJORVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MAJOR\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
|
|
|
|
| tr -s [:blank:] \
|
|
|
|
| cut -d' ' -f3))
|
|
|
|
$(eval MINORVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MINOR\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
|
|
|
|
| tr -s [:blank:] \
|
|
|
|
| cut -d' ' -f3))
|
|
|
|
$(eval MICROVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MICRO\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
|
|
|
|
| tr -s [:blank:] \
|
|
|
|
| cut -d' ' -f3))
|
|
|
|
$(eval AMSVER = $(MAJORVER).$(MINORVER).$(MICROVER)-$(AMSREV))
|
2020-01-16 06:42:58 +01:00
|
|
|
rm -rf atmosphere-$(AMSVER)-debug
|
|
|
|
mkdir atmosphere-$(AMSVER)-debug
|
2021-09-06 00:45:40 +02:00
|
|
|
cp fusee/loader_stub/loader_stub.elf atmosphere-$(AMSVER)-debug/fusee-loader-stub.elf
|
|
|
|
cp fusee/program/program.elf atmosphere-$(AMSVER)-debug/fusee-program.elf
|
2020-06-11 10:53:10 +02:00
|
|
|
cp exosphere/loader_stub/loader_stub.elf atmosphere-$(AMSVER)-debug/exosphere-loader-stub.elf
|
|
|
|
cp exosphere/program/program.elf atmosphere-$(AMSVER)-debug/exosphere-program.elf
|
|
|
|
cp exosphere/warmboot/warmboot.elf atmosphere-$(AMSVER)-debug/exosphere-warmboot.elf
|
2020-11-21 08:20:48 +01:00
|
|
|
cp exosphere/mariko_fatal/mariko_fatal.elf atmosphere-$(AMSVER)-debug/exosphere-mariko-fatal.elf
|
2020-06-11 10:53:10 +02:00
|
|
|
cp exosphere/program/sc7fw/sc7fw.elf atmosphere-$(AMSVER)-debug/exosphere-sc7fw.elf
|
|
|
|
cp exosphere/program/rebootstub/rebootstub.elf atmosphere-$(AMSVER)-debug/exosphere-rebootstub.elf
|
2020-01-16 06:42:58 +01:00
|
|
|
cp mesosphere/kernel_ldr/kernel_ldr.elf atmosphere-$(AMSVER)-debug/kernel_ldr.elf
|
2021-02-16 04:40:00 +01:00
|
|
|
cp mesosphere/kernel/kernel.elf atmosphere-$(AMSVER)-debug/kernel.elf
|
2020-01-16 06:42:58 +01:00
|
|
|
cp stratosphere/ams_mitm/ams_mitm.elf atmosphere-$(AMSVER)-debug/ams_mitm.elf
|
|
|
|
cp stratosphere/boot/boot.elf atmosphere-$(AMSVER)-debug/boot.elf
|
|
|
|
cp stratosphere/boot2/boot2.elf atmosphere-$(AMSVER)-debug/boot2.elf
|
|
|
|
cp stratosphere/creport/creport.elf atmosphere-$(AMSVER)-debug/creport.elf
|
|
|
|
cp stratosphere/dmnt/dmnt.elf atmosphere-$(AMSVER)-debug/dmnt.elf
|
|
|
|
cp stratosphere/eclct.stub/eclct.stub.elf atmosphere-$(AMSVER)-debug/eclct.stub.elf
|
2020-12-02 11:51:02 +01:00
|
|
|
cp stratosphere/erpt/erpt.elf atmosphere-$(AMSVER)-debug/erpt.elf
|
2020-01-16 06:42:58 +01:00
|
|
|
cp stratosphere/fatal/fatal.elf atmosphere-$(AMSVER)-debug/fatal.elf
|
2020-12-02 11:51:02 +01:00
|
|
|
cp stratosphere/jpegdec/jpegdec.elf atmosphere-$(AMSVER)-debug/jpegdec.elf
|
2020-01-16 06:42:58 +01:00
|
|
|
cp stratosphere/loader/loader.elf atmosphere-$(AMSVER)-debug/loader.elf
|
2020-12-02 11:51:02 +01:00
|
|
|
cp stratosphere/ncm/ncm.elf atmosphere-$(AMSVER)-debug/ncm.elf
|
|
|
|
cp stratosphere/pgl/pgl.elf atmosphere-$(AMSVER)-debug/pgl.elf
|
2020-01-16 06:42:58 +01:00
|
|
|
cp stratosphere/pm/pm.elf atmosphere-$(AMSVER)-debug/pm.elf
|
|
|
|
cp stratosphere/ro/ro.elf atmosphere-$(AMSVER)-debug/ro.elf
|
|
|
|
cp stratosphere/sm/sm.elf atmosphere-$(AMSVER)-debug/sm.elf
|
|
|
|
cp stratosphere/spl/spl.elf atmosphere-$(AMSVER)-debug/spl.elf
|
2020-07-09 02:11:52 +02:00
|
|
|
cp troposphere/daybreak/daybreak.elf atmosphere-$(AMSVER)-debug/daybreak.elf
|
2020-01-16 06:42:58 +01:00
|
|
|
cd atmosphere-$(AMSVER)-debug; zip -r ../atmosphere-$(AMSVER)-debug.zip ./*; cd ../;
|
|
|
|
rm -r atmosphere-$(AMSVER)-debug
|
2020-01-16 08:47:14 +01:00
|
|
|
mv atmosphere-$(AMSVER)-debug.zip out/atmosphere-$(AMSVER)-debug.zip
|
2018-04-23 20:07:49 +02:00
|
|
|
|
2019-01-25 18:33:35 +01:00
|
|
|
|
|
|
|
.PHONY: $(TOPTARGETS) $(COMPONENTS)
|