# $NetBSD: bsd.dep.mk,v 1.13 1997/03/07 23:10:18 gwr Exp $ # handle Proc*C as well... .if !empty(SRCS:M*.pc) .include "proc.mk" .endif .if exists(/usr/bin/mkdep) MKDEP?= mkdep .elif exists(/usr/local/share/bin/mkdeps.sh) MKDEP?= /usr/local/share/bin/mkdeps.sh -N .endif MKDEP?= mkdep .NOPATH: .depend .ifndef NO_AUTODEP .include "autodep.mk" .else # some of the rules involve .h sources, so remove them from mkdep line .if !target(depend) depend: beforedepend .depend _SUBDIRUSE afterdepend .if defined(SRCS) # libs can have too many SRCS for a single command line # so do them on at a time. .depend: ${SRCS} @rm -f .depend .ifdef LIB @files="${.ALLSRC:M*.s} ${.ALLSRC:M*.S}"; \ if [ "$$files" != " " ]; then \ set -x; for f in $$files; do ${MKDEP} -a ${MKDEPFLAGS} \ ${CFLAGS:M-[ID]*} ${CPPFLAGS} ${AINC} $$f; done; \ fi @files="${.ALLSRC:M*.c} ${.ALLSRC:M*.pc:T:.pc=.c}"; \ if [ "$$files" != "" ]; then \ set -x; for f in $$files; do ${MKDEP} -a ${MKDEPFLAGS} \ ${CFLAGS:M-[ID]*} ${CPPFLAGS} $$f; done; \ fi @files="${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cxx}"; \ if [ "$$files" != " " ]; then \ set -x; for f in $$files; do ${MKDEP} -a ${MKDEPFLAGS} \ ${CXXFLAGS:M-[ID]*} ${CPPFLAGS} $$f; done; \ fi .else @files="${.ALLSRC:M*.s} ${.ALLSRC:M*.S}"; \ if [ "$$files" != " " ]; then \ echo ${MKDEP} -a ${MKDEPFLAGS} \ ${CFLAGS:M-[ID]*} ${CPPFLAGS} ${AINC} $$files; \ ${MKDEP} -a ${MKDEPFLAGS} \ ${CFLAGS:M-[ID]*} ${CPPFLAGS} ${AINC} $$files; \ fi @files="${.ALLSRC:M*.c} ${.ALLSRC:M*.pc:T:.pc=.c}"; \ if [ "$$files" != "" ]; then \ echo ${MKDEP} -a ${MKDEPFLAGS} \ ${CFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \ ${MKDEP} -a ${MKDEPFLAGS} \ ${CFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \ fi @files="${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cxx}"; \ if [ "$$files" != " " ]; then \ echo ${MKDEP} -a ${MKDEPFLAGS} \ ${CXXFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \ ${MKDEP} -a ${MKDEPFLAGS} \ ${CXXFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \ fi .endif .else .depend: .endif .if !target(beforedepend) beforedepend: .endif .if !target(afterdepend) afterdepend: .endif .endif .endif .if !target(tags) .if defined(SRCS) tags: ${SRCS} _SUBDIRUSE -cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC:N*.h} | \ sed "s;\${.CURDIR}/;;" > tags .else tags: .endif .endif .if defined(SRCS) cleandir: cleandepend .if !target(cleandepend) cleandepend: rm -f .depend ${.CURDIR}/tags .endif .endif