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