sets.subr revision 1.115
11.115Suebayasi# $NetBSD: sets.subr,v 1.115 2009/12/15 05:07:11 uebayasi Exp $ 21.1Sdyoung# 31.9Slukem 41.9Slukem# 51.11Slukem# The following variables contain defaults for sets.subr functions and callers: 61.9Slukem# setsdir path to src/distrib/sets 71.9Slukem# nlists list of base sets 81.9Slukem# xlists list of x11 sets 91.92Suebayasi# extlists list of extsrc sets 101.9Slukem# obsolete controls if obsolete files are selected instead 111.76Stsutsui# module if != "no", enable MODULE sets 121.9Slukem# shlib shared library format (a.out, elf, or "") 131.9Slukem# stlib static library format (a.out, elf) 141.11Slukem# 151.11Slukem# The following <bsd.own.mk> variables are exported to the environment: 161.11Slukem# MACHINE 171.11Slukem# MACHINE_ARCH 181.11Slukem# MACHINE_CPU 191.87Sskrll# HAVE_BINUTILS 201.48Smrg# HAVE_GCC 211.52Slukem# HAVE_GDB 221.11Slukem# TOOLCHAIN_MISSING 231.11Slukem# OBJECT_FMT 241.22Slukem# as well as: 251.22Slukem# 261.95Suebayasi 271.42Sapb# 281.42Sapb# The following variables refer to tools that are used when building sets: 291.42Sapb# 301.43Sapb: ${AWK:=awk} 311.42Sapb: ${CKSUM:=cksum} 321.43Sapb: ${COMM:=comm} 331.44Sapb: ${DATE:=date} 341.43Sapb: ${DB:=db} 351.43Sapb: ${EGREP:=egrep} 361.43Sapb: ${ENV_CMD:=env} # ${ENV} is special to sh(1), ksh(1), etc. 371.44Sapb: ${FGREP:=fgrep} 381.43Sapb: ${FIND:=find} 391.44Sapb: ${GREP:=grep} 401.43Sapb: ${GZIP_CMD:=gzip} # ${GZIP} is special to gzip(1) 411.99Sapb: ${HOSTNAME_CMD:=hostname} # ${HOSTNAME} is special to bash(1) 421.42Sapb: ${HOST_SH:=sh} 431.43Sapb: ${IDENT:=ident} 441.43Sapb: ${JOIN:=join} 451.43Sapb: ${LS:=ls} 461.43Sapb: ${MAKE:=make} 471.42Sapb: ${MKTEMP:=mktemp} 481.43Sapb: ${MTREE:=mtree} 491.43Sapb: ${PASTE:=paste} 501.42Sapb: ${PAX:=pax} 511.43Sapb: ${PRINTF:=printf} 521.43Sapb: ${SED:=sed} 531.43Sapb: ${SORT:=sort} 541.44Sapb: ${STAT:=stat} 551.44Sapb: ${TSORT:=tsort} 561.43Sapb: ${UNAME:=uname} 571.43Sapb: ${WC:=wc} 581.43Sapb 591.45Sapb# 601.45Sapb# If printf is a shell builtin command, then we can 611.45Sapb# implement cheaper versions of basename and dirname 621.45Sapb# that do not involve any fork/exec overhead. 631.45Sapb# If printf is not builtin, approximate it using echo, 641.45Sapb# and hope there are no weird file names that cause 651.45Sapb# some versions of echo to do the wrong thing. 661.45Sapb# (Converting to this version of dirname speeded up the 671.45Sapb# syspkgdeps script by an order of magnitude, from 68 681.45Sapb# seconds to 6.3 seconds on one particular host.) 691.45Sapb# 701.45Sapb# Note that naive approximations for dirname 711.45Sapb# using ${foo%/*} do not do the right thing in cases 721.45Sapb# where the result should be "/" or ".". 731.45Sapb# 741.45Sapbcase "$(type printf)" in 751.45Sapb*builtin*) 761.45Sapb basename () 771.45Sapb { 781.45Sapb local bn 791.45Sapb bn="${1##*/}" 801.45Sapb bn="${bn%$2}" 811.45Sapb printf "%s\n" "$bn" 821.45Sapb } 831.45Sapb dirname () 841.45Sapb { 851.45Sapb local dn 861.45Sapb case "$1" in 871.45Sapb ?*/*) dn="${1%/*}" ;; 881.45Sapb /*) dn=/ ;; 891.45Sapb *) dn=. ;; 901.45Sapb esac 911.45Sapb printf "%s\n" "$dn" 921.45Sapb } 931.45Sapb ;; 941.45Sapb*) 951.45Sapb basename () 961.45Sapb { 971.45Sapb local bn 981.45Sapb bn="${1##*/}" 991.45Sapb bn="${bn%$2}" 1001.45Sapb echo "$bn" 1011.45Sapb } 1021.45Sapb dirname () 1031.45Sapb { 1041.45Sapb local dn 1051.45Sapb case "$1" in 1061.45Sapb ?*/*) dn="${1%/*}" ;; 1071.45Sapb /*) dn=/ ;; 1081.45Sapb *) dn=. ;; 1091.45Sapb esac 1101.45Sapb echo "$dn" 1111.45Sapb } 1121.45Sapb ;; 1131.45Sapbesac 1141.45Sapb 1151.108Suebayasi##### 1161.108Suebayasi 1171.9SlukemoIFS=$IFS 1181.9SlukemIFS=" 1191.9Slukem" 1201.100Suebayasi 1211.109Shefor x in $( ${MAKE} -B -f ${rundir}/mkvars.mk mkvars ); do 1221.108Suebayasi eval export $x 1231.9Slukemdone 1241.100Suebayasi 1251.9SlukemIFS=$oIFS 1261.9Slukem 1271.109SheMKVARS="$( ${MAKE} -B -f ${rundir}/mkvars.mk mkvars | sed -e 's,=.*,,' | xargs )" 1281.100Suebayasi 1291.105Suebayasiif [ "$SETS_SUBR_DEBUG" = "dumpmkvars" ]; then 1301.105Suebayasi for v in $MKVARS; do 1311.105Suebayasi eval echo $v=\$$v 1321.105Suebayasi done 1331.105Suebayasi exit 0 1341.105Suebayasifi 1351.105Suebayasi 1361.105Suebayasi##### 1371.105Suebayasi 1381.34Serhsetsdir=${0%/*} 1391.9Slukemobsolete=0 1401.76Stsutsuimodule=yes 1411.91Sdyoungif [ "${MKKMOD}" = "no" ]; then 1421.91Sdyoung module=no # MODULEs are off. 1431.9Slukemfi 1441.31Sjmc# Determine lib type. Do this first so stlib also gets set. 1451.31Sjmcif [ "${OBJECT_FMT}" = "ELF" ]; then 1461.9Slukem shlib=elf 1471.9Slukemelse 1481.9Slukem shlib=aout 1491.9Slukemfi 1501.9Slukemstlib=$shlib 1511.31Sjmc# Now check for MKPIC or specials and turn off shlib if need be. 1521.31Sjmcif [ "${MKPIC}" = "no" ]; then 1531.31Sjmc shlib=no 1541.31Sjmcfi 1551.86Sjnemethif [ "$module" != "no" ]; then 1561.86Sjnemeth nlists="base comp etc games man misc modules tests text" 1571.86Sjnemethelse 1581.86Sjnemeth nlists="base comp etc games man misc tests text" 1591.86Sjnemethfi 1601.86Sjnemethxlists="xbase xcomp xetc xfont xserver" 1611.92Suebayasiextlists="extbase extcomp extetc" 1621.9Slukem 1631.64SheOSRELEASE=`${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh` 1641.81SrmindMODULEDIR="stand/${MACHINE}/${OSRELEASE}/modules" 1651.62SadSUBST="s#@MODULEDIR@#${MODULEDIR}#g" 1661.62SadSUBST="${SUBST};s#@OSRELEASE@#${OSRELEASE}#g" 1671.62SadSUBST="${SUBST};s#@MACHINE@#${MACHINE}#g" 1681.60Sad 1691.9Slukem# 1701.9Slukem# list_set_files setfile [...] 1711.1Sdyoung# 1721.9Slukem# Produce a packing list for setfile(s). 1731.9Slukem# In each file, a record consists of a path and a System Package name, 1741.9Slukem# separated by whitespace. E.g., 1751.9Slukem# 1761.115Suebayasi# # $NetBSD: sets.subr,v 1.115 2009/12/15 05:07:11 uebayasi Exp $ 1771.9Slukem# . base-sys-root [keyword[,...]] 1781.9Slukem# ./altroot base-sys-root 1791.9Slukem# ./bin base-sys-root 1801.9Slukem# ./bin/[ base-util-root 1811.9Slukem# ./bin/cat base-util-root 1821.9Slukem# [...] 1831.9Slukem# 1841.9Slukem# A # in the first column marks a comment. 1851.9Slukem# 1861.9Slukem# If ${obsolete} != 0, only entries with an "obsolete" keyword will 1871.52Slukem# be printed. All other keywords must be present. 1881.9Slukem# 1891.9Slukem# The third field is an optional comma separated list of keywords to 1901.9Slukem# control if a record is printed; every keyword listed must be enabled 1911.9Slukem# for the record to be printed. The following keywords are available: 1921.9Slukem# dummy dummy entry (ignored) 1931.13Slukem# obsolete file is obsolete, and only printed if 1941.13Slukem# ${obsolete} != 0 1951.13Slukem# 1961.87Sskrll# bfd obsolete, use binutils. 1971.87Sskrll# binutils ${MKBINUTILS} != no 1981.22Slukem# catpages ${MKCATPAGES} != no 1991.71Smrg# compat ${MKCOMPAT} != no 2001.22Slukem# crypto ${MKCRYPTO} != no 2011.22Slukem# crypto_idea ${MKCRYPTO_IDEA} != no 2021.22Slukem# crypto_mdc2 ${MKCRYPTO_MDC2} != no 2031.22Slukem# crypto_rc5 ${MKCRYPTO_RC5} != no 2041.22Slukem# cvs ${MKCVS} != no 2051.53Slukem# debug ${MKDEBUG} != no 2061.69Slukem# debuglib ${MKDEBUGLIB} != no 2071.23Slukem# doc ${MKDOC} != no 2081.67Slukem# dynamicroot ${MKDYNAMICROOT} != no 2091.92Suebayasi# extsrc ${MKEXTSRC} != no 2101.52Slukem# gcc ${MKGCC} != no 2111.36Smatt# gcccmds ${MKGCCCMDS} != no 2121.32Sscw# gdb ${MKGDB} != no 2131.22Slukem# hesiod ${MKHESIOD} != no 2141.68Slukem# html ${MKHTML} != no 2151.67Slukem# inet6 ${MKINET6} != no 2161.23Slukem# info ${MKINFO} != no 2171.39Speter# ipfilter ${MKIPFILTER} != no 2181.51Smrg# iscsi ${MKISCSI} != no 2191.22Slukem# kerberos ${MKKERBEROS} != no 2201.85Sdyoung# kmod ${MKKMOD} != no 2211.67Slukem# ldap ${MKLDAP} != no 2221.22Slukem# lint ${MKLINT} != no 2231.78Sagc# lvm ${MKLVM} != no 2241.22Slukem# man ${MKMAN} != no 2251.67Slukem# manpages ${MKMANPAGES} != no 2261.22Slukem# manz ${MKMANZ} != no 2271.88Stsarna# mdns ${MKMDNS} != no 2281.23Slukem# nls ${MKNLS} != no 2291.66Sdyoung# nvi ${MKNVI} != no 2301.37She# pam ${MKPAM} != no 2311.39Speter# pf ${MKPF} != no 2321.67Slukem# pic ${MKPIC} != no 2331.22Slukem# postfix ${MKPOSTFIX} != no 2341.22Slukem# profile ${MKPROFILE} != no 2351.24Slukem# share ${MKSHARE} != no 2361.22Slukem# skey ${MKSKEY} != no 2371.73Smrg# x11 ${MKX11} != no && ${X11FLAVOUR} != "Xorg" 2381.73Smrg# xorg ${MKX11} != no && ${X11FLAVOUR} == "Xorg" 2391.22Slukem# yp ${MKYP} != no 2401.89Shaad# zfs ${MKZFS} != no 2411.22Slukem# 2421.87Sskrll# binutils=<n> <n> = value of ${HAVE_BINUTILS} 2431.52Slukem# gcc=<n> <n> = value of ${HAVE_GCC} 2441.52Slukem# gdb=<n> <n> = value of ${HAVE_GDB} 2451.52Slukem# 2461.41Slukem# use_inet6 ${USE_INET6} != no 2471.41Slukem# use_kerberos ${USE_KERBEROS} != no 2481.41Slukem# use_yp ${USE_YP} != no 2491.41Slukem# 2501.22Slukem# .cat if ${MKMANZ} != "no" && ${MKCATPAGES} != "no" 2511.22Slukem# automatically append ".gz" to the filename 2521.22Slukem# 2531.22Slukem# .man if ${MKMANZ} != "no" && ${MKMAN} != "no" 2541.22Slukem# automatically append ".gz" to the filename 2551.1Sdyoung# 2561.8Slukemlist_set_files() 2571.8Slukem{ 2581.83Sapb if [ ${MAKEVERBOSE:-2} -lt 3 ]; then 2591.65She verbose=false 2601.65She else 2611.65She verbose=true 2621.65She fi 2631.1Sdyoung for setname; do 2641.65She list=`list_set_lists $setname` 2651.65She for l in $list; do 2661.65She echo $l 2671.65She if $verbose; then 2681.82Sapb echo >&2 "DEBUG: list_set_files: $l" 2691.65She fi 2701.65She done 2711.62Sad done | xargs cat | ${SED} ${SUBST} | \ 2721.43Sapb ${AWK} -v obsolete=${obsolete} ' 2731.9Slukem BEGIN { 2741.52Slukem if (obsolete) 2751.52Slukem wanted["obsolete"] = 1 2761.52Slukem 2771.100Suebayasi split("'"${MKVARS}"'", needvars) 2781.52Slukem for (vi in needvars) { 2791.52Slukem nv = needvars[vi] 2801.52Slukem kw = tolower(nv) 2811.52Slukem sub(/^mk/, "", kw) 2821.52Slukem if (ENVIRON[nv] != "no") 2831.52Slukem wanted[kw] = 1 2841.52Slukem } 2851.52Slukem 2861.52Slukem if ("'"${TOOLCHAIN_MISSING}"'" != "yes") { 2871.90Sdyoung if ("binutils" in wanted) 2881.90Sdyoung wanted["binutils=" "'"${HAVE_BINUTILS}"'"] = 1 2891.90Sdyoung if ("gcc" in wanted) 2901.90Sdyoung wanted["gcc=" "'"${HAVE_GCC}"'"] = 1 2911.90Sdyoung if ("gdb" in wanted) 2921.90Sdyoung wanted["gdb=" "'"${HAVE_GDB}"'"] = 1 2931.9Slukem } 2941.52Slukem if (("man" in wanted) && ("catpages" in wanted)) 2951.52Slukem wanted[".cat"] = 1 2961.52Slukem if (("man" in wanted) && ("manpages" in wanted)) 2971.52Slukem wanted[".man"] = 1 2981.9Slukem } 2991.9Slukem 3001.9Slukem /^#/ { 3011.9Slukem next; 3021.9Slukem } 3031.9Slukem 3041.9Slukem NF > 2 && $3 != "-" { 3051.9Slukem split($3, keywords, ",") 3061.9Slukem show = 1 3071.52Slukem haveobs = 0 3081.9Slukem for (ki in keywords) { 3091.9Slukem kw = keywords[ki] 3101.22Slukem if (("manz" in wanted) && 3111.22Slukem (kw == ".cat" || kw == ".man")) 3121.22Slukem $1 = $1 ".gz" 3131.59Sjmmv negated = match(kw, "! *") 3141.59Sjmmv if (negated > 0) { 3151.59Sjmmv kw = substr(kw, RSTART + RLENGTH) 3161.59Sjmmv if (kw in wanted) 3171.59Sjmmv show = 0 3181.59Sjmmv } else { 3191.59Sjmmv if (! (kw in wanted)) 3201.59Sjmmv show = 0 3211.59Sjmmv } 3221.52Slukem if (kw == "obsolete") 3231.52Slukem haveobs = 1 3241.9Slukem } 3251.52Slukem if (obsolete && ! haveobs) 3261.52Slukem next 3271.9Slukem if (show) 3281.9Slukem print 3291.9Slukem next 3301.9Slukem } 3311.9Slukem 3321.9Slukem { 3331.9Slukem if (! obsolete) 3341.9Slukem print 3351.9Slukem }' 3361.9Slukem 3371.1Sdyoung} 3381.1Sdyoung 3391.1Sdyoung# 3401.1Sdyoung# list_set_lists setname 3411.1Sdyoung# 3421.1Sdyoung# Print to stdout a list of files, one filename per line, which 3431.1Sdyoung# concatenate to create the packing list for setname. E.g., 3441.1Sdyoung# 3451.1Sdyoung# .../lists/base/mi 3461.1Sdyoung# .../lists/base/rescue.mi 3471.1Sdyoung# .../lists/base/md.i386 3481.9Slukem# [...] 3491.1Sdyoung# 3501.9Slukem# For a given setname $set, the following files may be selected from 3511.9Slukem# .../list/$set: 3521.9Slukem# mi 3531.92Suebayasi# mi.ext.* 3541.11Slukem# ad.${MACHINE_ARCH} 3551.11Slukem# (or) ad.${MACHINE_CPU} 3561.11Slukem# ad.${MACHINE_CPU}.shl 3571.11Slukem# md.${MACHINE}.${MACHINE_ARCH} 3581.11Slukem# (or) md.${MACHINE} 3591.9Slukem# stl.mi 3601.92Suebayasi# stl.${stlib} 3611.9Slukem# shl.mi 3621.92Suebayasi# shl.mi.ext.* 3631.92Suebayasi# shl.${shlib} 3641.92Suebayasi# shl.${shlib}.ext.* 3651.77Stsutsui# module.mi if ${module} != no 3661.77Stsutsui# module.${MACHINE} if ${module} != no 3671.77Stsutsui# module.ad.${MACHINE_ARCH} if ${module} != no 3681.77Stsutsui# (or) module.ad.${MACHINE_CPU} if ${module} != no 3691.9Slukem# rescue.shl 3701.11Slukem# rescue.${MACHINE} 3711.11Slukem# rescue.ad.${MACHINE_ARCH} 3721.11Slukem# (or) rescue.ad.${MACHINE_CPU} 3731.11Slukem# rescue.ad.${MACHINE_CPU}.shl 3741.1Sdyoung# 3751.9Slukem# Environment: 3761.1Sdyoung# shlib 3771.1Sdyoung# stlib 3781.1Sdyoung# 3791.8Slukemlist_set_lists() 3801.8Slukem{ 3811.1Sdyoung setname=$1 3821.1Sdyoung 3831.111Suebayasi list_set_lists_mi $setname 3841.113Suebayasi list_set_lists_ad $setname 3851.111Suebayasi list_set_lists_md $setname 3861.111Suebayasi list_set_lists_stl $setname 3871.113Suebayasi list_set_lists_shl $setname 3881.113Suebayasi list_set_lists_module $setname 3891.111Suebayasi list_set_lists_rescue $setname 3901.111Suebayasi} 3911.110Suebayasi 3921.111Suebayasilist_set_lists_mi() 3931.111Suebayasi{ 3941.111Suebayasi setdir=$setsdir/lists/$1 3951.113Suebayasi # always exist! 3961.9Slukem echo $setdir/mi 3971.111Suebayasi} 3981.110Suebayasi 3991.111Suebayasilist_set_lists_ad() 4001.111Suebayasi{ 4011.111Suebayasi setdir=$setsdir/lists/$1 4021.113Suebayasi [ "${MACHINE}" != "${MACHINE_ARCH}" ] && \ 4031.113Suebayasi list_set_lists_common_ad $1 4041.111Suebayasi} 4051.110Suebayasi 4061.111Suebayasilist_set_lists_md() 4071.111Suebayasi{ 4081.111Suebayasi setdir=$setsdir/lists/$1 4091.110Suebayasi echo_if_exist $setdir/md.${MACHINE}.${MACHINE_ARCH} || \ 4101.110Suebayasi echo_if_exist $setdir/md.${MACHINE} 4111.111Suebayasi} 4121.110Suebayasi 4131.111Suebayasilist_set_lists_stl() 4141.111Suebayasi{ 4151.111Suebayasi setdir=$setsdir/lists/$1 4161.110Suebayasi echo_if_exist $setdir/stl.mi 4171.110Suebayasi echo_if_exist $setdir/stl.${stlib} 4181.111Suebayasi} 4191.110Suebayasi 4201.111Suebayasilist_set_lists_shl() 4211.111Suebayasi{ 4221.111Suebayasi setdir=$setsdir/lists/$1 4231.113Suebayasi [ "$shlib" != "no" ] || return 4241.112Suebayasi echo_if_exist $setdir/shl.mi 4251.112Suebayasi echo_if_exist $setdir/shl.${shlib} 4261.111Suebayasi} 4271.110Suebayasi 4281.111Suebayasilist_set_lists_module() 4291.111Suebayasi{ 4301.111Suebayasi setdir=$setsdir/lists/$1 4311.113Suebayasi [ "$module" != "no" ] || return 4321.112Suebayasi echo_if_exist $setdir/module.mi 4331.112Suebayasi echo_if_exist $setdir/module.${MACHINE} 4341.113Suebayasi # XXX module never has .shl 4351.113Suebayasi [ "${MACHINE}" != "${MACHINE_ARCH}" ] && \ 4361.113Suebayasi list_set_lists_common_ad $1 module 4371.111Suebayasi} 4381.1Sdyoung 4391.111Suebayasilist_set_lists_rescue() 4401.111Suebayasi{ 4411.111Suebayasi setdir=$setsdir/lists/$1 4421.110Suebayasi echo_if_exist $setdir/rescue.mi 4431.110Suebayasi echo_if_exist $setdir/rescue.${MACHINE} 4441.113Suebayasi [ "${MACHINE}" != "${MACHINE_ARCH}" ] && \ 4451.113Suebayasi list_set_lists_common_ad $1 rescue 4461.111Suebayasi} 4471.111Suebayasi 4481.113Suebayasilist_set_lists_common_ad() 4491.111Suebayasi{ 4501.113Suebayasi setdir=$setsdir/lists/$1; _prefix=$2 4511.113Suebayasi 4521.113Suebayasi [ -n "$_prefix" ] && prefix="$_prefix". 4531.113Suebayasi 4541.113Suebayasi # Prefer a <prefix>.ad.${MACHINE_ARCH} over a 4551.113Suebayasi # <prefix>.ad.${MACHINE_CPU}, since the arch- 4561.112Suebayasi # specific one will be more specific than the 4571.112Suebayasi # cpu-specific one. 4581.113Suebayasi echo_if_exist $setdir/${prefix}ad.${MACHINE_ARCH} || \ 4591.113Suebayasi echo_if_exist $setdir/${prefix}ad.${MACHINE_CPU} 4601.113Suebayasi [ "$shlib" != "no" ] && \ 4611.113Suebayasi echo_if_exist $setdir/${prefix}ad.${MACHINE_CPU}.shl 4621.5Sdyoung} 4631.5Sdyoung 4641.110Suebayasiecho_if_exist() 4651.110Suebayasi{ 4661.110Suebayasi [ -f $1 ] && echo $1 4671.110Suebayasi return $? 4681.110Suebayasi} 4691.110Suebayasi 4701.110Suebayasiecho_if_exist_foreach() 4711.110Suebayasi{ 4721.110Suebayasi local _list=$1; shift 4731.110Suebayasi for _suffix in $@; do 4741.110Suebayasi echo_if_exist ${_list}.${_suffix} 4751.110Suebayasi done 4761.110Suebayasi} 4771.110Suebayasi 4781.9Slukem# arch_to_cpu mach 4791.9Slukem# 4801.11Slukem# Print the ${MACHINE_CPU} for ${MACHINE_ARCH}=mach, 4811.9Slukem# as determined by <bsd.own.mk>. 4821.9Slukem# 4831.8Slukemarch_to_cpu() 4841.8Slukem{ 4851.56Sapb MACHINE_ARCH=${1} ${MAKE} -B -f- all <<EOMAKE 4861.5Sdyoung.include <bsd.own.mk> 4871.5Sdyoungall: 4881.5Sdyoung @echo \${MACHINE_CPU} 4891.12SlukemEOMAKE 4901.1Sdyoung} 4911.46Sapb 4921.46Sapb# arch_to_endian mach 4931.46Sapb# 4941.46Sapb# Print the ${TARGET_ENDIANNESS} for ${MACHINE_ARCH}=mach, 4951.46Sapb# as determined by <bsd.endian.mk>. 4961.46Sapb# 4971.46Sapbarch_to_endian() 4981.46Sapb{ 4991.56Sapb MACHINE_ARCH=${1} ${MAKE} -B -f- all <<EOMAKE 5001.46Sapb.include <bsd.endian.mk> 5011.46Sapball: 5021.46Sapb @echo \${TARGET_ENDIANNESS} 5031.46SapbEOMAKE 5041.46Sapb} 505