2020-07-15 16:59:16 +00:00
|
|
|
PROJECT_NAME := MissionControl
|
2021-02-03 23:18:26 +00:00
|
|
|
MC_MITM_TID := 010000000000bd00
|
2020-04-17 09:50:30 +00:00
|
|
|
|
2021-02-28 14:43:17 +00:00
|
|
|
GIT_BRANCH := $(shell git symbolic-ref --short HEAD | sed s/[^a-zA-Z0-9_-]/_/g)
|
2021-02-18 22:20:09 +00:00
|
|
|
GIT_HASH := $(shell git rev-parse --short HEAD)
|
|
|
|
GIT_TAG := $(shell git describe --tags `git rev-list --tags --max-count=1`)
|
2021-08-23 23:20:35 +00:00
|
|
|
|
|
|
|
VERSION := $(shell [[ $(GIT_TAG) =~ ^v([0-9]+).([0-9]+).([0-9]+) ]] && printf '0x%02X%02X%02X' $${BASH_REMATCH[1]} $${BASH_REMATCH[2]} $${BASH_REMATCH[3]})
|
2021-02-18 22:20:09 +00:00
|
|
|
BUILD_VERSION := $(GIT_TAG:v%=%)-$(GIT_BRANCH)-$(GIT_HASH)
|
|
|
|
|
2021-02-19 00:53:09 +00:00
|
|
|
TARGETS := mcmitm_version.cpp mc_mitm
|
2020-04-17 09:50:30 +00:00
|
|
|
|
|
|
|
all: $(TARGETS)
|
|
|
|
|
2021-02-19 00:53:09 +00:00
|
|
|
mcmitm_version.cpp: .git/HEAD .git/index
|
2021-08-23 23:20:35 +00:00
|
|
|
echo "namespace ams::mitm { unsigned int mc_version = $(VERSION); const char *mc_build_name = \"$(BUILD_VERSION)\"; const char *mc_build_date = \"$$(date)\"; }" > mc_mitm/source/$@
|
2021-02-19 00:53:09 +00:00
|
|
|
|
2021-02-03 23:18:26 +00:00
|
|
|
mc_mitm:
|
2020-04-17 09:50:30 +00:00
|
|
|
$(MAKE) -C $@
|
|
|
|
|
|
|
|
clean:
|
2021-02-03 23:18:26 +00:00
|
|
|
$(MAKE) -C mc_mitm clean
|
2021-02-19 00:53:09 +00:00
|
|
|
rm mc_mitm/source/mcmitm_version.cpp
|
2020-04-17 09:50:30 +00:00
|
|
|
rm -rf dist
|
|
|
|
|
2020-07-15 16:59:16 +00:00
|
|
|
dist: all
|
2020-04-17 09:50:30 +00:00
|
|
|
rm -rf dist
|
2022-03-24 06:32:43 +00:00
|
|
|
|
2021-08-23 23:20:35 +00:00
|
|
|
|
|
|
|
|
2021-02-03 23:18:26 +00:00
|
|
|
mkdir -p dist/atmosphere/contents/$(MC_MITM_TID)
|
2022-03-24 06:32:43 +00:00
|
|
|
cp mc_mitm/out/nintendo_nx_arm64_armv8a/release/mc_mitm.nsp dist/atmosphere/contents/$(MC_MITM_TID)/exefs.nsp
|
2021-02-03 23:18:26 +00:00
|
|
|
echo "btdrv" >> dist/atmosphere/contents/$(MC_MITM_TID)/mitm.lst
|
|
|
|
echo "btm" >> dist/atmosphere/contents/$(MC_MITM_TID)/mitm.lst
|
2020-09-07 19:46:35 +00:00
|
|
|
|
2021-02-03 23:18:26 +00:00
|
|
|
mkdir -p dist/atmosphere/contents/$(MC_MITM_TID)/flags
|
|
|
|
touch dist/atmosphere/contents/$(MC_MITM_TID)/flags/boot2.flag
|
2021-02-20 23:16:23 +00:00
|
|
|
|
2021-02-03 23:18:26 +00:00
|
|
|
cp mc_mitm/toolbox.json dist/atmosphere/contents/$(MC_MITM_TID)/toolbox.json
|
2022-03-24 06:32:43 +00:00
|
|
|
|
2020-07-15 16:59:16 +00:00
|
|
|
cp -r exefs_patches dist/atmosphere/
|
2021-02-20 23:16:23 +00:00
|
|
|
|
2021-07-11 17:40:24 +00:00
|
|
|
mkdir -p dist/config/MissionControl
|
2021-08-09 20:57:16 +00:00
|
|
|
mkdir -p dist/config/MissionControl/controllers
|
2021-07-11 17:40:24 +00:00
|
|
|
cp mc_mitm/config.ini dist/config/MissionControl/missioncontrol.ini.template
|
2022-03-24 06:32:43 +00:00
|
|
|
|
2021-02-18 22:20:09 +00:00
|
|
|
cd dist; zip -r $(PROJECT_NAME)-$(BUILD_VERSION).zip ./*; cd ../;
|
2022-03-24 06:32:43 +00:00
|
|
|
|
2020-07-15 16:59:16 +00:00
|
|
|
.PHONY: all clean dist $(TARGETS)
|