NetBSD/distrib/sets/makeflist

176 lines
4.3 KiB
Plaintext
Raw Normal View History

#!/bin/sh
#
# $NetBSD: makeflist,v 1.55 2002/11/25 23:29:54 lukem Exp $
#
# Print out the files in some or all lists.
# Usage: makeflist [-b] [-x] [-a arch] [-m machine] [-s setsdir] [setname ...]
#
1994-08-29 19:21:02 +04:00
# set defaults
MAKE="${MAKE:-make} -j 1 -f `dirname $0`/Makefile"
machine=`${MAKE} print_machine`
machine_arch=`${MAKE} print_machine_arch`
machine_cpu=`${MAKE} print_machine_cpu`
object_fmt=`${MAKE} print_object_fmt`
toolchain_missing=`${MAKE} print_toolchain_missing`
x11_version=`${MAKE} print_x11_version`
setd=`pwd`
nlists="base comp etc games man misc text"
xlists="xbase xcomp xcontrib xfont xserver xmisc"
lists=$nlists
1994-08-29 19:21:02 +04:00
# handle args
while : ; do
case $1 in
-b*)
lists="$xlists $nlists"
;;
-x*)
lists=$xlists
;;
-a*)
machine_arch=`MACHINE_ARCH=${2} ${MAKE} print_machine_arch`
machine_cpu=`MACHINE_ARCH=${2} ${MAKE} print_machine_cpu`
shift
;;
-m*)
machine=$2; shift
;;
-s*)
setd=$2; shift
;;
-*)
cat 1>&2 <<USAGE
Usage: $0 [-b] [-x] [-a arch] [-m machine] [-s setsdir] [setname ...]
-b make netbsd + x11 lists
-x only make x11 lists
2001-11-24 06:06:17 +03:00
-a arch set arch (e.g, m68k, mipseb, mipsel, powerpc) [$machine_arch]
-m machine set machine (e.g, amiga, i386, macppc) [$machine]
-s setsdir directory to find sets [$setd]
[setname ...] sets to build [$lists]
USAGE
exit 1
;;
*)
break
;;
esac
shift
done
if [ -n "$1" ]; then
lists="$@"
fi
1994-08-29 19:21:02 +04:00
# Determine lib type.
if [ "$object_fmt" = "ELF" ]; then
2001-01-04 14:15:32 +03:00
shlib=elf
else
shlib=aout
fi
stlib=$shlib
# Turn off shlibs for some ports.
if [ "$machine_cpu" = "sh3" -o "$machine_arch" = "m68000" ]; then
shlib=no
fi
# Turn off lintlibs for some ports.
lintlibs=
if [ "$machine" = "x86_64" ]; then
lintlibs=no
fi
# Automatically add XFree86 version specific sets
for list in $lists
do
if [ -z "$_lists" ]
then
_lists=$list
else
_lists="$_lists $list"
fi
if [ -d "$setd/lists/$list${x11_version}" ]
then
_lists="$_lists $list${x11_version}"
fi
done
lists=$_lists
unset _lists
for setname in $lists; do
cat $setd/lists/$setname/mi
if [ "$machine" != "$machine_arch" ]; then
# Prefer an ad.${machine_arch} over an ad.${machine_cpu},
# since the arch-specific one will be more specific than
# the cpu-specific one.
if [ -f $setd/lists/$setname/ad.${machine_arch} ]; then
cat $setd/lists/$setname/ad.${machine_arch}
elif [ -f $setd/lists/$setname/ad.${machine_cpu} ]; then
cat $setd/lists/$setname/ad.${machine_cpu}
fi
if [ "$shlib" != "no" -a \
-f $setd/lists/$setname/ad.${machine_cpu}.shl ]; then
cat $setd/lists/$setname/ad.${machine_cpu}.shl
fi
fi
if [ -f $setd/lists/$setname/md.${machine} ]; then
cat $setd/lists/$setname/md.${machine}
fi
if [ -f $setd/lists/$setname/stl.mi ]; then
cat $setd/lists/$setname/stl.mi
fi
if [ -f $setd/lists/$setname/stl.${stlib} ]; then
cat $setd/lists/$setname/stl.${stlib}
fi
if [ "$shlib" != "no" ]; then
if [ -f $setd/lists/$setname/shl.mi ]; then
cat $setd/lists/$setname/shl.mi
fi
if [ -f $setd/lists/$setname/shl.${shlib} ]; then
cat $setd/lists/$setname/shl.${shlib}
fi
fi
if [ "$lintlibs" != no ]; then
if [ -f $setd/lists/$setname/lint.mi ]; then
cat $setd/lists/$setname/lint.mi
fi
fi
if [ "$toolchain_missing" != "yes" ]; then
if [ -f $setd/lists/$setname/tc.mi ]; then
cat $setd/lists/$setname/tc.mi
fi
if [ "$shlib" != "no" ]; then
if [ -f $setd/lists/$setname/tc.shl ]; then
cat $setd/lists/$setname/tc.shl
fi
fi
fi
# XXX MIPS does not support rescue right now.
if [ ${machine_cpu} = "mips" ]; then
continue
fi
if [ -f $setd/lists/$setname/rescue.mi ]; then
cat $setd/lists/$setname/rescue.mi
fi
if [ -f $setd/lists/$setname/rescue.${machine} ]; then
cat $setd/lists/$setname/rescue.${machine}
fi
if [ "$machine" != "$machine_arch" ]; then
# Prefer a rescue.ad.${machine_arch} over a
# rescue.ad.${machine_cpu}, since the arch-
# specific one will be more specific than the
# cpu-specific one.
if [ -f $setd/lists/$setname/rescue.ad.${machine_arch} ]; then
cat $setd/lists/$setname/rescue.ad.${machine_arch}
elif [ -f $setd/lists/$setname/rescue.ad.${machine_cpu} ]; then
cat $setd/lists/$setname/rescue.ad.${machine_cpu}
fi
if [ "$shlib" != "no" -a -f \
$setd/lists/$setname/rescue.ad.${machine_cpu}.shl ]; then
cat $setd/lists/$setname/rescue.ad.${machine_cpu}.shl
fi
fi
done | awk -- '/^[^#]/ {print $1}' | sort -u