summaryrefslogtreecommitdiff
path: root/mk/gitignore.mk
blob: 34d3539e23d02cb16f1c4423b07a3b6900c5d332 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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