summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2020-06-06 09:56:15 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2020-06-06 09:56:15 -0400
commit677805498cf651739ac8355d2f388cf63ae0a5fd (patch)
treed68d5af77ed7918290148fdd115a900dc687403d /Makefile
parent60c9307cae1c4e5ca18c90181fe0a227db95562a (diff)
Set tracking on filesystem; narc on the narcs
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 19 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 523a0936..e14c9e89 100644
--- a/Makefile
+++ b/Makefile
@@ -172,6 +172,8 @@ MWCCARM = tools/mwccarm/$(MWCCVERSION)/mwccarm.exe
# only dependency should be MWCCARM.
MWLDARM = tools/mwccarm/$(MWCCVERSION)/mwldarm.exe
MWASMARM = tools/mwccarm/$(MWCCVERSION)/mwasmarm.exe
+NARCCOMP = tools/narccomp/narccomp$(EXE)
+SCANINC = tools/scaninc/scaninc$(EXE)
AS = $(WINE) $(MWASMARM)
CC = $(WINE) $(MWCCARM)
@@ -215,6 +217,9 @@ else
NODEP := 1
endif
+.SECONDARY:
+.DELETE_ON_ERROR:
+.SECONDEXPANSION:
.PHONY: all clean mostlyclean tidy tools $(TOOLDIRS) patch_mwasmarm arm9 arm7
MAKEFLAGS += --no-print-directory
@@ -252,10 +257,16 @@ patch_mwasmarm:
ALL_DIRS := $(BUILD_DIR) $(addprefix $(BUILD_DIR)/,$(SRC_DIRS) $(ASM_DIRS))
-$(BUILD_DIR)/%.o: %.c
+ifeq (,$(NODEP))
+$(BUILD_DIR)/%.o: dep = $(shell $(SCANINC) -I include -I include-mw -I arm9/lib/include $(filter $*.c,$(C_FILES)) $(filter $*.cpp,$(CXX_FILES)) $(filter $*.s,$(S_FILES)))
+else
+$(BUILD_DIR)/%.o: dep :=
+endif
+
+$(BUILD_DIR)/%.o: %.c $$(dep)
$(CC) -c $(CFLAGS) -o $@ $<
-$(BUILD_DIR)/%.o: %.s
+$(BUILD_DIR)/%.o: %.s $$(dep)
$(AS) $(ASFLAGS) $< -o $@
$(BUILD_DIR)/$(LD_SCRIPT): $(LD_SCRIPT)
@@ -297,6 +308,12 @@ DUMMY != mkdir -p $(ALL_DIRS)
%.png: ;
%.pal: ;
+%.narc: members = $(shell find $(@D)/$*/*)
+%.narc: $$(members)
+ $(NARCCOMP) -o $@ -p 255 $^
+
+files/poketool/personal/pms.narc: ;
+
$(BUILD_DIR)/pokediamond_bnr.bin: pokediamond.bsf graphics/icon.4bpp graphics/icon.gbapal
$(MAKEBANNER) $< $@