pokeheartgold/filesystem.mk
2022-03-05 09:49:50 -05:00

492 lines
13 KiB
Makefile

NITROFS_FILES := \
files/data/UTF16.dat \
files/data/area00light.txt \
files/data/area01light.txt \
files/data/area02light.txt \
files/data/arealight.narc \
files/data/battle_win.NSCR \
files/data/cell0.NCGR \
files/data/cell0.NCLR \
files/data/clact_default.NANR \
files/data/crystal.nsbmd \
files/data/demo_climax.narc \
files/data/dp_areawindow.NCGR \
files/data/dp_areawindow.NCLR \
files/data/dun20_01light.txt \
files/data/dun20_02light.txt \
files/data/dun_sea.nsbtx \
files/data/eoo.dat \
files/data/exdata.dat \
files/data/farm.dat \
files/data/field_cutin.narc \
files/data/fldtanime.narc \
files/data/fs_kanban.nsbca \
files/data/ground0.NCGR \
files/data/ground0.NCLR \
files/data/ground0.NSCR \
files/data/gsbr.dat \
files/data/guru2.narc \
files/data/kemu_itpconv.dat \
files/data/kowaza.narc \
files/data/lake_anim.nsbtx \
files/data/miniasahamabe.nsbtx \
files/data/miniasasea.nsbtx \
files/data/minihamabe.nsbtx \
files/data/minimum.nsbtx \
files/data/minirhana.nsbtx \
files/data/nfont.NCGR \
files/data/nfont.NCLR \
files/data/pc.nsbca \
files/data/pl_wifi.ncgr \
files/data/pl_wm.ncgr \
files/data/pl_wm.nclr \
files/data/slot.narc \
files/data/smptm_koori.NANR \
files/data/smptm_koori.NCER \
files/data/smptm_koori.NCGR \
files/data/smptm_koori.NCLR \
files/data/smptm_nemuri.NANR \
files/data/smptm_nemuri.NCER \
files/data/smptm_nemuri.NCGR \
files/data/smptm_nemuri.NCLR \
files/data/str2uni.bin \
files/data/t3_fl_b.nsbtx \
files/data/t3_fl_p.nsbtx \
files/data/t3_fl_r.nsbtx \
files/data/t3_fl_y.nsbtx \
files/data/test.atr \
files/data/tmap_block.dat \
files/data/tmap_flags.dat \
files/data/tradelist.narc \
files/data/trapmark.narc \
files/data/ug_anim.narc \
files/data/ug_base_cur.nsbmd \
files/data/ug_boygirl.NCGR \
files/data/ug_boygirl.NCLR \
files/data/ug_fossil.narc \
files/data/ug_hero.NANR \
files/data/ug_hero.NCER \
files/data/ug_hole.NANR \
files/data/ug_hole.NCER \
files/data/ug_hole.NCGR \
files/data/ug_parts.narc \
files/data/ug_radar.narc \
files/data/ug_trap.narc \
files/data/ugeffect_obj_graphic.narc \
files/data/underg_radar.narc \
files/data/utility.bin \
files/data/weather_sys.narc \
files/data/wifi.ncgr \
files/data/wifinote.narc \
files/data/wifip2pmatch.narc \
files/data/wm.ncgr \
files/data/wm.nclr \
files/data/wm256k.ncgr \
files/data/sound/gs_sound_data.sdat \
files/msgdata/scenario/scr_msg.narc \
files/fielddata/build_model/bm_field.narc \
files/fielddata/build_model/bm_room.narc \
files/fielddata/build_model/bm_field_matshp.dat \
files/fielddata/build_model/bm_room_matshp.dat \
files/poketool/personal/pms.narc \
files/fielddata/maptable/mapname.bin \
files/tel/pmtel_book.dat \
files/data/mushi/mushi_trainer.bin \
files/data/mushi/mushi_encount.bin \
files/fielddata/wazaoshie/waza_oshie.bin \
files/a/0/0/0 \
files/a/0/0/1 \
files/a/0/0/2 \
files/a/0/0/3 \
files/a/0/0/4 \
files/a/0/0/5 \
files/a/0/0/6 \
files/a/0/0/7 \
files/a/0/0/8 \
files/a/0/0/9 \
files/a/0/1/0 \
files/a/0/1/1 \
files/a/0/1/2 \
files/a/0/1/3 \
files/a/0/1/4 \
files/a/0/1/5 \
files/a/0/1/6 \
files/a/0/1/7 \
files/a/0/1/8 \
files/a/0/1/9 \
files/a/0/2/0 \
files/a/0/2/1 \
files/a/0/2/2 \
files/a/0/2/3 \
files/a/0/2/4 \
files/a/0/2/5 \
files/a/0/2/6 \
files/a/0/2/7 \
files/a/0/2/8 \
files/a/0/2/9 \
files/a/0/3/0 \
files/a/0/3/1 \
files/a/0/3/2 \
files/a/0/3/3 \
files/a/0/3/4 \
files/a/0/3/5 \
files/a/0/3/6 \
files/a/0/3/7 \
files/a/0/3/8 \
files/a/0/3/9 \
files/a/0/4/0 \
files/a/0/4/1 \
files/a/0/4/2 \
files/a/0/4/3 \
files/a/0/4/4 \
files/a/0/4/5 \
files/a/0/4/6 \
files/a/0/4/7 \
files/a/0/4/8 \
files/a/0/4/9 \
files/a/0/5/0 \
files/a/0/5/1 \
files/a/0/5/2 \
files/a/0/5/3 \
files/a/0/5/4 \
files/a/0/5/5 \
files/a/0/5/6 \
files/a/0/5/7 \
files/a/0/5/8 \
files/a/0/5/9 \
files/a/0/6/0 \
files/a/0/6/1 \
files/a/0/6/2 \
files/a/0/6/3 \
files/a/0/6/4 \
files/a/0/6/5 \
files/a/0/6/6 \
files/a/0/6/7 \
files/a/0/6/8 \
files/a/0/6/9 \
files/a/0/7/0 \
files/a/0/7/1 \
files/a/0/7/2 \
files/a/0/7/3 \
files/a/0/7/4 \
files/a/0/7/5 \
files/a/0/7/6 \
files/a/0/7/7 \
files/a/0/7/8 \
files/a/0/7/9 \
files/a/0/8/0 \
files/a/0/8/1 \
files/a/0/8/2 \
files/a/0/8/3 \
files/a/0/8/4 \
files/a/0/8/5 \
files/a/0/8/6 \
files/a/0/8/7 \
files/a/0/8/8 \
files/a/0/8/9 \
files/a/0/9/0 \
files/a/0/9/1 \
files/a/0/9/2 \
files/a/0/9/3 \
files/a/0/9/4 \
files/a/0/9/5 \
files/a/0/9/6 \
files/a/0/9/7 \
files/a/0/9/8 \
files/a/0/9/9 \
files/a/1/0/0 \
files/a/1/0/1 \
files/a/1/0/2 \
files/a/1/0/3 \
files/a/1/0/4 \
files/a/1/0/5 \
files/a/1/0/6 \
files/a/1/0/7 \
files/a/1/0/8 \
files/a/1/0/9 \
files/a/1/1/0 \
files/a/1/1/1 \
files/a/1/1/2 \
files/a/1/1/3 \
files/a/1/1/4 \
files/a/1/1/5 \
files/a/1/1/6 \
files/a/1/1/7 \
files/a/1/1/8 \
files/a/1/1/9 \
files/a/1/2/0 \
files/a/1/2/1 \
files/a/1/2/2 \
files/a/1/2/3 \
files/a/1/2/4 \
files/a/1/2/5 \
files/a/1/2/6 \
files/a/1/2/7 \
files/a/1/2/8 \
files/a/1/2/9 \
files/a/1/3/0 \
files/a/1/3/1 \
files/a/1/3/2 \
files/a/1/3/3 \
files/a/1/3/4 \
files/a/1/3/5 \
files/a/1/3/6 \
files/a/1/3/7 \
files/a/1/3/8 \
files/a/1/3/9 \
files/a/1/4/0 \
files/a/1/4/1 \
files/a/1/4/2 \
files/a/1/4/3 \
files/a/1/4/4 \
files/a/1/4/5 \
files/a/1/4/6 \
files/a/1/4/7 \
files/a/1/4/8 \
files/a/1/4/9 \
files/a/1/5/0 \
files/a/1/5/1 \
files/a/1/5/2 \
files/a/1/5/3 \
files/a/1/5/4 \
files/a/1/5/5 \
files/a/1/5/6 \
files/a/1/5/7 \
files/a/1/5/8 \
files/a/1/5/9 \
files/a/1/6/0 \
files/a/1/6/1 \
files/a/1/6/2 \
files/a/1/6/3 \
files/a/1/6/4 \
files/a/1/6/5 \
files/a/1/6/6 \
files/a/1/6/7 \
files/a/1/6/8 \
files/a/1/6/9 \
files/a/1/7/0 \
files/a/1/7/1 \
files/a/1/7/2 \
files/a/1/7/3 \
files/a/1/7/4 \
files/a/1/7/5 \
files/a/1/7/6 \
files/a/1/7/7 \
files/a/1/7/8 \
files/a/1/7/9 \
files/a/1/8/0 \
files/a/1/8/1 \
files/a/1/8/2 \
files/a/1/8/3 \
files/a/1/8/4 \
files/a/1/8/5 \
files/a/1/8/6 \
files/a/1/8/7 \
files/a/1/8/8 \
files/a/1/8/9 \
files/a/1/9/0 \
files/a/1/9/1 \
files/a/1/9/2 \
files/a/1/9/3 \
files/pbr/pokegra.narc \
files/pbr/otherpoke.narc \
files/a/1/9/4 \
files/a/1/9/5 \
files/a/1/9/6 \
files/a/1/9/7 \
files/a/1/9/8 \
files/a/1/9/9 \
files/a/2/0/0 \
files/a/2/0/1 \
files/a/2/0/2 \
files/a/2/0/3 \
files/a/2/0/4 \
files/a/2/0/5 \
files/a/2/0/6 \
files/a/2/0/7 \
files/a/2/0/8 \
files/a/2/0/9 \
files/a/2/1/0 \
files/a/2/1/1 \
files/a/2/1/2 \
files/a/2/1/3 \
files/a/2/1/4 \
files/a/2/1/5 \
files/a/2/1/6 \
files/a/2/1/7 \
files/a/2/1/8 \
files/a/2/1/9 \
files/a/2/2/0 \
files/a/2/2/1 \
files/a/2/2/2 \
files/a/2/2/3 \
files/a/2/2/4 \
files/a/2/2/5 \
files/a/2/2/6 \
files/a/2/2/7 \
files/a/2/2/8 \
files/a/2/2/9 \
files/a/2/3/0 \
files/a/2/3/1 \
files/a/2/3/2 \
files/a/2/3/3 \
files/a/2/3/4 \
files/a/2/3/5 \
files/a/2/3/6 \
files/a/2/3/7 \
files/a/2/3/8 \
files/a/2/3/9 \
files/a/2/4/0 \
files/a/2/4/1 \
files/a/2/4/2 \
files/a/2/4/3 \
files/a/2/4/4 \
files/a/2/4/5 \
files/a/2/4/6 \
files/a/2/4/7 \
files/a/2/4/8 \
files/a/2/4/9 \
files/a/2/5/0 \
files/a/2/5/1 \
files/a/2/5/2 \
files/a/2/5/3 \
files/a/2/5/4 \
files/a/2/5/5 \
files/a/2/5/6 \
files/a/2/5/7 \
files/a/2/5/8 \
files/a/2/5/9 \
files/a/2/6/0 \
files/a/2/6/1 \
files/a/2/6/2 \
files/a/2/6/3 \
files/a/2/6/4 \
files/pbr/b_plist_gra.narc \
files/pbr/bag_gra.narc \
files/pbr/batt_bg.narc \
files/pbr/batt_obj.narc \
files/pbr/font.narc \
files/pbr/growtbl.narc \
files/pbr/item_data.narc \
files/pbr/msg.narc \
files/pbr/pbr_file.inc \
files/pbr/personal.narc \
files/pbr/plist_gra.narc \
files/pbr/poke_anm.narc \
files/pbr/poke_icon.narc \
files/pbr/pokeanm.narc \
files/pbr/pokezukan.narc \
files/pbr/pst_gra.narc \
files/pbr/sound_data.sdat \
files/pbr/waza_tbl.narc \
files/pbr/winframe.narc \
files/pbr/poketch.narc \
files/pbr/zukan.narc \
files/dwc/utility.bin
# TODO: file rules
# Some filenames are stripped and replaced with a serial number
# such that the XYZth file is mapped to a/X/Y/Z.
# Temporary names for now
define arc_strip_name
$(2): $(1)
SRC_ARCS += $(1)
DIFF_ARCS += $(2)
.PHONY: $(2)
endef
$(eval $(call arc_strip_name,files/poketool/personal/personal.narc,files/a/0/0/2))
$(eval $(call arc_strip_name,files/poketool/personal/growtbl.narc,files/a/0/0/3))
$(eval $(call arc_strip_name,files/poketool/pokegra/pokegra.narc,files/a/0/0/4))
$(eval $(call arc_strip_name,files/poketool/pokegra/height.narc,files/a/0/0/5))
$(eval $(call arc_strip_name,files/poketool/waza/waza_tbl.narc,files/a/0/1/1))
$(eval $(call arc_strip_name,files/fielddata/script/scr_seq.narc,files/a/0/1/2))
$(eval $(call arc_strip_name,files/graphic/font.narc,files/a/0/1/6))
$(eval $(call arc_strip_name,files/itemtool/itemdata/item_data.narc,files/a/0/1/7))
$(eval $(call arc_strip_name,files/itemtool/itemdata/item_icon.narc,files/a/0/1/8))
$(eval $(call arc_strip_name,files/msgdata/msg.narc,files/a/0/2/7))
$(eval $(call arc_strip_name,files/fielddata/eventdata/zone_event.narc,files/a/0/3/2))
$(eval $(call arc_strip_name,files/poketool/personal/wotbl.narc,files/a/0/3/3))
$(eval $(call arc_strip_name,files/poketool/personal/evo.narc,files/a/0/3/4))
$(eval $(call arc_strip_name,files/fielddata/encountdata/g_enc_data.narc,files/a/0/3/7))
$(eval $(call arc_strip_name,files/fielddata/mapmatrix/map_matrix.narc,files/a/0/4/1))
$(eval $(call arc_strip_name,files/poketool/trainer/trdata.narc,files/a/0/5/5))
$(eval $(call arc_strip_name,files/poketool/trainer/trpoke.narc,files/a/0/5/6))
$(eval $(call arc_strip_name,files/poketool/trmsg/trtbl.narc,files/a/0/5/7))
$(eval $(call arc_strip_name,files/application/zukanlist/zukan_data/zukan_data.narc,files/a/0/7/4))
$(eval $(call arc_strip_name,files/a/0/7/5.$(buildname),files/a/0/7/5))
$(eval $(call arc_strip_name,files/data/mmodel/mmodel.narc,files/a/0/8/1))
$(eval $(call arc_strip_name,files/poketool/pokegra/otherpoke.narc,files/a/1/1/4))
$(eval $(call arc_strip_name,files/poketool/pokegra/height_o.narc,files/a/1/1/7))
$(eval $(call arc_strip_name,files/poketool/trmsg/trtblofs.narc,files/a/1/3/1))
$(eval $(call arc_strip_name,files/application/zukanlist/zukan_data/zukan_enc_$(shortname).narc,files/a/1/3/3))
$(eval $(call arc_strip_name,files/fielddata/encountdata/s_enc_data.narc,files/a/1/3/6))
$(eval $(call arc_strip_name,files/poketool/johtozukan.narc,files/a/1/3/8))
$(eval $(call arc_strip_name,files/data/gs_areawindow.narc,files/a/1/6/3))
$(eval $(call arc_strip_name,files/poketool/personal/performance.narc,files/a/1/6/9))
$(eval $(call arc_strip_name,files/application/annon/puzzle_gra.narc,files/a/1/7/2))
$(eval $(call arc_strip_name,files/application/custom_ball/edit/gs_cb_data.narc,files/a/1/8/5))
$(eval $(call arc_strip_name,files/pbr/dp_height.narc,files/a/1/9/4))
$(eval $(call arc_strip_name,files/pbr/dp_height_o.narc,files/a/1/9/5))
$(eval $(call arc_strip_name,files/resource/eng/pms_aikotoba/pms_aikotoba.narc,files/a/2/1/2))
$(eval $(call arc_strip_name,files/application/zukanlist/zukan_data/zukan_data_gira.narc,files/a/2/1/4))
$(eval $(call arc_strip_name,files/fielddata/sodateya/kowaza_list.narc,files/a/2/2/9))
$(eval $(call arc_strip_name,files/a/2/5/2.$(buildname),files/a/2/5/2))
$(DIFF_ARCS):
cp $< $@
NARCS := $(filter %.narc,$(NITROFS_FILES) $(SRC_ARCS))
NAIXS := $(NARCS:%.narc=%.naix)
CSV2BINFLAGS := -i $(WORK_DIR)/include --naix
ifeq ($(NODEP),)
%.narc: csvdep = $(addprefix $(WORK_DIR)/include/,$(filter-out bool,$(shell cut -d: -f3 $(MANIFEST) | sort -u)))
else
%.narc: csvdep :=
endif
include files/msgdata/msg.mk
include files/fielddata/script/scr_seq.mk
# This rule must come after the above includes
# and serves to enforce build order.
$(SCRIPT_BINS): $(MSGFILE_H)
include files/fielddata/eventdata/zone_event.mk
include files/data/sound/sound_data.mk
include files/data/gs_areawindow.mk
include files/fielddata/encountdata/gs_enc_data.mk
include files/itemtool/itemdata/item_data.mk
include files/poketool/personal/growtbl.mk
include files/poketool/trainer/trainer.mk
include files/fielddata/mapmatrix/map_matrix.mk
include files/resource/eng/pms_aikotoba/pms_aikotoba.mk
include files/data/mmodel/mmodel.mk
include files/fielddata/wazaoshie/waza_oshie.mk
include files/data/mushi/mushi.mk
$(filter-out $(DIFF_ARCS) $(FS_RULE_OVERRIDES),$(NITROFS_FILES)): ;
# This must come after the above includes
include graphics_files_rules.mk
%.narc: NARC_DEPS = $(wildcard $*/*.bin)
%.narc: $(NARC_DEPS)
$(KNARC) -d $* -p $@ -i
%.naix: %.narc ;
.PHONY: filesystem clean-filesystem clean-fs
filesystem: $(NITROFS_FILES)
ifeq ($(COMPARE),1)
$(SHA1SUM) --quiet -c $(WORK_DIR)/$(buildname)/filesystem.sha1
endif
clean-fs: clean-filesystem
clean-filesystem:
$(RM) files/msgdata/msg/*.bin
$(RM) $(DIFF_ARCS) $(NAIXS)
$(RM) -r $(FS_CLEAN_TARGETS)