summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAetias <aetias@outlook.com>2023-10-15 13:38:23 +0200
committerAetias <aetias@outlook.com>2023-10-15 13:38:23 +0200
commitacbcd40397e3d3400d137315fd7ff0a086d52e07 (patch)
tree965b1a1111b1c9e717aff80d0bd773bbd3855435
parent7191db6c181610817f47446257a69578d9cef105 (diff)
Build and compare ROM in Makefile
-rw-r--r--Makefile17
-rw-r--r--checksum.sha13
2 files changed, 17 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index cc856b17..9b341dbf 100644
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,17 @@
REGION ?= EUR
ifeq ($(REGION), EUR)
- TARGET_SUBDIR := eur
+ REGION_NAME := eur
+ REGION_SUFFIX := P
else
$(error Unknown region '$(REGION)')
endif
ROOT := $(shell pwd)
BUILD_DIR := $(ROOT)/build
-TARGET_DIR := $(BUILD_DIR)/$(TARGET_SUBDIR)
+TARGET_DIR := $(BUILD_DIR)/$(REGION_NAME)
TOOLS_DIR := $(ROOT)/tools
+BASE_DIR := $(ROOT)/ph_$(REGION_NAME)
LCF_FILE := $(BUILD_DIR)/arm9_linker_script.lcf
OBJS_FILE := $(BUILD_DIR)/arm9_objects.txt
@@ -21,6 +23,8 @@ CXX_OBJS = $(CXX_FILES:%.cpp=$(TARGET_DIR)/%.o)
OV_BINS := $(wildcard $(TARGET_DIR)/overlays/*.bin)
OV_LZS = $(OV_BINS:%.bin=%.lz)
+NDS_FILE = ph_$(REGION_NAME).nds
+
MW_VER := 2.0/sp1p5
MW_ASM := $(TOOLS_DIR)/mwccarm/$(MW_VER)/mwasmarm
MW_CC := $(TOOLS_DIR)/mwccarm/$(MW_VER)/mwccarm
@@ -32,11 +36,18 @@ CC_FLAGS := -O1 -thumb -d $(REGION)
LD_FLAGS := -proc arm946e -nostdlib -nointerworking -nodead -m func_02000800 -map closure,unused -o main.bin -msgstyle gcc
.PHONY: all
-all: tools arm9
+all: tools rom
+ sha1sum $(NDS_FILE)
+ sha1sum -c checksum.sha1
.PHONY: tools
tools:
cd $(TOOLS_DIR)/compress && $(MAKE)
+ cd $(TOOLS_DIR)/rom && $(MAKE)
+
+.PHONY: rom
+rom: arm9
+ $(TOOLS_DIR)/rom/buildrom -a $(BASE_DIR) -b $(TARGET_DIR) -r $(REGION_SUFFIX) -o $(NDS_FILE)
.PHONY: arm9
arm9: link
diff --git a/checksum.sha1 b/checksum.sha1
new file mode 100644
index 00000000..ad8dc000
--- /dev/null
+++ b/checksum.sha1
@@ -0,0 +1,3 @@
+02be55db55cf254bd064d2b3eb368b92a5b4156d ph_eur.nds
+4c8f52dd719918bbcd46e73a8bae8628139c1b85 ph_usa.nds
+53e46481deb08237354945bc63ab0b02f4de1ff4 ph_jpn.nds