Home | History | Annotate | Line # | Download | only in mk
bsd.dep.mk revision 1.35
      1  1.35   thorpej #	$NetBSD: bsd.dep.mk,v 1.35 2002/06/04 21:22:54 thorpej Exp $
      2  1.13       gwr 
      3  1.33        tv ##### Basic targets
      4  1.15   mycroft .PHONY:		cleandepend
      5  1.32        tv cleandir:	cleandepend
      6  1.33        tv realdepend:	beforedepend .depend afterdepend
      7  1.33        tv .ORDER:		beforedepend .depend afterdepend
      8  1.14   mycroft 
      9  1.33        tv beforedepend .depend afterdepend: # ensure existence
     10  1.33        tv 
     11  1.33        tv ##### Default values
     12  1.14   mycroft MKDEP?=		mkdep
     13   1.1   mycroft 
     14  1.33        tv ##### Build rules
     15   1.1   mycroft # some of the rules involve .h sources, so remove them from mkdep line
     16  1.33        tv 
     17   1.1   mycroft .if defined(SRCS)
     18  1.35   thorpej .if defined(HAVE_GCC3)
     19  1.35   thorpej __acpp_flags=
     20  1.35   thorpej .else
     21  1.35   thorpej __acpp_flags=	-traditional-cpp
     22  1.35   thorpej .endif
     23  1.33        tv .NOPATH:	.depend
     24  1.20   mycroft .depend: ${SRCS} ${DPSRCS}
     25  1.12  christos 	@rm -f .depend
     26  1.12  christos 	@files="${.ALLSRC:M*.s} ${.ALLSRC:M*.S}"; \
     27   1.6       cgd 	if [ "$$files" != " " ]; then \
     28  1.13       gwr 	  echo ${MKDEP} -a ${MKDEPFLAGS} \
     29  1.35   thorpej 	    ${AFLAGS:M-[ID]*:Q} ${CPPFLAGS:Q} ${__acpp_flags} ${AINC:Q} \
     30  1.28   minoura 	    $$files; \
     31  1.13       gwr 	  ${MKDEP} -a ${MKDEPFLAGS} \
     32  1.35   thorpej 	    ${AFLAGS:M-[ID]*} ${CPPFLAGS} ${__acpp_flags} ${AINC} $$files; \
     33   1.5   mycroft 	fi
     34  1.12  christos 	@files="${.ALLSRC:M*.c}"; \
     35   1.1   mycroft 	if [ "$$files" != "" ]; then \
     36  1.13       gwr 	  echo ${MKDEP} -a ${MKDEPFLAGS} \
     37  1.25        tv 	    ${CFLAGS:M-[ID]*:Q} ${CPPFLAGS:Q} $$files; \
     38  1.13       gwr 	  ${MKDEP} -a ${MKDEPFLAGS} \
     39  1.13       gwr 	    ${CFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \
     40  1.22        tv 	fi
     41  1.22        tv 	@files="${.ALLSRC:M*.m}"; \
     42  1.23        tv 	if [ "$$files" != "" ]; then \
     43  1.22        tv 	  echo ${MKDEP} -a ${MKDEPFLAGS} \
     44  1.25        tv 	    ${OBJCFLAGS:M-[ID]*:Q} ${CPPFLAGS:Q} $$files; \
     45  1.22        tv 	  ${MKDEP} -a ${MKDEPFLAGS} \
     46  1.22        tv 	    ${OBJCFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \
     47   1.1   mycroft 	fi
     48  1.12  christos 	@files="${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cxx}"; \
     49   1.1   mycroft 	if [ "$$files" != "  " ]; then \
     50  1.13       gwr 	  echo ${MKDEP} -a ${MKDEPFLAGS} \
     51  1.25        tv 	    ${CXXFLAGS:M-[ID]*:Q} ${CPPFLAGS:Q} $$files; \
     52  1.13       gwr 	  ${MKDEP} -a ${MKDEPFLAGS} \
     53  1.34        tv 	    ${CXXFLAGS:M-[ID]*} ${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include/g++} ${CPPFLAGS} $$files; \
     54   1.1   mycroft 	fi
     55  1.33        tv .endif # defined(SRCS)
     56  1.33        tv 
     57  1.33        tv ##### Clean rules
     58  1.19   mycroft cleandepend:
     59  1.33        tv .if defined(SRCS)
     60  1.27  sommerfe 	rm -f .depend ${.CURDIR}/tags ${CLEANDEPEND}
     61   1.3   mycroft .endif
     62   1.2   mycroft 
     63  1.33        tv ##### Custom rules
     64   1.2   mycroft .if !target(tags)
     65  1.33        tv tags: ${SRCS}
     66   1.4   mycroft .if defined(SRCS)
     67   1.2   mycroft 	-cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC:N*.h} | \
     68   1.2   mycroft 	    sed "s;\${.CURDIR}/;;" > tags
     69   1.4   mycroft .endif
     70   1.4   mycroft .endif
     71