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