Home | History | Annotate | Line # | Download | only in mk
bsd.dep.mk revision 1.50
      1  1.50      matt #	$NetBSD: bsd.dep.mk,v 1.50 2003/07/28 21:33:57 matt 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 __acpp_flags=	-traditional-cpp
     19  1.33        tv .NOPATH:	.depend
     20  1.48     lukem 
     21  1.49     lukem DEPENDSRCS.src=	${SRCS:M*.c}	${DPSRCS:M*.c}		\
     22  1.49     lukem 		${SRCS:M*.m}	${DPSRCS:M*.m}		\
     23  1.49     lukem 		${SRCS:M*.[sS]}	${DPSRCS:M*.[sS]}	\
     24  1.49     lukem 		${SRCS:M*.C}	${DPSRCS:M*.C}		\
     25  1.49     lukem 		${SRCS:M*.cc}	${DPSRCS:M*.cc}		\
     26  1.49     lukem 		${SRCS:M*.cpp}	${DPSRCS:M*.cpp}	\
     27  1.49     lukem 		${SRCS:M*.cxx}	${DPSRCS:M*.cxx}
     28  1.49     lukem DEPENDSRCS.dep=	${DEPENDSRCS.src:C/(.*)/\1.dep/g:S/^.dep$//}
     29  1.49     lukem DEPENDSRCS=	.depend ${DEPENDSRCS.dep}
     30  1.48     lukem 
     31  1.49     lukem .depend: ${SRCS} ${DPSRCS} ${DEPENDSRCS.dep}
     32  1.39  christos 	@rm -f .depend
     33  1.49     lukem 	cat ${DEPENDSRCS.dep} > .depend
     34  1.39  christos 
     35  1.50      matt .SUFFIXES: .c .c.dep .m .m.dep .s .s.dep .S .S.dep
     36  1.50      matt .SUFFIXES: .C .C.dep .cc .cc.dep .cpp .cpp.dep .cxx .cxx.dep
     37  1.49     lukem 
     38  1.49     lukem .c.c.dep:
     39  1.48     lukem 	${MKDEP} -a -f ${.TARGET} ${MKDEPFLAGS} ${CFLAGS:M-[ID]*} ${CPPFLAGS} \
     40  1.49     lukem 	    ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
     41  1.39  christos 
     42  1.49     lukem .m.m.dep:
     43  1.48     lukem 	${MKDEP} -a -f ${.TARGET} ${MKDEPFLAGS} ${OBJCFLAGS:M-[ID]*} \
     44  1.49     lukem 	    ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
     45  1.39  christos 
     46  1.49     lukem .s.s.dep .S.S.dep:
     47  1.48     lukem 	${MKDEP} -a -f ${.TARGET} ${MKDEPFLAGS} ${AFLAGS:M-[ID]*} ${CPPFLAGS} \
     48  1.49     lukem 	    ${CPPFLAGS.${.IMPSRC:T}} ${__acpp_flags} ${AINC} ${.IMPSRC}
     49  1.39  christos 
     50  1.49     lukem .C.C.dep .cc.cc.dep .cpp.cpp.dep .cxx.cxx.dep:
     51  1.48     lukem 	${MKDEP} -a -f ${.TARGET} ${MKDEPFLAGS} ${CXXFLAGS:M-[ID]*} \
     52  1.47       mrg 	    ${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEMXX} \
     53  1.48     lukem 	    ${DESTDIR}/usr/include/g++} \
     54  1.49     lukem 	    ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
     55  1.39  christos 
     56  1.33        tv .endif # defined(SRCS)
     57  1.33        tv 
     58  1.33        tv ##### Clean rules
     59  1.19   mycroft cleandepend:
     60  1.33        tv .if defined(SRCS)
     61  1.49     lukem 	rm -f ${DEPENDSRCS} ${.CURDIR}/tags ${CLEANDEPEND}
     62   1.3   mycroft .endif
     63   1.2   mycroft 
     64  1.33        tv ##### Custom rules
     65   1.2   mycroft .if !target(tags)
     66  1.33        tv tags: ${SRCS}
     67   1.4   mycroft .if defined(SRCS)
     68   1.2   mycroft 	-cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC:N*.h} | \
     69   1.2   mycroft 	    sed "s;\${.CURDIR}/;;" > tags
     70   1.4   mycroft .endif
     71   1.4   mycroft .endif
     72