Hack to generate patch rules for make < 3.80
authorMark Huang <mlhuang@cs.princeton.edu>
Fri, 9 Apr 2004 19:24:00 +0000 (19:24 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Fri, 9 Apr 2004 19:24:00 +0000 (19:24 +0000)
Patchrules [new file with mode: 0644]

diff --git a/Patchrules b/Patchrules
new file mode 100644 (file)
index 0000000..29c17f0
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh
+#
+# Hack to generate patch rules for make < 3.80
+#
+# Copyright (c) 2003  The Trustees of Princeton University (Trustees).
+# 
+# $Id$
+#
+
+while read PatchSet n ; do
+
+[ "$PatchSet" != "PatchSet" ] && continue;
+
+cat <<EOF
+# In case the spec file did not explicitly list the PatchSet
+ifeq (\$(origin Patch${n}),undefined)
+Patch${n} := \$(Source0)-${n}.patch.bz2
+endif
+
+# Get rid of URL
+Patch${n} := \$(notdir \$(Patch${n}))
+
+# Add patch to the list of sources
+SOURCES += SOURCES/\$(Patch${n})
+
+# Generate uncompressed patch
+SOURCES/\$(patsubst %.gz,%,\$(patsubst %.bz2,%,\$(Patch${n}))):
+       mkdir -p SOURCES
+       cvsps --cvs-direct --root \$(CVSROOT) -g -s ${n} \$(MODULE) > \$@
+EOF
+
+done