From 7d99274b5e42416ec3404e0c4fea33778c455f50 Mon Sep 17 00:00:00 2001 From: Alex Bates <16batesa@gmail.com> Date: Tue, 22 Dec 2020 16:31:31 +0000 Subject: [PATCH] again --- Makefile | 40 +++++++++++++++++++++------------------- sources.mk | 2 +- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index 7220cdb479..20483ff4d1 100644 --- a/Makefile +++ b/Makefile @@ -27,23 +27,6 @@ override WATCH_INCLUDES=0 endif -### Sources ### - -include sources.mk - -ifeq ($(PERMUTER),1) -override OBJECTS:=$(filter %.c.o, $(OBJECTS)) -endif - -%.d: ; - -ifeq ($(WATCH_INCLUDES),1) --include $(foreach obj, $(OBJECTS), $(obj).mk) -endif - -NPC_DIRS := $(foreach npc, $(NPC_SPRITES), sprite/npc/$(npc)) - - ### Output ### BUILD_DIR := build @@ -54,7 +37,7 @@ LD_MAP := $(BUILD_DIR)/$(TARGET).map ASSETS_BIN := $(BUILD_DIR)/bin/assets/assets.bin MSG_BIN := $(BUILD_DIR)/msg.bin NPC_BIN := $(BUILD_DIR)/sprite/npc.bin -GENERATED_HEADERS := include/ld_addrs.h $(foreach dir, $(NPC_DIRS), include/$(dir).h) + ### Tools ### @@ -114,10 +97,29 @@ CPPFLAGS += -DNON_MATCHING endif +### Sources ### + +include sources.mk + +ifeq ($(PERMUTER),1) +override OBJECTS:=$(filter %.c.o, $(OBJECTS)) +endif + +%.d: ; + +ifeq ($(WATCH_INCLUDES),1) +-include $(foreach obj, $(OBJECTS), $(obj).mk) +endif + +NPC_DIRS := $(foreach npc, $(NPC_SPRITES), sprite/npc/$(npc)) + +GENERATED_HEADERS := include/ld_addrs.h $(foreach dir, $(NPC_DIRS), include/$(dir).h) + + ### Targets ### clean: - rm -rf $(BUILD_DIR) bin msg img sprite .splat_cache + rm -rf $(BUILD_DIR) bin msg img sprite .splat_cache $(LD_SCRIPT) clean-code: rm -rf $(BUILD_DIR)/src diff --git a/sources.mk b/sources.mk index b97c0445f5..cd1c1ca871 100644 --- a/sources.mk +++ b/sources.mk @@ -1,4 +1,4 @@ -OBJECTS := $(subst BUILD_DIR, $(BUILD_DIR), $(shell grep -E 'BUILD_DIR.+\.o' papermario.ld -o)) +OBJECTS = $(subst BUILD_DIR, $(BUILD_DIR), $(shell grep -E 'BUILD_DIR.+\.o' papermario.ld -o)) DSL_C_FILES := $(shell grep -lrF "SCRIPT" src)