summaryrefslogtreecommitdiff
path: root/buildlib/copy.mak
diff options
context:
space:
mode:
Diffstat (limited to 'buildlib/copy.mak')
-rw-r--r--buildlib/copy.mak27
1 files changed, 27 insertions, 0 deletions
diff --git a/buildlib/copy.mak b/buildlib/copy.mak
new file mode 100644
index 000000000..973c4853b
--- /dev/null
+++ b/buildlib/copy.mak
@@ -0,0 +1,27 @@
+# -*- make -*-
+
+# This installs arbitary files into a directory
+
+# Input
+# $(SOURCE) - The documents to use
+# $(TO) - The directory to put them in
+# All output is writtin to files in the build/$(TO) directory
+
+# See defaults.mak for information about LOCAL
+
+# Some local definitions
+LOCAL := copy-$(firstword $(SOURCE))
+$(LOCAL)-LIST := $(addprefix $(TO)/,$(SOURCE))
+
+# Install generation hooks
+doc: $($(LOCAL)-LIST)
+veryclean: veryclean/$(LOCAL)
+
+$($(LOCAL)-LIST) : $(TO)/% : %
+ echo Installing $< to $(@D)
+ cp $< $(@D)
+
+# Clean rule
+.PHONY: veryclean/$(LOCAL)
+veryclean/$(LOCAL):
+ -rm -rf $($(@F)-LIST)