21086455 gmake prep doesn't always apply patches
authorNorm Jacobs <Norm.Jacobs@Oracle.COM>
Tue, 26 May 2015 16:02:42 -0500
changeset 4357 417c7cb1b3aa
parent 4356 53082858cced
child 4358 76306610179e
21086455 gmake prep doesn't always apply patches
make-rules/prep-patch.mk
--- a/make-rules/prep-patch.mk	Tue May 26 15:30:34 2015 -0700
+++ b/make-rules/prep-patch.mk	Tue May 26 16:02:42 2015 -0500
@@ -76,15 +76,23 @@
 # We should unpack the source that we patch before we patch it.
 $$(PATCH_STAMPS$(1)::	$$(UNPACK_STAMP$(1)) unpack
 
-$$(SOURCE_DIR$(1))/.patched-%:	$(PATCH_DIR)/%
+# Adding MAKEFILE_PREREQ because gmake seems to evaluate the need to patch
+# before re-unpacking if the Makefile changed.  The various stamps are
+# removed as part of the unpacking process, and it doesn't appear to
+# re-evaluate the need for patching.  If we ever move the stamps to the build
+# directory, we may not need the dependency any more.
+$$(SOURCE_DIR$(1))/.patched-%:	$(PATCH_DIR)/% $(MAKEFILE_PREREQ)
 	$(GPATCH) -d $$(@D) $$(GPATCH_FLAGS) < $$<
 	$(TOUCH) $$(@)
 
-$$(SOURCE_DIR$(1))/.patched-%:	$(PARFAIT_PATCH_DIR)/%
+$$(SOURCE_DIR$(1))/.patched-%:	$(PARFAIT_PATCH_DIR)/% $(MAKEFILE_PREREQ)
 	$(GPATCH) -d $$(@D) $$(GPATCH_FLAGS) < $$<
 	$(TOUCH) $$(@)
 
-patch::	$$(PATCH_STAMPS$(1))
+$$(SOURCE_DIR$(1))/.patched:	$$(PATCH_STAMPS$(1))
+	$(TOUCH) $$(@)
+
+patch::	$$(SOURCE_DIR$(1))/.patched
 
 REQUIRED_PACKAGES += text/gnu-patch