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