Home | History | Annotate | Line # | Download | only in mk
bsd.dep.mk revision 1.17
      1 #	$NetBSD: bsd.dep.mk,v 1.17 1997/05/07 17:06:16 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 .if !target(depend)
     10 depend: beforedepend
     11 .if defined(SRCS)
     12 depend: .depend
     13 .depend: ${SRCS}
     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 .endif
     37 depend: afterdepend
     38 .if !target(beforedepend)
     39 beforedepend:
     40 .endif
     41 .if !target(afterdepend)
     42 afterdepend:
     43 .endif
     44 .endif
     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 
     56 .if defined(SRCS)
     57 cleandepend:
     58 	rm -f .depend ${.CURDIR}/tags
     59 .else
     60 cleandepend:
     61 .endif
     62