make-rules/prep-patch.mk
changeset 4254 f1fca132ea31
parent 4252 891a844655c4
child 4357 417c7cb1b3aa
--- a/make-rules/prep-patch.mk	Tue May 05 06:49:34 2015 -0500
+++ b/make-rules/prep-patch.mk	Tue May 05 06:29:57 2015 -0500
@@ -47,7 +47,9 @@
 
 PATCH_DIR ?=		patches
 # patches specific to parfait builds.
+ifeq   ($(strip $(PARFAIT_BUILD)),yes)
 PARFAIT_PATCH_DIR =	parfait
+endif
 
 PATCHES =	$(shell find $(PATCH_DIR) $(PARFAIT_PATCH_DIR) -type f \
 			 -name '$(PATCH_PATTERN)' 2>/dev/null | \
@@ -67,6 +69,9 @@
 
 ifneq ($$(PATCHES$(1)),)
 PATCH_STAMPS$(1) += $$(PATCHES$(1):$(PATCH_DIR)/%=$$(SOURCE_DIR$(1))/.patched-%)
+ifeq   ($(strip $(PARFAIT_BUILD)),yes)
+PATCH_STAMPS$(1) += $$(PATCHES$(1):$(PARFAIT_PATCH_DIR)/%=$$(SOURCE_DIR$(1))/.patched-%)
+endif 
 
 # We should unpack the source that we patch before we patch it.
 $$(PATCH_STAMPS$(1)::	$$(UNPACK_STAMP$(1)) unpack
@@ -75,6 +80,10 @@
 	$(GPATCH) -d $$(@D) $$(GPATCH_FLAGS) < $$<
 	$(TOUCH) $$(@)
 
+$$(SOURCE_DIR$(1))/.patched-%:	$(PARFAIT_PATCH_DIR)/%
+	$(GPATCH) -d $$(@D) $$(GPATCH_FLAGS) < $$<
+	$(TOUCH) $$(@)
+
 patch::	$$(PATCH_STAMPS$(1))
 
 REQUIRED_PACKAGES += text/gnu-patch