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
1 changed files with 13 additions and 6 deletions

View File

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