From d1501731e4234354c21907a7ee42011d8d7aaf99 Mon Sep 17 00:00:00 2001 From: Greg King Date: Wed, 28 Jun 2017 05:51:46 -0400 Subject: [PATCH 1/2] Added a makefile dependency for the libraries' "extra" files. Some of the files in "libsrc/*/extra/" include other library files. But, the "lib/*.o" files weren't rebuilt when those other files changed. The new dependency rules must be "bootstrapped". You must force a rebuild of all of the extra library object files (it will create the dependency files). Use these commands: rm lib/*.o make lib --- libsrc/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libsrc/Makefile b/libsrc/Makefile index f4aa03101..e106aa239 100644 --- a/libsrc/Makefile +++ b/libsrc/Makefile @@ -196,6 +196,7 @@ DEPS = $(OBJS:.o=.d) EXTRA_SRCPAT = $(SRCDIR)/extra/%.s EXTRA_OBJPAT = ../lib/$(TARGET)-%.o EXTRA_OBJS := $(patsubst $(EXTRA_SRCPAT),$(EXTRA_OBJPAT),$(wildcard $(SRCDIR)/extra/*.s)) +DEPS += $(EXTRA_OBJS:../lib/%.o=../libwrk/$(TARGET)/%.d) ZPOBJ = ../libwrk/$(TARGET)/zeropage.o ifeq ($(TARGET),$(filter $(TARGET),$(EXTZP))) @@ -281,7 +282,7 @@ endef # COMPILE_recipe $(EXTRA_OBJPAT): $(EXTRA_SRCPAT) | ../lib @echo $(TARGET) - $( Date: Thu, 29 Jun 2017 13:34:10 -0400 Subject: [PATCH 2/2] Added the extra dependency file's directory as an order-only prerequisite. The extra dependency files are put into different places than the extra object files' location. Therefore, the rule must pre-make two directories. --- libsrc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsrc/Makefile b/libsrc/Makefile index e106aa239..89d4b7752 100644 --- a/libsrc/Makefile +++ b/libsrc/Makefile @@ -280,7 +280,7 @@ endef # COMPILE_recipe ../libwrk/$(TARGET)/%.o: %.c | ../libwrk/$(TARGET) $(COMPILE_recipe) -$(EXTRA_OBJPAT): $(EXTRA_SRCPAT) | ../lib +$(EXTRA_OBJPAT): $(EXTRA_SRCPAT) | ../libwrk/$(TARGET) ../lib @echo $(TARGET) - $(