Home | History | Annotate | Line # | Download | only in sets
makeflist revision 1.22
      1 #!/bin/sh
      2 #
      3 # $NetBSD: makeflist,v 1.22 2000/08/09 10:51:50 mrg Exp $
      4 #
      5 # Print out the files in some or all lists.
      6 # Usage: makeflist [-b] [-x] [-a arch] [-m machine] [-s setsdir] [setname ...]
      7 #
      8 
      9 # set defaults
     10 : ${MAKE=make}
     11 machine=${MACHINE:-`printf 'xxx:\n\techo ${MACHINE}' | $MAKE -s -f-`}
     12 arch=${MACHINE_ARCH:-`printf 'xxx:\n\techo ${MACHINE_ARCH}' | $MAKE -s -f-`}
     13 setd=`pwd`
     14 nlists="base comp etc games man misc text"
     15 xlists="xbase xcomp xcontrib xfont xserver"
     16 lists=$nlists
     17 
     18 # handle args
     19 while : ; do
     20 	case $1 in
     21 	-b*)
     22 		lists="$xlists $nlists"
     23 		;;
     24 	-x*)
     25 		lists=$xlists
     26 		;;
     27 	-a*)
     28 		arch=$2; shift
     29 		;;
     30 	-m*)
     31 		machine=$2; shift
     32 		;;
     33 	-s*)
     34 		setd=$2; shift
     35 		;;
     36 	-*)
     37 		cat 1>&2 <<USAGE
     38 Usage: $0 [-b] [-x] [-a arch] [-m machine] [-s setsdir] [setname ...]
     39 	-b		make netbsd + x11 lists
     40 	-x		only make x11 lists
     41 	-a arch		set arch (e.g, m68k, mips, powerpc)	[$arch]
     42 	-m machine	set machine (e.g, amiga, i386, macppc)	[$machine]
     43 	-s setsdir	directory to find sets	[$setd]
     44 	[setname ...]	sets to build 	[$lists]
     45 USAGE
     46 		exit 1
     47 		;;
     48 	*)
     49 		break
     50 		;;
     51 	esac
     52 	shift
     53 done
     54 if [ -n "$1" ]; then
     55 	lists="$@"
     56 fi
     57 
     58 # Convert mipse[lb] to mips after processing command line arguments.
     59 arch=`echo $arch | sed s,^mipse.,mips,`
     60 
     61 # Compute toolchain  used on target cpu.
     62 if [ "$arch" = "mips" -o "$machine" = "alpha" -o "$arch" = "powerpc" -o "$arch" = "sparc" -o "$arch" = "sparc64" -o "$arch" = "i386" ]; then
     63         shlib=elf
     64 else
     65         shlib=aout
     66 fi
     67 
     68 for setname in $lists; do
     69 	awk -- '{print $1}' $setd/lists/$setname/mi
     70 	if [ "$machine" != "$cpu" -a -f $setd/lists/$setname/ad.${arch} ]; then
     71 		awk -- '{print $1}' $setd/lists/$setname/ad.${arch}
     72 	fi
     73 	if [ -f $setd/lists/$setname/md.${machine} ]; then
     74 		awk -- '{print $1}' $setd/lists/$setname/md.${machine}
     75 	fi
     76 	if [ "$shlib" != "" ]; then
     77 		if [ -f $setd/lists/$setname/shl.mi ]; then
     78 			awk -- '{print $1}' $setd/lists/$setname/shl.mi
     79 		fi
     80 		if [ -f $setd/lists/$setname/shl.${shlib} ]; then
     81 			awk -- '{print $1}' $setd/lists/$setname/shl.${shlib}
     82 		fi
     83 	fi
     84 
     85 	# Split man/md_share into: this machine, other machine
     86 	if [ $setname = man ]; then
     87 		grep ${machine} $setd/lists/man/md_share
     88 	fi
     89 	if [ $setname = misc ]; then
     90 		grep -v ${machine} $setd/lists/man/md_share
     91 	fi
     92 
     93 done | egrep -v '^#' | sort -u
     94