-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
53 lines (41 loc) · 1.8 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# common.mk needs to be copied from common.mk.template and filled with correct parameters
# for the asar executeable and the paths to the original ROM files
include common.mk
help:
@echo "usage: make [option]"
@echo ""
@echo "Options:"
@echo " dist Create distribution package"
@echo " patch Patch original SMW"
@echo " compare Compare patches to reference ROMs"
dist:
@echo "Creating distribution package in build/"
@echo "Cleaning build dir"
rm -rf build
mkdir -p build
@echo "Copying Documentation"
cp README.md build/README.txt
@echo "Copying Configuration and includes"
mkdir -p build/config
mkdir -p build/includes
cp src/config/quickretry_config.asm build/config/quickretry_config.asm
cp src/includes/hardware_registers.asm build/includes/hardware_registers.asm
cp src/includes/rammap.asm build/includes/rammap.asm
@echo "Copying sources"
cp src/quickretry.asm build/quickretry.asm
@echo "Creating archive"
cd build; tar cvzf ../quickretry-$(VERSION).tgz *
cd build; zip -r ../quickretry-$(VERSION).zip *
patch:
@echo "Patching original SMW..."
cd src; $(ASAR_BIN) quickretry.asm $(ORIGINAL_ROM) ../original-patched.smc
@echo "Patching Reference SMC"
cd src; $(ASAR_BIN) quickretry.asm $(REFERENCE_ROM) ../reference-patched.smc
@echo "Patching Kaizo SMC"
cd src; $(ASAR_BIN) quickretry.asm $(KAIZO_ROM) ../kaizo-patched.smc
compare:
@echo "Comparing ROMs to originals"
@-cmp original-patched.smc originals/original-patched.smc; if [ $$? -eq 0 ] ; then echo "ORIGINAL ROM MATCHES" ; fi; true
@-cmp reference-patched.smc originals/reference-patched.smc; if [ $$? -eq 0 ] ; then echo "REFERENCE ROM MATCHES" ; fi; true
@-cmp kaizo-patched.smc originals/kaizo-patched.smc; if [ $$? -eq 0 ] ; then echo "KAIZO ROM MATCHES" ; fi; true
@echo "Done comparing!"