Fix several issues with the makefile (#30)

* Fix several issues with the makefile

* Make ROM_NAME conditionally set to allow custom names
This commit is contained in:
Rozelette 2020-09-23 18:47:05 -05:00 committed by GitHub
parent a241f57e60
commit 10f9460b3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,10 +49,11 @@ CFLAGS += -G 0 -non_shared -Xfullwarn -Xcpluscomm -Iinclude -Isrc -Wab,-r4300_mu
#### Files ####
# ROM image
ROM_NAME := rom
ROM := $(ROM_NAME).z64
UNCOMPRESSED_ROM := $(ROM_NAME)_uncompressed.z64
ELF := $(ROM_NAME).elf
MM_BASEROM ?= baserom.z64
MM_ROM_NAME ?= rom
ROM := $(MM_ROM_NAME).z64
UNCOMPRESSED_ROM := $(MM_ROM_NAME)_uncompressed.z64
ELF := $(MM_ROM_NAME).elf
BASEROM_FILES := $(wildcard baserom/*)
# Exclude dmadata, it will be generated right before packing the rom
@ -104,7 +105,9 @@ CC := ./tools/preprocess.py $(CC) -- $(AS) $(ASFLAGS) --
# disasm is not a file so we must tell make not to check it when evaluating timestamps
.INTERMEDIATE: disasm
all: $(ROM) $(UNCOMPRESSED_ROM)
all:
make $(UNCOMPRESSED_ROM)
make $(ROM)
$(ROM): $(ROM_FILES)
./tools/makerom.py ./tables/dmadata_table.txt $@ -c
@ -159,6 +162,7 @@ setup:
git submodule update --init --recursive
python3 -m pip install -r requirements.txt
make -C tools
./tools/extract_rom.py $(MM_BASEROM)
diff-init: all
rm -rf expected/
@ -167,7 +171,10 @@ diff-init: all
cp $(UNCOMPRESSED_ROM) expected/$(UNCOMPRESSED_ROM)
cp $(ROM) expected/$(ROM)
init: setup all diff-init
init:
make setup
make all
make diff-init
# Recipes