1 # $NetBSD: bsd.klinks.mk,v 1.13 2014/08/10 05:57:31 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
30 .elif
${MACHINE_CPU} == "aarch64"
34 .if defined
(XEN_BUILD
) ||
${KLINK_MACHINE} == "xen"
35 CLEANFILES
+= xen xen-ma
/machine
# xen-ma
36 CPPFLAGS
+= -I
${.OBJDIR
}/xen-ma
37 .if
${MACHINE_CPU} == "i386"
42 # XXX. This should be done a better way. It's @'d to reduce visual spew.
43 # XXX .BEGIN is used to make sure the links are done before anything else.
44 .if
!make
(obj
) && !make
(clean) && !make
(cleandir
)
47 ln
-s
$S/arch
/${KLINK_MACHINE}/include machine
48 -@
rm -f
${KLINK_MACHINE} && \
49 ln
-s
$S/arch
/${KLINK_MACHINE}/include ${KLINK_MACHINE}
50 -@if
[ -d
$S/arch
/${MACHINE_CPU} ]; then \
51 rm -f
${MACHINE_CPU} && \
52 ln
-s
$S/arch
/${MACHINE_CPU}/include ${MACHINE_CPU}; \
54 # XXX. it gets worse..
55 .if
${KLINK_MACHINE} == "sun2" ||
${KLINK_MACHINE} == "sun3"
57 ln
-s
$S/arch
/sun68k
/include sun68k
59 .if
${KLINK_MACHINE} == "sparc64"
61 ln
-s
$S/arch
/sparc
/include sparc
63 .if
${KLINK_MACHINE} == "amd64"
65 ln
-s
$S/arch
/i386
/include i386
67 .if
${MACHINE_CPU} == "i386" ||
${MACHINE_CPU} == "x86_64"
69 ln
-s
$S/arch
/x86
/include x86
71 .if
${MACHINE_CPU} == "aarch64"
73 ln
-s
$S/arch
/arm
/include arm
75 .if defined
(XEN_BUILD
) ||
${KLINK_MACHINE} == "xen"
77 ln
-s
$S/arch
/xen
/include xen
78 -@
rm -rf xen-ma
&& mkdir xen-ma
&& \
79 ln
-s ..
/${XEN_BUILD
:U
${MACHINE_ARCH}} xen-ma
/machine
81 .if
${KLINK_MACHINE} == "evbmips"
83 ln
-s
$S/arch
/algor
/include algor
85 ln
-s
$S/arch
/sbmips
/include sbmips