Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/share/mk remove multiple copies of the same logic.
details: https://anonhg.NetBSD.org/src/rev/1662fc8c71c5
branches: trunk
changeset: 357954:1662fc8c71c5
user: christos <christos%NetBSD.org@localhost>
date: Wed Dec 06 02:06:45 2017 +0000
description:
remove multiple copies of the same logic.
diffstat:
share/mk/bsd.klinks.mk | 81 +++++++++++++++----------------------------------
1 files changed, 25 insertions(+), 56 deletions(-)
diffs (115 lines):
diff -r a6b0c976982f -r 1662fc8c71c5 share/mk/bsd.klinks.mk
--- a/share/mk/bsd.klinks.mk Tue Dec 05 22:51:59 2017 +0000
+++ b/share/mk/bsd.klinks.mk Wed Dec 06 02:06:45 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.klinks.mk,v 1.13 2014/08/10 05:57:31 matt Exp $
+# $NetBSD: bsd.klinks.mk,v 1.14 2017/12/06 02:06:45 christos Exp $
#
.include <bsd.own.mk>
@@ -7,37 +7,36 @@
##### Default values
.if !defined(S)
-.if defined(NETBSDSRCDIR)
+. if defined(NETBSDSRCDIR)
S= ${NETBSDSRCDIR}/sys
-.elif defined(BSDSRCDIR)
+. elif defined(BSDSRCDIR)
S= ${BSDSRCDIR}/sys
-.else
+. else
S= /sys
-.endif
+. endif
.endif
-CLEANFILES+= machine ${MACHINE_CPU} ${KLINK_MACHINE}
+KLINKFILES+= ${MACHINE_CPU} ${KLINK_MACHINE}
+
.if ${KLINK_MACHINE} == "sun2" || ${KLINK_MACHINE} == "sun3"
-CLEANFILES+= sun68k
+KLINKFILES+= sun68k
.elif ${KLINK_MACHINE} == "sparc64"
-CLEANFILES+= sparc
+KLINKFILES+= sparc
.elif ${KLINK_MACHINE} == "i386"
-CLEANFILES+= x86
+KLINKFILES+= x86
.elif ${KLINK_MACHINE} == "amd64"
-CLEANFILES+= x86 i386
+KLINKFILES+= x86 i386
.elif ${KLINK_MACHINE} == "evbmips"
-CLEANFILES+= algor sbmips
+KLINKFILES+= algor sbmips
.elif ${MACHINE_CPU} == "aarch64"
-CLEANFILES+= arm
+KLINKFILES+= arm
+.elif defined(XEN_BUILD) || ${KLINK_MACHINE} == "xen"
+KLINKFILES+= xen
+CLEANFILES+= xen-ma/machine # xen-ma
+CPPFLAGS+= -I${.OBJDIR}/xen-ma
.endif
-.if defined(XEN_BUILD) || ${KLINK_MACHINE} == "xen"
-CLEANFILES+= xen xen-ma/machine # xen-ma
-CPPFLAGS+= -I${.OBJDIR}/xen-ma
-.if ${MACHINE_CPU} == "i386"
-CLEANFILES+= x86
-.endif
-.endif
+CLEANFILES+= machine ${KLINKFILES}
# 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.
@@ -45,43 +44,13 @@
.BEGIN:
-@rm -f machine && \
ln -s $S/arch/${KLINK_MACHINE}/include machine
- -@rm -f ${KLINK_MACHINE} && \
- ln -s $S/arch/${KLINK_MACHINE}/include ${KLINK_MACHINE}
- -@if [ -d $S/arch/${MACHINE_CPU} ]; then \
- rm -f ${MACHINE_CPU} && \
- ln -s $S/arch/${MACHINE_CPU}/include ${MACHINE_CPU}; \
- fi
-# XXX. it gets worse..
-.if ${KLINK_MACHINE} == "sun2" || ${KLINK_MACHINE} == "sun3"
- -@rm -f sun68k && \
- ln -s $S/arch/sun68k/include sun68k
-.endif
-.if ${KLINK_MACHINE} == "sparc64"
- -@rm -f sparc && \
- ln -s $S/arch/sparc/include sparc
-.endif
-.if ${KLINK_MACHINE} == "amd64"
- -@rm -f i386 && \
- ln -s $S/arch/i386/include i386
-.endif
-.if ${MACHINE_CPU} == "i386" || ${MACHINE_CPU} == "x86_64"
- -@rm -f x86 && \
- ln -s $S/arch/x86/include x86
-.endif
-.if ${MACHINE_CPU} == "aarch64"
- -@rm -f arm && \
- ln -s $S/arch/arm/include arm
-.endif
-.if defined(XEN_BUILD) || ${KLINK_MACHINE} == "xen"
- -@rm -f xen && \
- ln -s $S/arch/xen/include xen
+. for kl in ${KLINKFILES}
+ -@if [ -d $S/arch/${kl}/include ]; then \
+ rm -f ${kl} && ln -s $S/arch/${kl}/include ${kl}; \
+ fi
+. endfor
+. if defined(XEN_BUILD) || ${KLINK_MACHINE} == "xen"
-@rm -rf xen-ma && mkdir xen-ma && \
ln -s ../${XEN_BUILD:U${MACHINE_ARCH}} xen-ma/machine
+. endif
.endif
-.if ${KLINK_MACHINE} == "evbmips"
- -@rm -f algor && \
- ln -s $S/arch/algor/include algor
- -@rm -f sbmips && \
- ln -s $S/arch/sbmips/include sbmips
-.endif
-.endif
Home |
Main Index |
Thread Index |
Old Index