bsd.dep.mk revision 1.20 1 # $NetBSD: bsd.dep.mk,v 1.20 1997/05/09 13:25:46 mycroft Exp $
2
3 .PHONY: cleandepend
4 cleandir: 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 .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 ${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 cleandepend:
37 rm -f .depend ${.CURDIR}/tags
38 .else
39 cleandepend:
40 .endif
41 depend: afterdepend
42
43 beforedepend:
44 afterdepend:
45
46 .if !target(tags)
47 .if defined(SRCS)
48 tags: ${SRCS}
49 -cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC:N*.h} | \
50 sed "s;\${.CURDIR}/;;" > tags
51 .else
52 tags:
53 .endif
54 .endif
55