Generate heal location constants automatically, move data back to a single file.

This commit is contained in:
GriffinR
2025-02-03 20:18:34 -05:00
parent 678fdf9979
commit cdadd7d2ed
28 changed files with 199 additions and 249 deletions

View File

@@ -12,7 +12,6 @@ INCLUDECONSTS_OUTDIR := include/constants
AUTO_GEN_TARGETS += $(INCLUDECONSTS_OUTDIR)/map_groups.h
AUTO_GEN_TARGETS += $(INCLUDECONSTS_OUTDIR)/layouts.h
AUTO_GEN_TARGETS += $(INCLUDECONSTS_OUTDIR)/map_event_ids.h
AUTO_GEN_TARGETS += $(DATA_SRC_SUBDIR)/heal_locations.h
MAP_DIRS := $(dir $(wildcard $(MAPS_DIR)/*/map.json))
MAP_CONNECTIONS := $(patsubst $(MAPS_DIR)/%/,$(MAPS_DIR)/%/connections.inc,$(MAP_DIRS))
@@ -35,11 +34,8 @@ $(MAPS_OUTDIR)/connections.inc $(MAPS_OUTDIR)/groups.inc $(MAPS_OUTDIR)/events.i
$(LAYOUTS_OUTDIR)/layouts.inc $(LAYOUTS_OUTDIR)/layouts_table.inc $(INCLUDECONSTS_OUTDIR)/layouts.h: $(LAYOUTS_DIR)/layouts.json
$(MAPJSON) layouts emerald $< $(LAYOUTS_OUTDIR) $(INCLUDECONSTS_OUTDIR)
# Generate files that depends on data that's distributed across the map.json files.
# Generate constants for map events, which depend on data that's distributed across the map.json files.
# There's a lot of map.json files, so we print an abbreviated output with echo.
# We're also not using a pattern rule, and we only want this to run once for both targets,
# so we use a separate target 'event_constants'.
$(INCLUDECONSTS_OUTDIR)/map_event_ids.h $(DATA_SRC_SUBDIR)/heal_locations.h: .event_constants ;
.event_constants: $(MAP_JSONS)
@$(MAPJSON) event_constants emerald $^ $(INCLUDECONSTS_OUTDIR)/map_event_ids.h $(DATA_SRC_SUBDIR)/heal_locations.h
@echo "$(MAPJSON) event_constants emerald <MAP_JSONS> $(INCLUDECONSTS_OUTDIR)/map_event_ids.h $(DATA_SRC_SUBDIR)/heal_locations.h"
$(INCLUDECONSTS_OUTDIR)/map_event_ids.h: $(MAP_JSONS)
@$(MAPJSON) event_constants emerald $^ $(INCLUDECONSTS_OUTDIR)/map_event_ids.h
@echo "$(MAPJSON) event_constants emerald <MAP_JSONS> $(INCLUDECONSTS_OUTDIR)/map_event_ids.h"