summaryrefslogtreecommitdiffstats
path: root/mk/depend.mk
blob: 8dad1d91b5a8fc2de62c9dad17f31a20c1b1a9e4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Generate .depend
# Copyright 2008 Roy Marples <roy@marples.name>

CLEANFILES+=	.depend

.depend: ${SRCS}
	rm -f .depend
	${CC} ${CPPFLAGS} -MM ${SRCS} > .depend

depend: .depend


# Nasty hack. depend-.mk is a blank file, depend-gmake.mk has a gmake specific
# command to optionally include .depend.
# Someone should patch gmake to optionally include .depend if it exists.
_INC_DEP=	$(shell if ${MAKE} --version | grep -q "^GNU "; then \
		echo "gmake"; else echo ""; fi)
include ${MK}/depend-${_INC_DEP}.mk