aboutsummaryrefslogtreecommitdiff
path: root/mk/gitignore.mk
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-03-03 13:04:08 +0000
committerRoy Marples <roy@marples.name>2008-03-03 13:04:08 +0000
commit7a8e9d4ddbe121bf2cafb095e9ecf262bc074133 (patch)
tree4bb8ef4bd3b8c4096356db12f7d6f62090ffc002 /mk/gitignore.mk
parent61c476e72d7da6866ea9e3ba6a8d1e7bb295b7aa (diff)
Add a gitignore make target.
Diffstat (limited to 'mk/gitignore.mk')
-rw-r--r--mk/gitignore.mk15
1 files changed, 15 insertions, 0 deletions
diff --git a/mk/gitignore.mk b/mk/gitignore.mk
new file mode 100644
index 00000000..34d3539e
--- /dev/null
+++ b/mk/gitignore.mk
@@ -0,0 +1,15 @@
+# rules to make .gitignore files
+# Copyright 2008 Roy Marples <roy@marples.name>
+
+IGNOREFILES+= ${CLEANFILES}
+
+.gitignore:
+ for obj in ${IGNOREFILES}; do \
+ if ! test -r .gitignore; then \
+ echo "$${obj}" > .gitignore || exit $$?; \
+ elif ! grep -q "^$${obj}$$" .gitignore; then \
+ echo "$${obj}" >> .gitignore || exit $$?; \
+ fi; \
+ done
+
+gitignore: .gitignore