summaryrefslogtreecommitdiff
path: root/mk/gitignore.mk
diff options
context:
space:
mode:
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 0000000..34d3539
--- /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