2003-08-01 04:55:43 +04:00
|
|
|
# $NetBSD: bsd.dep.mk,v 1.54 2003/08/01 00:55:43 lukem Exp $
|
1997-03-08 02:10:18 +03:00
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
##### Basic targets
|
1997-05-07 12:42:18 +04:00
|
|
|
.PHONY: cleandepend
|
2001-08-14 11:02:13 +04:00
|
|
|
cleandir: cleandepend
|
2001-11-02 08:21:47 +03:00
|
|
|
realdepend: beforedepend .depend afterdepend
|
|
|
|
.ORDER: beforedepend .depend afterdepend
|
1997-05-07 00:54:31 +04:00
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
beforedepend .depend afterdepend: # ensure existence
|
|
|
|
|
|
|
|
##### Default values
|
1997-05-07 00:54:31 +04:00
|
|
|
MKDEP?= mkdep
|
1993-08-15 23:37:04 +04:00
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
##### Build rules
|
1993-08-15 23:37:04 +04:00
|
|
|
# some of the rules involve .h sources, so remove them from mkdep line
|
2001-11-02 08:21:47 +03:00
|
|
|
|
2003-07-31 17:47:32 +04:00
|
|
|
.if defined(SRCS) # {
|
2002-06-05 01:14:59 +04:00
|
|
|
__acpp_flags= -traditional-cpp
|
2003-05-08 17:34:07 +04:00
|
|
|
|
2003-07-28 19:07:16 +04:00
|
|
|
DEPENDSRCS.src= ${SRCS:M*.c} ${DPSRCS:M*.c} \
|
|
|
|
${SRCS:M*.m} ${DPSRCS:M*.m} \
|
|
|
|
${SRCS:M*.[sS]} ${DPSRCS:M*.[sS]} \
|
|
|
|
${SRCS:M*.C} ${DPSRCS:M*.C} \
|
|
|
|
${SRCS:M*.cc} ${DPSRCS:M*.cc} \
|
|
|
|
${SRCS:M*.cpp} ${DPSRCS:M*.cpp} \
|
|
|
|
${SRCS:M*.cxx} ${DPSRCS:M*.cxx}
|
2003-07-31 17:47:32 +04:00
|
|
|
DEPENDSRCS.d= ${DEPENDSRCS.src:R:S/$/.d/g}
|
|
|
|
DEPENDSRCS= .depend ${DEPENDSRCS.d}
|
|
|
|
|
2003-08-01 04:55:43 +04:00
|
|
|
${DEPENDSRCS.d}: ${DPSRCS}
|
2003-05-08 17:34:07 +04:00
|
|
|
|
2003-07-31 17:47:32 +04:00
|
|
|
.depend: ${DEPENDSRCS.d}
|
2003-05-08 17:34:07 +04:00
|
|
|
@rm -f .depend
|
2003-07-31 17:47:32 +04:00
|
|
|
cat ${DEPENDSRCS.d} > .depend
|
2003-05-08 17:34:07 +04:00
|
|
|
|
2003-07-29 11:56:23 +04:00
|
|
|
.NOPATH: ${DEPENDSRCS}
|
|
|
|
|
2003-07-29 03:57:24 +04:00
|
|
|
.SUFFIXES: .d .c .m .s .S .C .cc .cpp .cxx
|
2003-07-28 19:07:16 +04:00
|
|
|
|
2003-07-29 03:57:24 +04:00
|
|
|
.c.d:
|
|
|
|
${MKDEP} -f ${.TARGET} ${MKDEPFLAGS} ${CFLAGS:M-[ID]*} ${CPPFLAGS} \
|
2003-07-28 19:07:16 +04:00
|
|
|
${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
|
2003-05-08 17:34:07 +04:00
|
|
|
|
2003-07-29 03:57:24 +04:00
|
|
|
.m.d:
|
|
|
|
${MKDEP} -f ${.TARGET} ${MKDEPFLAGS} ${OBJCFLAGS:M-[ID]*} \
|
2003-07-28 19:07:16 +04:00
|
|
|
${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
|
2003-05-08 17:34:07 +04:00
|
|
|
|
2003-07-29 03:57:24 +04:00
|
|
|
.s.d .S.d:
|
|
|
|
${MKDEP} -f ${.TARGET} ${MKDEPFLAGS} ${AFLAGS:M-[ID]*} ${CPPFLAGS} \
|
2003-07-28 19:07:16 +04:00
|
|
|
${CPPFLAGS.${.IMPSRC:T}} ${__acpp_flags} ${AINC} ${.IMPSRC}
|
2003-05-08 17:34:07 +04:00
|
|
|
|
2003-07-29 03:57:24 +04:00
|
|
|
.C.d .cc.d .cpp.d .cxx.d:
|
|
|
|
${MKDEP} -f ${.TARGET} ${MKDEPFLAGS} ${CXXFLAGS:M-[ID]*} \
|
2003-07-27 18:49:22 +04:00
|
|
|
${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEMXX} \
|
2003-07-28 12:59:52 +04:00
|
|
|
${DESTDIR}/usr/include/g++} \
|
2003-07-28 19:07:16 +04:00
|
|
|
${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
|
2003-05-08 17:34:07 +04:00
|
|
|
|
2003-07-31 17:47:32 +04:00
|
|
|
.endif # defined(SRCS) # }
|
2001-11-02 08:21:47 +03:00
|
|
|
|
|
|
|
##### Clean rules
|
1997-05-09 11:56:00 +04:00
|
|
|
cleandepend:
|
2001-11-02 08:21:47 +03:00
|
|
|
.if defined(SRCS)
|
2003-07-28 19:07:16 +04:00
|
|
|
rm -f ${DEPENDSRCS} ${.CURDIR}/tags ${CLEANDEPEND}
|
1993-08-15 23:37:04 +04:00
|
|
|
.endif
|
1993-08-16 00:42:39 +04:00
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
##### Custom rules
|
1993-08-16 00:42:39 +04:00
|
|
|
.if !target(tags)
|
1997-05-07 21:06:16 +04:00
|
|
|
tags: ${SRCS}
|
2001-11-02 08:21:47 +03:00
|
|
|
.if defined(SRCS)
|
1993-08-16 00:42:39 +04:00
|
|
|
-cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC:N*.h} | \
|
|
|
|
sed "s;\${.CURDIR}/;;" > tags
|
1993-08-16 01:14:45 +04:00
|
|
|
.endif
|
1993-08-16 00:42:39 +04:00
|
|
|
.endif
|