2013-10-13 01:42:55 +02:00
|
|
|
.if !target(_DIRDEP_USE)
|
|
|
|
# we are the 1st makefile
|
|
|
|
|
2014-08-19 08:50:54 +02:00
|
|
|
.if !defined(MK_CLANG)
|
2014-05-10 02:25:21 +02:00
|
|
|
.include "${SRCTOP}/share/mk/src.opts.mk"
|
2014-05-05 20:18:23 +02:00
|
|
|
.endif
|
|
|
|
|
2013-10-13 01:42:55 +02:00
|
|
|
# DEP_MACHINE is set before we get here, this may not be.
|
|
|
|
DEP_RELDIR ?= ${RELDIR}
|
|
|
|
|
|
|
|
.if ${.TARGETS:Uall:M*/*} && empty(DIRDEPS)
|
|
|
|
# This little trick let's us do
|
|
|
|
#
|
|
|
|
# mk -f dirdeps.mk some/dir.i386,bsd
|
|
|
|
#
|
|
|
|
DIRDEPS := ${.TARGETS:M*/*}
|
|
|
|
${.TARGETS:Nall}: all
|
|
|
|
.endif
|
|
|
|
|
2014-11-30 19:45:46 +01:00
|
|
|
# making universe is special
|
|
|
|
.if defined(UNIVERSE_GUARD)
|
|
|
|
# these should be done by now
|
|
|
|
DIRDEPS_FILTER+= N*.host
|
|
|
|
.endif
|
|
|
|
|
2013-10-13 01:42:55 +02:00
|
|
|
# pseudo machines get no qualification
|
|
|
|
.for m in host common
|
|
|
|
M_dep_qual_fixes += C;($m),[^/.,]*$$;\1;
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
#.info M_dep_qual_fixes=${M_dep_qual_fixes}
|
|
|
|
# we want to supress these dependencies for host tools
|
2014-05-05 21:35:32 +02:00
|
|
|
# but some libs are sadly needed.
|
2014-05-16 17:00:04 +02:00
|
|
|
_need_host_libs= \
|
|
|
|
lib/libc++ \
|
|
|
|
lib/libcxxrt \
|
|
|
|
lib/libdwarf \
|
2015-05-26 23:44:15 +02:00
|
|
|
lib/libmd \
|
2014-05-16 17:00:04 +02:00
|
|
|
|
2014-05-05 21:35:32 +02:00
|
|
|
N_host_libs:= ${cd ${SRCTOP} && echo lib/lib*:L:sh:${_need_host_libs:${M_ListToSkip}}:${M_ListToSkip}}
|
2013-10-13 01:42:55 +02:00
|
|
|
DIRDEPS_FILTER.host = \
|
2014-05-05 21:35:32 +02:00
|
|
|
${N_host_libs} \
|
2013-10-13 01:42:55 +02:00
|
|
|
Ninclude* \
|
|
|
|
Nlib/csu* \
|
|
|
|
Nlib/[mn]* \
|
|
|
|
Ngnu/lib/csu* \
|
|
|
|
Ngnu/lib/lib[a-r]* \
|
2015-05-26 23:44:15 +02:00
|
|
|
Nusr.bin/xinstall* \
|
2013-10-13 01:42:55 +02:00
|
|
|
|
|
|
|
|
2014-05-16 17:00:04 +02:00
|
|
|
DIRDEPS_FILTER+= \
|
|
|
|
${DIRDEPS_FILTER.xtras:U}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# reset this each time
|
|
|
|
DIRDEPS_FILTER.xtras=
|
|
|
|
.if ${DEP_MACHINE:Npkgs*} != ""
|
|
|
|
DIRDEPS_FILTER.xtras+= Nusr.bin/clang/clang.host
|
2013-10-13 01:42:55 +02:00
|
|
|
.endif
|
2012-08-22 21:25:57 +02:00
|
|
|
|
2013-03-17 04:06:49 +01:00
|
|
|
.if ${DEP_MACHINE} != "host"
|
|
|
|
|
2012-08-22 21:25:57 +02:00
|
|
|
# this is how we can handle optional dependencies
|
2014-05-16 17:00:04 +02:00
|
|
|
.if ${DEP_RELDIR} == "lib/libc"
|
|
|
|
DIRDEPS += lib/libc_nonshared
|
|
|
|
.if ${MK_SSP:Uno} != "no"
|
2012-08-22 21:25:57 +02:00
|
|
|
DIRDEPS += gnu/lib/libssp/libssp_nonshared
|
|
|
|
.endif
|
2014-05-16 17:00:04 +02:00
|
|
|
.else
|
|
|
|
DIRDEPS_FILTER.xtras+= Nlib/libc_nonshared
|
|
|
|
.endif
|
2013-03-06 19:35:57 +01:00
|
|
|
|
2013-10-13 01:42:55 +02:00
|
|
|
# some optional things
|
2014-05-16 17:00:04 +02:00
|
|
|
.if ${MK_CTF} == "yes" && ${DEP_RELDIR:Mcddl/usr.bin/ctf*} == ""
|
2013-10-13 01:42:55 +02:00
|
|
|
DIRDEPS += \
|
|
|
|
cddl/usr.bin/ctfconvert.host \
|
|
|
|
cddl/usr.bin/ctfmerge.host
|
|
|
|
.endif
|
|
|
|
|
2013-03-17 04:06:49 +01:00
|
|
|
.endif
|
|
|
|
|
2014-05-16 17:00:04 +02:00
|
|
|
.if ${MK_CLANG} == "yes" && ${DEP_RELDIR:Nlib/clang/lib*:Nlib/libc*} == ""
|
|
|
|
DIRDEPS+= lib/clang/include
|
|
|
|
.endif
|
|
|
|
|
2015-05-26 23:44:15 +02:00
|
|
|
.if ${MK_STAGING} == "yes"
|
2014-11-30 19:45:46 +01:00
|
|
|
# we need targets/pseudo/stage to prep the stage tree
|
|
|
|
.if ${DEP_RELDIR} != "targets/pseudo/stage"
|
|
|
|
DIRDEPS += targets/pseudo/stage
|
2013-03-06 19:35:57 +01:00
|
|
|
.endif
|
2015-05-26 23:44:15 +02:00
|
|
|
.endif
|
2013-03-12 18:21:03 +01:00
|
|
|
|
2013-05-11 02:51:59 +02:00
|
|
|
CSU_DIR.i386 = csu/i386-elf
|
2013-10-13 01:42:55 +02:00
|
|
|
DEP_MACHINE_ARCH = ${MACHINE_ARCH.${DEP_MACHINE}}
|
2013-05-11 02:51:59 +02:00
|
|
|
CSU_DIR.${DEP_MACHINE_ARCH} ?= csu/${DEP_MACHINE_ARCH}
|
|
|
|
CSU_DIR := ${CSU_DIR.${DEP_MACHINE_ARCH}}
|
2013-10-13 01:42:55 +02:00
|
|
|
BOOT_MACHINE_DIR:= ${BOOT_MACHINE_DIR.${DEP_MACHINE}}
|
|
|
|
KERNEL_NAME:= ${KERNEL_NAME.${DEP_MACHINE}}
|