1 # $NetBSD: bsd.klinks.mk,v 1.11 2013/08/21 15:26:44 matt Exp $
6 KLINK_MACHINE?
= ${MACHINE}
10 .if defined
(NETBSDSRCDIR
)
11 S
= ${NETBSDSRCDIR}/sys
12 .elif defined
(BSDSRCDIR
)
19 CLEANFILES
+= machine
${MACHINE_CPU} ${KLINK_MACHINE}
20 .if
${KLINK_MACHINE} == "sun2" ||
${KLINK_MACHINE} == "sun3"
22 .elif
${KLINK_MACHINE} == "sparc64"
24 .elif
${KLINK_MACHINE} == "i386"
26 .elif
${KLINK_MACHINE} == "amd64"
28 .elif
${KLINK_MACHINE} == "evbmips"
29 CLEANFILES
+= algor sbmips
32 .if defined
(XEN_BUILD
) ||
${KLINK_MACHINE} == "xen"
33 CLEANFILES
+= xen xen-ma
/machine
# xen-ma
34 CPPFLAGS
+= -I
${.OBJDIR
}/xen-ma
35 .if
${MACHINE_CPU} == "i386"
40 # XXX. This should be done a better way. It's @'d to reduce visual spew.
41 # XXX .BEGIN is used to make sure the links are done before anything else.
42 .if
!make
(obj
) && !make
(clean) && !make
(cleandir
)
45 ln
-s
$S/arch
/${KLINK_MACHINE}/include machine
46 @
rm -f
${KLINK_MACHINE} && \
47 ln
-s
$S/arch
/${KLINK_MACHINE}/include ${KLINK_MACHINE}
48 @if
[ -d
$S/arch
/${MACHINE_CPU} ]; then \
49 rm -f
${MACHINE_CPU} && \
50 ln
-s
$S/arch
/${MACHINE_CPU}/include ${MACHINE_CPU}; \
52 # XXX. it gets worse..
53 .if
${KLINK_MACHINE} == "sun2" ||
${KLINK_MACHINE} == "sun3"
55 ln
-s
$S/arch
/sun68k
/include sun68k
57 .if
${KLINK_MACHINE} == "sparc64"
59 ln
-s
$S/arch
/sparc
/include sparc
61 .if
${KLINK_MACHINE} == "amd64"
63 ln
-s
$S/arch
/i386
/include i386
65 .if
${MACHINE_CPU} == "i386" ||
${MACHINE_CPU} == "x86_64"
67 ln
-s
$S/arch
/x86
/include x86
69 .if defined
(XEN_BUILD
) ||
${KLINK_MACHINE} == "xen"
71 ln
-s
$S/arch
/xen
/include xen
72 @
rm -rf xen-ma
&& mkdir xen-ma
&& \
73 ln
-s ..
/${XEN_BUILD
:U
${MACHINE_ARCH}} xen-ma
/machine
75 .if
${KLINK_MACHINE} == "evbmips"
77 ln
-s
$S/arch
/algor
/include algor
79 ln
-s
$S/arch
/sbmips
/include sbmips