summaryrefslogtreecommitdiff
path: root/filesystem.mk
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2020-08-31 13:16:24 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2020-08-31 13:16:24 -0400
commitc75a270a82fdf7f92d118c61237fea034cbc17f3 (patch)
tree691a074cd6e8e3b43d61ec9f370c6ca0518590fc /filesystem.mk
parent0a880566f5889cdeb6fa3f96f5916c39dbb16b38 (diff)
Bump inja; trdata and trpoke to json
Diffstat (limited to 'filesystem.mk')
-rw-r--r--filesystem.mk15
1 files changed, 13 insertions, 2 deletions
diff --git a/filesystem.mk b/filesystem.mk
index 7471d644..33d82c23 100644
--- a/filesystem.mk
+++ b/filesystem.mk
@@ -290,16 +290,27 @@ O2NARC_TARGETS := \
files/poketool/waza/waza_tbl.narc \
files/itemtool/itemdata/item_data.narc \
files/itemtool/itemdata/nuts_data.narc \
+ files/poketool/trainer/trdata.narc \
+
+ALL_O2NARC_TARGETS := $(O2NARC_TARGETS) \
+ files/poketool/trainer/trpoke.narc
files/poketool/personal/pms.narc: O2NARCFLAGS = -f
files/itemtool/itemdata/item_data.narc: O2NARCFLAGS = -p 0xFF
ifeq (,$(NODEP))
-$(O2NARC_TARGETS): dep = $(shell $(SCANINC) -I include -I include-mw -I arm9/lib/include $(patsubst %.narc,%.json.txt,$@))
+$(ALL_O2NARC_TARGETS): dep = $(shell $(SCANINC) -I include -I include-mw -I arm9/lib/include $(patsubst %.narc,%.json.txt,$@))
else
-$(O2NARC_TARGETS): dep :=
+$(ALL_O2NARC_TARGETS): dep :=
endif
+## This specific target shares its source JSON with trdata.narc
+files/poketool/trainer/trpoke.narc: %/trpoke.narc: %/trdata.json %/trpoke.json.txt $$(dep)
+ $(JSONPROC) $< $(word 2,$^) $*/trpoke.c
+ $(CC) $(CFLAGS) -c -o $*/trpoke.o $*/trpoke.c
+ $(O2NARC) $(O2NARCFLAGS) $*/trpoke.o $@
+ @$(RM) $*/trpoke.o $*/trpoke.c
+
$(O2NARC_TARGETS): %.narc: %.json %.json.txt $$(dep)
$(JSONPROC) $*.json $*.json.txt $*.c
$(CC) $(CFLAGS) -c -o $*.o $*.c