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