mirror of https://github.com/zeldaret/tmc.git
Cleaner baserom dependency handling
Instead of scaninc ignoring everything starting with baserom, we tell make which baseroms are needed and which to ignore if they come up as dependencies, depending on the version used.
This commit is contained in:
parent
68b65dfd9a
commit
300169514a
80
Makefile
80
Makefile
|
@ -35,44 +35,6 @@ endif
|
|||
endif
|
||||
endif
|
||||
|
||||
# Check that the required baseroms are available.
|
||||
ifeq ($(GAME_VERSION), USA)
|
||||
baserom.gba:
|
||||
$(error Missing baserom.gba)
|
||||
.PHONY: baserom_demo.gba baserom_jp.gba baserom_eu.gba
|
||||
baserom_demo.gba:
|
||||
baserom_jp.gba:
|
||||
baserom_eu.gba:
|
||||
endif
|
||||
ifeq ($(GAME_VERSION), DEMO)
|
||||
baserom.gba:
|
||||
$(error Missing baserom.gba)
|
||||
baserom_demo.gba:
|
||||
$(error Missing baserom_demo.gba)
|
||||
.PHONY: baserom_jp.gba baserom_eu.gba
|
||||
baserom_jp.gba:
|
||||
baserom_eu.gba:
|
||||
endif
|
||||
ifeq ($(GAME_VERSION), JP)
|
||||
baserom.gba:
|
||||
$(error Missing baserom.gba)
|
||||
baserom_jp.gba:
|
||||
$(error Missing baserom_jp.gba)
|
||||
.PHONY: baserom_demo.gba baserom_eu.gba
|
||||
baserom_demo.gba:
|
||||
baserom_eu.gba:
|
||||
endif
|
||||
ifeq ($(GAME_VERSION), EU)
|
||||
baserom.gba:
|
||||
$(error Missing baserom.gba)
|
||||
baserom_jp.gba:
|
||||
$(error Missing baserom_jp.gba)
|
||||
baserom_eu.gba:
|
||||
$(error Missing baserom_eu.gba)
|
||||
.PHONY: baserom_demo.gba
|
||||
baserom_demo.gba:
|
||||
endif
|
||||
|
||||
SHELL := /bin/bash -o pipefail
|
||||
|
||||
|
||||
|
@ -203,7 +165,10 @@ clean-tools:
|
|||
clean: mostlyclean clean-tools
|
||||
|
||||
tidy:
|
||||
rm -f $(ROM) $(ELF) $(MAP)
|
||||
rm -f tmc.gba tmc.elf tmc.map
|
||||
rm -f tmc_demo.gba tmc_demo.elf tmc_demo.map
|
||||
rm -f tmc_jp.gba tmc_jp.elf tmc_jp.map
|
||||
rm -f tmc_eu.gba tmc_eu.elf tmc_eu.map
|
||||
rm -r build/*
|
||||
|
||||
include graphics_file_rules.mk
|
||||
|
@ -273,3 +238,40 @@ usa: ; @$(MAKE) GAME_VERSION=USA
|
|||
demo: ; @$(MAKE) GAME_VERSION=DEMO
|
||||
jp: ; @$(MAKE) GAME_VERSION=JP
|
||||
eu: ; @$(MAKE) GAME_VERSION=EU
|
||||
|
||||
ifeq ($(GAME_VERSION), USA)
|
||||
baserom.gba:
|
||||
$(error "You need to provide a USA ROM as baserom.gba")
|
||||
.PHONY: baserom_demo.gba baserom_jp.gba baserom_eu.gba
|
||||
baserom_demo.gba:
|
||||
baserom_jp.gba:
|
||||
baserom_eu.gba:
|
||||
endif
|
||||
ifeq ($(GAME_VERSION), DEMO)
|
||||
baserom.gba:
|
||||
$(error "You need to provide a USA ROM as baserom.gba")
|
||||
baserom_demo.gba:
|
||||
$(error "You need to provide a DEMO ROM as baserom_demo.gba")
|
||||
.PHONY: baserom_jp.gba baserom_eu.gba
|
||||
baserom_jp.gba:
|
||||
baserom_eu.gba:
|
||||
endif
|
||||
ifeq ($(GAME_VERSION), JP)
|
||||
baserom.gba:
|
||||
$(error "You need to provide a USA ROM as baserom.gba")
|
||||
baserom_jp.gba:
|
||||
$(error "You need to provide a JP ROM as baserom_jp.gba")
|
||||
.PHONY: baserom_demo.gba baserom_eu.gba
|
||||
baserom_demo.gba:
|
||||
baserom_eu.gba:
|
||||
endif
|
||||
ifeq ($(GAME_VERSION), EU)
|
||||
baserom.gba:
|
||||
$(error "You need to provide a USA ROM as baserom.gba")
|
||||
baserom_jp.gba:
|
||||
$(error "You need to provide a JP ROM as baserom_jp.gba")
|
||||
baserom_eu.gba:
|
||||
$(error "You need to provide a EU ROM as baserom_eu.gba")
|
||||
.PHONY: baserom_demo.gba
|
||||
baserom_demo.gba:
|
||||
endif
|
||||
|
|
|
@ -93,10 +93,7 @@ int main(int argc, char **argv)
|
|||
includeDirs.push_back(file.GetSrcDir());
|
||||
for (auto incbin : file.GetIncbins())
|
||||
{
|
||||
// Don't include incbins starting with baserom, as they might not be necessary if another variant is being built.
|
||||
if (incbin.rfind("baserom", 0) != 0) {
|
||||
dependencies.insert(incbin);
|
||||
}
|
||||
dependencies.insert(incbin);
|
||||
}
|
||||
for (auto include : file.GetIncludes())
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue