bsd.dep.mk revision 1.18
1#	$NetBSD: bsd.dep.mk,v 1.18 1997/05/08 21:18:59 gwr 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.NOPATH: .depend
14.depend: ${SRCS}
15	@rm -f .depend
16	@files="${.ALLSRC:M*.s} ${.ALLSRC:M*.S}"; \
17	if [ "$$files" != " " ]; then \
18	  echo ${MKDEP} -a ${MKDEPFLAGS} \
19	    ${CFLAGS:M-[ID]*} ${CPPFLAGS} ${AINC} $$files; \
20	  ${MKDEP} -a ${MKDEPFLAGS} \
21	    ${CFLAGS:M-[ID]*} ${CPPFLAGS} ${AINC} $$files; \
22	fi
23	@files="${.ALLSRC:M*.c}"; \
24	if [ "$$files" != "" ]; then \
25	  echo ${MKDEP} -a ${MKDEPFLAGS} \
26	    ${CFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \
27	  ${MKDEP} -a ${MKDEPFLAGS} \
28	    ${CFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \
29	fi
30	@files="${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cxx}"; \
31	if [ "$$files" != "  " ]; then \
32	  echo ${MKDEP} -a ${MKDEPFLAGS} \
33	    ${CXXFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \
34	  ${MKDEP} -a ${MKDEPFLAGS} \
35	    ${CXXFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \
36	fi
37.endif
38depend: afterdepend
39.if !target(beforedepend)
40beforedepend:
41.endif
42.if !target(afterdepend)
43afterdepend:
44.endif
45.endif
46
47.if !target(tags)
48.if defined(SRCS)
49tags: ${SRCS}
50	-cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC:N*.h} | \
51	    sed "s;\${.CURDIR}/;;" > tags
52.else
53tags:
54.endif
55.endif
56
57.if defined(SRCS)
58cleandepend:
59	rm -f .depend ${.CURDIR}/tags
60.else
61cleandepend:
62.endif
63