2001-11-28 07:38:29 +03:00
|
|
|
# $NetBSD: bsd.dep.mk,v 1.34 2001/11/28 04:38:29 tv 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)
|
2001-11-02 08:21:47 +03:00
|
|
|
.NOPATH: .depend
|
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} \
|
1999-11-16 16:15:09 +03:00
|
|
|
${AFLAGS:M-[ID]*:Q} ${CPPFLAGS:Q} -traditional-cpp ${AINC:Q} \
|
1999-11-16 11:18:34 +03:00
|
|
|
$$files; \
|
1997-03-08 02:10:18 +03:00
|
|
|
${MKDEP} -a ${MKDEPFLAGS} \
|
1999-11-16 11:18:34 +03:00
|
|
|
${AFLAGS:M-[ID]*} ${CPPFLAGS} -traditional-cpp ${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
|
1995-09-27 04:15:09 +03:00
|
|
|
@files="${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cxx}"; \
|
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
|
|
|
${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
|
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
|