1998-02-20 15:32:30 +01:00
|
|
|
# $Id: bsd.dep.mk,v 1.16 1997/12/14 15:38:47 wosch Exp $
|
1996-05-26 01:09:49 +02:00
|
|
|
#
|
|
|
|
# The include file <bsd.dep.mk> handles Makefile dependencies.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# +++ variables +++
|
|
|
|
#
|
|
|
|
# DEPENDFILE dependencies file [.depend]
|
|
|
|
#
|
|
|
|
# MKDEP Options for ${MKDEPCMD} [not set]
|
|
|
|
#
|
|
|
|
# MKDEPCMD Makefile dependency list program [mkdep]
|
|
|
|
#
|
|
|
|
# SRCS List of source files (c, c++, assembler)
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# +++ targets +++
|
|
|
|
#
|
|
|
|
# cleandepend:
|
|
|
|
# Remove depend and tags file
|
|
|
|
#
|
|
|
|
# depend:
|
|
|
|
# Make the dependencies for the source files, and store
|
|
|
|
# them in the file ${DEPENDFILE}.
|
|
|
|
#
|
|
|
|
# tags:
|
1997-04-13 08:44:25 +02:00
|
|
|
# Create a (GLOBAL) gtags file for the source files.
|
|
|
|
# If HTML is defined, htags is also run after gtags.
|
1996-05-26 01:09:49 +02:00
|
|
|
|
1996-04-01 20:58:28 +02:00
|
|
|
|
|
|
|
MKDEPCMD?= mkdep
|
|
|
|
DEPENDFILE?= .depend
|
1994-08-04 23:10:08 +02:00
|
|
|
|
|
|
|
# some of the rules involve .h sources, so remove them from mkdep line
|
|
|
|
.if !target(depend)
|
|
|
|
.if defined(SRCS)
|
1997-10-05 11:40:24 +02:00
|
|
|
depend: beforedepend ${DEPENDFILE} afterdepend _SUBDIR
|
1996-04-01 20:58:28 +02:00
|
|
|
|
|
|
|
# .if defined ${SRCS:M*.[sS]} does not work
|
|
|
|
__depend_s= ${SRCS:M*.[sS]}
|
|
|
|
__depend_c= ${SRCS:M*.c}
|
|
|
|
__depend_cc= ${SRCS:M*.cc} ${SRCS:M*.C} ${SRCS:M*.cxx}
|
|
|
|
|
|
|
|
${DEPENDFILE}: ${SRCS}
|
|
|
|
rm -f ${DEPENDFILE}
|
|
|
|
.if defined(__depend_s) && !empty(__depend_s)
|
1997-06-18 05:39:34 +02:00
|
|
|
${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} ${CFLAGS:M-[BID]*} ${AINC} \
|
1996-04-01 20:58:28 +02:00
|
|
|
${.ALLSRC:M*.[sS]}
|
|
|
|
.endif
|
|
|
|
.if defined(__depend_c) && !empty(__depend_c)
|
1997-06-18 05:39:34 +02:00
|
|
|
${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} ${CFLAGS:M-[BID]*} \
|
1996-04-01 20:58:28 +02:00
|
|
|
${.ALLSRC:M*.c}
|
|
|
|
.endif
|
|
|
|
.if defined(__depend_cc) && !empty(__depend_cc)
|
|
|
|
${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} \
|
1997-06-18 05:39:34 +02:00
|
|
|
${CXXFLAGS:M-nostd*} ${CXXFLAGS:M-[BID]*} \
|
1996-04-01 20:58:28 +02:00
|
|
|
${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cxx}
|
|
|
|
.endif
|
1997-04-09 18:10:27 +02:00
|
|
|
.if target(_EXTRADEPEND)
|
|
|
|
cd ${.CURDIR}; ${MAKE} _EXTRADEPEND
|
|
|
|
.endif
|
1996-04-01 20:58:28 +02:00
|
|
|
|
1997-10-05 11:40:24 +02:00
|
|
|
.ORDER: ${DEPENDFILE} afterdepend
|
1994-08-04 23:10:08 +02:00
|
|
|
.else
|
1997-10-05 11:40:24 +02:00
|
|
|
depend: beforedepend afterdepend _SUBDIR
|
1994-08-04 23:10:08 +02:00
|
|
|
.endif
|
|
|
|
.if !target(beforedepend)
|
|
|
|
beforedepend:
|
1997-10-05 11:40:24 +02:00
|
|
|
.else
|
|
|
|
.ORDER: beforedepend ${DEPENDFILE}
|
|
|
|
.ORDER: beforedepend afterdepend
|
1994-08-04 23:10:08 +02:00
|
|
|
.endif
|
|
|
|
.if !target(afterdepend)
|
|
|
|
afterdepend:
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
1997-04-13 08:44:25 +02:00
|
|
|
.if defined(NOTAGS)
|
|
|
|
tags:
|
|
|
|
.endif
|
|
|
|
|
1994-08-04 23:10:08 +02:00
|
|
|
.if !target(tags)
|
1996-06-24 06:26:21 +02:00
|
|
|
tags: ${SRCS} _SUBDIR
|
1997-04-13 08:44:25 +02:00
|
|
|
@cd ${.CURDIR} && gtags ${GTAGSFLAGS}
|
|
|
|
.if defined(HTML)
|
|
|
|
@cd ${.CURDIR} && htags ${HTAGSFLAGS}
|
1994-08-04 23:10:08 +02:00
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
1996-06-24 06:26:21 +02:00
|
|
|
.if !target(cleandepend)
|
|
|
|
cleandepend: _SUBDIR
|
1997-08-26 18:54:33 +02:00
|
|
|
.if defined(SRCS)
|
1998-02-20 15:32:30 +01:00
|
|
|
rm -f ${DEPENDFILE} ${.CURDIR}/GRTAGS ${.CURDIR}/GSYMS ${.CURDIR}/GTAGS
|
1997-04-13 08:44:25 +02:00
|
|
|
.if defined(HTML)
|
|
|
|
rm -rf ${.CURDIR}/HTML
|
|
|
|
.endif
|
1996-06-24 06:26:21 +02:00
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
_SUBDIR: .USE
|
|
|
|
.if defined(SUBDIR) && !empty(SUBDIR)
|
|
|
|
@for entry in ${SUBDIR}; do \
|
|
|
|
(${ECHODIR} "===> ${DIRPRFX}$$entry"; \
|
|
|
|
if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \
|
|
|
|
cd ${.CURDIR}/$${entry}.${MACHINE}; \
|
|
|
|
else \
|
|
|
|
cd ${.CURDIR}/$${entry}; \
|
|
|
|
fi; \
|
|
|
|
${MAKE} ${.TARGET:S/realinstall/install/:S/.depend/depend/} DIRPRFX=${DIRPRFX}$$entry/); \
|
|
|
|
done
|
1994-08-04 23:10:08 +02:00
|
|
|
.endif
|