xref: /freebsd/share/mk/bsd.dep.mk (revision 17ee9d00bc1ae1e598c38f25826f861e4bc6c3ce)
1#	$Id: bsd.dep.mk,v 1.1 1994/08/04 21:10:07 wollman Exp $
2
3# some of the rules involve .h sources, so remove them from mkdep line
4.if !target(depend)
5depend: beforedepend .depend afterdepend ${_DEPSUBDIR}
6.if defined(SRCS)
7.depend: ${SRCS}
8	rm -f .depend
9	files="${.ALLSRC:M*.[sS]}"; \
10	if [ "$$files" != "" ]; then \
11	  mkdep -a ${MKDEP} ${CFLAGS:M-[ID]*} ${AINC} $$files; \
12	fi
13	files="${.ALLSRC:M*.c}"; \
14	if [ "$$files" != "" ]; then \
15	  mkdep -a ${MKDEP} ${CFLAGS:M-[ID]*} $$files; \
16	fi
17	files="${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cxx}"; \
18	if [ "$$files" != "  " ]; then \
19	  mkdep -a ${MKDEP} ${CXXFLAGS:M-nostd*} ${CXXFLAGS:M-[ID]*} $$files; \
20	fi
21.else
22.depend: ${_DEPSUBDIR}
23.endif
24.if !target(beforedepend)
25beforedepend:
26.endif
27.if !target(afterdepend)
28afterdepend:
29.endif
30.endif
31
32.if !target(tags)
33.if defined(SRCS)
34tags: ${SRCS}
35	-cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC:N*.h} | \
36	    sed "s;\${.CURDIR}/;;" > tags
37.else
38tags:
39.endif
40.endif
41
42.if defined(SRCS)
43clean:
44cleandir: cleandepend
45cleandepend:
46	rm -f .depend ${.CURDIR}/tags
47.endif
48