bsd.dep.mk revision 1.25 1 # $NetBSD: bsd.dep.mk,v 1.25 1999/02/07 17:29:40 tv Exp $
2
3 .PHONY: cleandepend
4 cleandir distclean: cleandepend
5
6 MKDEP?= mkdep
7
8 # some of the rules involve .h sources, so remove them from mkdep line
9 depend: beforedepend
10 .if defined(SRCS)
11 depend: .depend
12 @true # hack to prevent "make depend" from using implicit rules
13 .NOPATH: .depend
14 .depend: ${SRCS} ${DPSRCS}
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]*:Q} ${CPPFLAGS:Q} ${AINC:Q} $$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]*: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
44 cleandepend:
45 rm -f .depend ${.CURDIR}/tags
46 .else
47 cleandepend:
48 .endif
49 depend: afterdepend
50
51 beforedepend:
52 afterdepend:
53
54 .if !target(tags)
55 .if defined(SRCS)
56 tags: ${SRCS}
57 -cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC:N*.h} | \
58 sed "s;\${.CURDIR}/;;" > tags
59 .else
60 tags:
61 .endif
62 .endif
63