2010-03-14 01:05:49 +03:00
|
|
|
# $NetBSD: bsd.klinks.mk,v 1.7 2010/03/13 22:05:49 christos Exp $
|
2007-08-06 01:43:24 +04:00
|
|
|
#
|
|
|
|
|
2009-03-15 08:57:54 +03:00
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
2007-08-06 01:43:24 +04:00
|
|
|
##### Default values
|
|
|
|
.if !defined(S)
|
|
|
|
.if defined(NETBSDSRCDIR)
|
|
|
|
S= ${NETBSDSRCDIR}/sys
|
|
|
|
.elif defined(BSDSRCDIR)
|
|
|
|
S= ${BSDSRCDIR}/sys
|
|
|
|
.else
|
|
|
|
S= /sys
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
CLEANFILES+= machine ${MACHINE_CPU}
|
|
|
|
.if ${MACHINE} == "sun2" || ${MACHINE} == "sun3"
|
|
|
|
CLEANFILES+= sun68k
|
|
|
|
.elif ${MACHINE} == "sparc64"
|
|
|
|
CLEANFILES+= sparc
|
|
|
|
.elif ${MACHINE} == "i386"
|
|
|
|
CLEANFILES+= x86
|
|
|
|
.elif ${MACHINE} == "amd64"
|
|
|
|
CLEANFILES+= x86
|
2008-07-30 00:18:25 +04:00
|
|
|
.endif
|
2007-08-06 01:43:24 +04:00
|
|
|
|
|
|
|
.if defined(XEN_BUILD) || ${MACHINE} == "xen"
|
|
|
|
CLEANFILES+= xen xen-ma/machine # xen-ma
|
|
|
|
CPPFLAGS+= -I${.OBJDIR}/xen-ma
|
|
|
|
.if ${MACHINE_CPU} == "i386"
|
|
|
|
CLEANFILES+= x86
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# XXX. This should be done a better way. It's @'d to reduce visual spew.
|
|
|
|
# XXX .BEGIN is used to make sure the links are done before anything else.
|
2009-03-15 08:48:02 +03:00
|
|
|
.if !make(obj) && !make(clean) && !make(cleandir)
|
2007-08-06 01:43:24 +04:00
|
|
|
.BEGIN:
|
|
|
|
@rm -f machine && \
|
|
|
|
ln -s $S/arch/${MACHINE}/include machine
|
2010-03-14 01:05:49 +03:00
|
|
|
@if [ -d $S/arch/${MACHINE_CPU} ]; then \
|
|
|
|
rm -f ${MACHINE_CPU} && \
|
|
|
|
ln -s $S/arch/${MACHINE_CPU}/include ${MACHINE_CPU}; \
|
|
|
|
fi
|
2007-08-06 01:43:24 +04:00
|
|
|
# XXX. it gets worse..
|
|
|
|
.if ${MACHINE} == "sun2" || ${MACHINE} == "sun3"
|
|
|
|
@rm -f sun68k && \
|
|
|
|
ln -s $S/arch/sun68k/include sun68k
|
|
|
|
.endif
|
|
|
|
.if ${MACHINE} == "sparc64"
|
|
|
|
@rm -f sparc && \
|
|
|
|
ln -s $S/arch/sparc/include sparc
|
|
|
|
.endif
|
|
|
|
.if ${MACHINE} == "amd64"
|
|
|
|
@rm -f x86 && \
|
|
|
|
ln -s $S/arch/x86/include x86
|
2008-12-09 01:47:55 +03:00
|
|
|
@rm -f i386 && \
|
|
|
|
ln -s $S/arch/i386/include i386
|
2007-08-06 01:43:24 +04:00
|
|
|
.endif
|
|
|
|
.if ${MACHINE_CPU} == "i386"
|
|
|
|
@rm -f x86 && \
|
|
|
|
ln -s $S/arch/x86/include x86
|
|
|
|
.endif
|
|
|
|
.if defined(XEN_BUILD) || ${MACHINE} == "xen"
|
|
|
|
@rm -f xen && \
|
|
|
|
ln -s $S/arch/xen/include xen
|
|
|
|
@rm -rf xen-ma && mkdir xen-ma && \
|
|
|
|
ln -s ../${XEN_BUILD:U${MACHINE_ARCH}} xen-ma/machine
|
|
|
|
.endif
|
|
|
|
.endif
|