bsd.dep.mk revision 1.16
1#	$NetBSD: bsd.dep.mk,v 1.16 1997/05/07 16:44:04 mycroft Exp $
2
3.PHONY:		cleandepend
4cleandir:	cleandepend
5
6MKDEP?=		mkdep
7
8# some of the rules involve .h sources, so remove them from mkdep line
9.if !target(depend)
10depend: beforedepend
11.if defined(SRCS)
12depend: .depend
13.depend: ${SRCS}
14	@rm -f .depend
15	@files="${.ALLSRC:M*.s} ${.ALLSRC:M*.S}"; \
16	if [ "$$files" != " " ]; then \
17	  echo ${MKDEP} -a ${MKDEPFLAGS} \
18	    ${CFLAGS:M-[ID]*} ${CPPFLAGS} ${AINC} $$files; \
19	  ${MKDEP} -a ${MKDEPFLAGS} \
20	    ${CFLAGS:M-[ID]*} ${CPPFLAGS} ${AINC} $$files; \
21	fi
22	@files="${.ALLSRC:M*.c}"; \
23	if [ "$$files" != "" ]; then \
24	  echo ${MKDEP} -a ${MKDEPFLAGS} \
25	    ${CFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \
26	  ${MKDEP} -a ${MKDEPFLAGS} \
27	    ${CFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \
28	fi
29	@files="${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cxx}"; \
30	if [ "$$files" != "  " ]; then \
31	  echo ${MKDEP} -a ${MKDEPFLAGS} \
32	    ${CXXFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \
33	  ${MKDEP} -a ${MKDEPFLAGS} \
34	    ${CXXFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \
35	fi
36.endif
37depend: _SUBDIRUSE afterdepend
38.if !target(beforedepend)
39beforedepend:
40.endif
41.if !target(afterdepend)
42afterdepend:
43.endif
44.endif
45
46.if !target(tags)
47.if defined(SRCS)
48tags: ${SRCS} _SUBDIRUSE
49	-cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC:N*.h} | \
50	    sed "s;\${.CURDIR}/;;" > tags
51.else
52tags:
53.endif
54.endif
55
56.if defined(SRCS)
57cleandepend:
58	rm -f .depend ${.CURDIR}/tags
59.else
60cleandepend:
61.endif
62