-# $OpenBSD: bsd.dep.mk,v 1.14 2017/06/04 12:25:19 espie Exp $
+# $OpenBSD: bsd.dep.mk,v 1.15 2017/06/16 10:20:52 espie Exp $
# $NetBSD: bsd.dep.mk,v 1.12 1995/09/27 01:15:09 christos Exp $
# some of the rules involve .h sources, so remove them from mkdep line
rm -f .depend ${.CURDIR}/tags
.endif
+BUILDFIRST ?=
+BUILDAFTER ?=
+.if !empty(BUILDFIRST) && !empty(BUILDAFTER)
+${BUILDAFTER}: ${BUILDFIRST}
+.endif
+
.PHONY: beforedepend depend afterdepend cleandepend realdepend
-# $OpenBSD: bsd.lib.mk,v 1.83 2017/06/07 16:01:07 robert Exp $
+# $OpenBSD: bsd.lib.mk,v 1.84 2017/06/16 10:20:52 espie Exp $
# $NetBSD: bsd.lib.mk,v 1.67 1996/01/17 20:39:26 mycroft Exp $
# @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91
all: ${_LIBS} _SUBDIRUSE
+BUILDAFTER += ${_LIBS}
+
OBJS+= ${SRCS:N*.h:R:S/$/.o/}
+BUILDAFTER += ${OBJS}
lib${LIB}.a: ${OBJS}
@echo building standard ${LIB} library
${RANLIB} lib${LIB}.a
POBJS+= ${OBJS:.o=.po}
+BUILDAFTER += ${POBJS}
lib${LIB}_p.a: ${POBJS}
@echo building profiled ${LIB} library
@rm -f lib${LIB}_p.a
${RANLIB} lib${LIB}_p.a
SOBJS+= ${OBJS:.o=.so}
+BUILDAFTER += ${SOBJS}
${FULLSHLIBNAME}: ${SOBJS} ${DPADD}
@echo building shared ${LIB} library \(version ${SHLIB_MAJOR}.${SHLIB_MINOR}\)
@rm -f ${.TARGET}
# all .do files...
DOBJS+= ${OBJS:.o=.do}
+BUILDAFTER += ${DOBJS}
# .do files that we actually need for where this dist lib will be used
.if defined(DIST_OBJS)
-# $OpenBSD: bsd.prog.mk,v 1.70 2015/11/14 23:56:50 deraadt Exp $
+# $OpenBSD: bsd.prog.mk,v 1.71 2017/06/16 10:20:52 espie Exp $
# $NetBSD: bsd.prog.mk,v 1.55 1996/04/08 21:19:26 jtc Exp $
# @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91
.MAIN: all
all: ${PROG} _SUBDIRUSE
+BUILDAFTER += ${PROG} ${OBJS}
+
.if !target(clean)
clean: _SUBDIRUSE
rm -f a.out [Ee]rrs mklog *.core y.tab.h \