2003-06-11 22:05:40 +04:00
|
|
|
# $NetBSD: bsd.dep.mk,v 1.45 2003/06/11 18:05:40 wiz 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
|
|
|
|
1993-08-15 23:37:04 +04:00
|
|
|
.if defined(SRCS)
|
2002-06-05 01:14:59 +04:00
|
|
|
__acpp_flags= -traditional-cpp
|
2001-11-02 08:21:47 +03:00
|
|
|
.NOPATH: .depend
|
2003-05-09 00:39:00 +04:00
|
|
|
.if empty(HOST_CYGWIN)
|
1997-05-09 17:25:46 +04:00
|
|
|
.depend: ${SRCS} ${DPSRCS}
|
1995-09-27 04:15:09 +03:00
|
|
|
@rm -f .depend
|
|
|
|
@files="${.ALLSRC:M*.s} ${.ALLSRC:M*.S}"; \
|
1993-12-05 05:42:42 +03:00
|
|
|
if [ "$$files" != " " ]; then \
|
1997-03-08 02:10:18 +03:00
|
|
|
echo ${MKDEP} -a ${MKDEPFLAGS} \
|
2002-11-11 00:26:44 +03:00
|
|
|
${AFLAGS:M-[ID]*:Q} ${CPPFLAGS:Q} ${__acpp_flags} ${AINC:Q} \
|
1999-11-16 11:18:34 +03:00
|
|
|
$$files; \
|
1997-03-08 02:10:18 +03:00
|
|
|
${MKDEP} -a ${MKDEPFLAGS} \
|
2002-11-11 00:26:44 +03:00
|
|
|
${AFLAGS:M-[ID]*} ${CPPFLAGS} ${__acpp_flags} ${AINC} $$files; \
|
1993-09-05 21:46:15 +04:00
|
|
|
fi
|
1995-09-27 04:15:09 +03:00
|
|
|
@files="${.ALLSRC:M*.c}"; \
|
1993-08-15 23:37:04 +04:00
|
|
|
if [ "$$files" != "" ]; then \
|
1997-03-08 02:10:18 +03:00
|
|
|
echo ${MKDEP} -a ${MKDEPFLAGS} \
|
1999-02-07 20:29:40 +03:00
|
|
|
${CFLAGS:M-[ID]*:Q} ${CPPFLAGS:Q} $$files; \
|
1997-03-08 02:10:18 +03:00
|
|
|
${MKDEP} -a ${MKDEPFLAGS} \
|
|
|
|
${CFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \
|
1993-08-15 23:37:04 +04:00
|
|
|
fi
|
1998-08-18 21:31:21 +04:00
|
|
|
@files="${.ALLSRC:M*.m}"; \
|
1998-08-18 23:12:42 +04:00
|
|
|
if [ "$$files" != "" ]; then \
|
1998-08-18 21:31:21 +04:00
|
|
|
echo ${MKDEP} -a ${MKDEPFLAGS} \
|
1999-02-07 20:29:40 +03:00
|
|
|
${OBJCFLAGS:M-[ID]*:Q} ${CPPFLAGS:Q} $$files; \
|
1998-08-18 21:31:21 +04:00
|
|
|
${MKDEP} -a ${MKDEPFLAGS} \
|
|
|
|
${OBJCFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \
|
|
|
|
fi
|
2003-06-11 22:05:40 +04:00
|
|
|
@files="${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cxx} ${.ALLSRC:M*.cpp}"; \
|
2003-06-11 21:24:55 +04:00
|
|
|
if [ "$$files" != " " ]; then \
|
1997-03-08 02:10:18 +03:00
|
|
|
echo ${MKDEP} -a ${MKDEPFLAGS} \
|
1999-02-07 20:29:40 +03:00
|
|
|
${CXXFLAGS:M-[ID]*:Q} ${CPPFLAGS:Q} $$files; \
|
1997-03-08 02:10:18 +03:00
|
|
|
${MKDEP} -a ${MKDEPFLAGS} \
|
2001-11-28 07:38:29 +03:00
|
|
|
${CXXFLAGS:M-[ID]*} ${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include/g++} ${CPPFLAGS} $$files; \
|
1993-08-15 23:37:04 +04:00
|
|
|
fi
|
2003-05-08 17:34:07 +04:00
|
|
|
.else
|
|
|
|
#
|
|
|
|
# Cygwin workarounds for limited environment & command line space
|
|
|
|
#
|
|
|
|
|
|
|
|
SRCS_S = ${SRCS:M*.[sS]} ${DPSRCS:M*.[sS]}
|
|
|
|
SRCS_C = ${SRCS:M*.c} ${DPSRCS:M*.c}
|
|
|
|
SRCS_M = ${SRCS:M*.m} ${DPSRCS:M*.m}
|
|
|
|
SRCS_X = ${SRCS:M*.C} ${DPSRCS:M*.C} \
|
|
|
|
${SRCS:M*.cc} ${DPSRCS:M*.cc} \
|
2003-06-11 21:32:45 +04:00
|
|
|
${SRCS:M*.cpp} ${DPSRCS:M*.cpp} \
|
2003-05-08 17:34:07 +04:00
|
|
|
${SRCS:M*.cxx} ${DPSRCS:M*.cxx}
|
|
|
|
|
|
|
|
.depend: ${SRCS} ${DPSRCS} \
|
|
|
|
${SRCS_S:C/(.*)/\1.dep/g:S/^.dep$//g} \
|
|
|
|
${SRCS_C:C/(.*)/\1.dep/g:S/^.dep$//g} \
|
|
|
|
${SRCS_M:C/(.*)/\1.dep/g:S/^.dep$//g} \
|
|
|
|
${SRCS_X:C/(.*)/\1.dep/g:S/^.dep$//g}
|
|
|
|
@rm -f .depend
|
|
|
|
@cat ${.ALLSRC:M*.dep} > .depend
|
|
|
|
|
|
|
|
.for F in ${SRCS_S:O:u}
|
|
|
|
.NOPATH: ${F:C/(.*)/\1.dep/g}
|
|
|
|
${F:C/(.*)/\1.dep/g}: ${F}
|
|
|
|
@echo ${MKDEP} -a -f $@ ${MKDEPFLAGS} \
|
|
|
|
${AFLAGS:M-[ID]*:Q} ${CPPFLAGS:Q} ${__acpp_flags} ${AINC:Q} \
|
|
|
|
${.ALLSRC}
|
|
|
|
@${MKDEP} -a -f $@ ${MKDEPFLAGS} ${AFLAGS:M-[ID]*} ${CPPFLAGS} \
|
|
|
|
${__acpp_flags} ${AINC} ${.ALLSRC}
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
.for F in ${SRCS_C:O:u}
|
|
|
|
.NOPATH: ${F:C/(.*)/\1.dep/g}
|
|
|
|
${F:C/(.*)/\1.dep/g}: ${F}
|
|
|
|
@echo ${MKDEP} -a -f $@ ${MKDEPFLAGS} ${CFLAGS:M-[ID]*:Q} \
|
|
|
|
${CPPFLAGS:Q} ${.ALLSRC}
|
|
|
|
@${MKDEP} -a -f $@ ${MKDEPFLAGS} ${CFLAGS:M-[ID]*} ${CPPFLAGS} \
|
|
|
|
${.ALLSRC}
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
.for F in ${SRCS_M:O:u}
|
|
|
|
.NOPATH: ${F:C/(.*)/\1.dep/g}
|
|
|
|
${F:C/(.*)/\1.dep/g}: ${F}
|
|
|
|
@echo ${MKDEP} -a -f $@ ${MKDEPFLAGS} ${OBJCFLAGS:M-[ID]*:Q} \
|
|
|
|
${CPPFLAGS:Q} ${.ALLSRC}
|
|
|
|
@${MKDEP} -a -f $@ ${MKDEPFLAGS} ${OBJCFLAGS:M-[ID]*} ${CPPFLAGS} \
|
|
|
|
${.ALLSRC}
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
.for F in ${SRCS_X:O:u}
|
|
|
|
.NOPATH: ${F:C/(.*)/\1.dep/g}
|
|
|
|
${F:C/(.*)/\1.dep/g}: ${F}
|
|
|
|
@echo ${MKDEP} -a -f $@ ${MKDEPFLAGS} \
|
|
|
|
${CXXFLAGS:M-[ID]*:Q} ${CPPFLAGS:Q} ${.ALLSRC}
|
|
|
|
@${MKDEP} -a -f $@ ${MKDEPFLAGS} ${CXXFLAGS:M-[ID]*} \
|
|
|
|
${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEM} \
|
|
|
|
${DESTDIR}/usr/include/g++} ${CPPFLAGS} ${.ALLSRC}
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
.endif # Cygwin
|
2001-11-02 08:21:47 +03:00
|
|
|
.endif # defined(SRCS)
|
|
|
|
|
|
|
|
##### Clean rules
|
1997-05-09 11:56:00 +04:00
|
|
|
cleandepend:
|
2001-11-02 08:21:47 +03:00
|
|
|
.if defined(SRCS)
|
1999-08-11 06:00:15 +04:00
|
|
|
rm -f .depend ${.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
|