Index: head/lib/libmagic/Makefile =================================================================== --- head/lib/libmagic/Makefile +++ head/lib/libmagic/Makefile @@ -37,7 +37,7 @@ magic: ${MAGFILES} cat ${.ALLSRC:O} > ${.TARGET} -magic.mgc: mkmagic magic +magic.mgc: magic ${BTOOLSPATH:U.}/mkmagic magic .if ${MACHINE} == "host" || ${MK_DIRDEPS_BUILD} == "no" @@ -51,6 +51,8 @@ .endif .if ${MK_DIRDEPS_BUILD} == "yes" BTOOLSPATH= ${HOST_OBJTOP}/${RELDIR} +.else +magic.mgc: mkmagic .endif FILEVER!= awk '$$1 == "\#define" && $$2 == "VERSION" { print $$3; exit }' \ Index: head/lib/libpmc/Makefile =================================================================== --- head/lib/libpmc/Makefile +++ head/lib/libpmc/Makefile @@ -20,7 +20,7 @@ .if ${MK_DIRDEPS_BUILD} == "yes" # avoid circular dependency -CFLAGS+= -I${RELDIR:H}/libpmcstat +CFLAGS+= -I${SRCTOP}/${RELDIR:H}/libpmcstat GENDIRDEPS_FILTER+= N${RELDIR:H}/libpmcstat JEVENTS?= ${HOST_OBJTOP}/${RELDIR}/pmu-events/jevents .else Index: head/share/mk/local.dirdeps.mk =================================================================== --- head/share/mk/local.dirdeps.mk +++ head/share/mk/local.dirdeps.mk @@ -222,7 +222,7 @@ .endif # this one is too pervasive -.if ${MK_BSD_CRTBEGIN} == "no" && ${DEP_RELDIR} != "gnu/lib/csu" +.if ${MK_BSD_CRTBEGIN} == "no" && ${DEP_RELDIR:N.:Ngnu/lib/csu:Ninclude*:Ntargets/*} != "" DIRDEPS+= gnu/lib/csu .endif