Home | History | Annotate | Line # | Download | only in mk
bsd.dep.mk revision 1.15
      1 #	$NetBSD: bsd.dep.mk,v 1.15 1997/05/07 08:42:18 mycroft Exp $
      2 
      3 .PHONY:		cleandepend
      4 
      5 MKDEP?=		mkdep
      6 
      7 # some of the rules involve .h sources, so remove them from mkdep line
      8 .if !target(depend)
      9 depend: 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)
     38 beforedepend:
     39 .endif
     40 .if !target(afterdepend)
     41 afterdepend:
     42 .endif
     43 .endif
     44 
     45 .if !target(tags)
     46 .if defined(SRCS)
     47 tags: ${SRCS} _SUBDIRUSE
     48 	-cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC:N*.h} | \
     49 	    sed "s;\${.CURDIR}/;;" > tags
     50 .else
     51 tags:
     52 .endif
     53 .endif
     54 
     55 .if defined(SRCS)
     56 cleandir: cleandepend
     57 cleandepend:
     58 	rm -f .depend ${.CURDIR}/tags
     59 .endif
     60