1 #!/bin/sh 2 # 3 # $NetBSD: makeflist,v 1.40 2001/11/24 03:06:17 thorpej 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=`${MAKE} print_machine` 12 machine_arch=`${MAKE} print_machine_arch` 13 machine_cpu=`${MAKE} print_machine_cpu` 14 object_fmt=`${MAKE} print_object_fmt` 15 tc=`${MAKE} print_use_new_toolchain` 16 setd=`pwd` 17 nlists="base comp etc games man misc text" 18 xlists="xbase xcomp xcontrib xfont xserver xmisc" 19 lists=$nlists 20 21 # handle args 22 while : ; do 23 case $1 in 24 -b*) 25 lists="$xlists $nlists" 26 ;; 27 -x*) 28 lists=$xlists 29 ;; 30 -a*) 31 machine_arch=`MACHINE_ARCH=${2} ${MAKE} print_machine_arch` 32 machine_cpu=`MACHINE_ARCH=${2} ${MAKE} print_machine_cpu` 33 shift 34 ;; 35 -m*) 36 machine=$2; shift 37 ;; 38 -s*) 39 setd=$2; shift 40 ;; 41 -*) 42 cat 1>&2 <<USAGE 43 Usage: $0 [-b] [-x] [-a arch] [-m machine] [-s setsdir] [setname ...] 44 -b make netbsd + x11 lists 45 -x only make x11 lists 46 -a arch set arch (e.g, m68k, mipseb, mipsel, powerpc) [$machine_arch] 47 -m machine set machine (e.g, amiga, i386, macppc) [$machine] 48 -s setsdir directory to find sets [$setd] 49 [setname ...] sets to build [$lists] 50 USAGE 51 exit 1 52 ;; 53 *) 54 break 55 ;; 56 esac 57 shift 58 done 59 if [ -n "$1" ]; then 60 lists="$@" 61 fi 62 63 # Determine shlib type. 64 if [ "$object_fmt" = "ELF" ]; then 65 shlib=elf 66 elif [ "$machine_cpu" = "sh3" ]; then 67 shlib= 68 else 69 shlib=aout 70 fi 71 72 # Turn off lintlibs for some ports. 73 lintlibs= 74 if [ "$machine" = "sparc64" -o "$machine_cpu" = "sh3" -o \ 75 "$machine_arch" = "m68000" ]; then 76 lintlibs=no 77 fi 78 79 for setname in $lists; do 80 cat $setd/lists/$setname/mi 81 if [ "$machine" != "$machine_arch" -a \ 82 -f $setd/lists/$setname/ad.${machine_cpu} ]; then 83 cat $setd/lists/$setname/ad.${machine_cpu} 84 fi 85 if [ -f $setd/lists/$setname/md.${machine} ]; then 86 cat $setd/lists/$setname/md.${machine} 87 fi 88 if [ "$shlib" != "" ]; then 89 if [ -f $setd/lists/$setname/shl.mi ]; then 90 cat $setd/lists/$setname/shl.mi 91 fi 92 if [ -f $setd/lists/$setname/shl.${shlib} ]; then 93 cat $setd/lists/$setname/shl.${shlib} 94 fi 95 fi 96 if [ "$lintlibs" != no ]; then 97 if [ -f $setd/lists/$setname/lint.mi ]; then 98 cat $setd/lists/$setname/lint.mi 99 fi 100 fi 101 if [ "$tc" = "yes" ]; then 102 if [ -f $setd/lists/$setname/tc.mi ]; then 103 cat $setd/lists/$setname/tc.mi 104 fi 105 else 106 if [ -f $setd/lists/$setname/tc.old ]; then 107 cat $setd/lists/$setname/tc.old 108 fi 109 fi 110 done | egrep -v '^#' | awk -- '{print $1}' | sort -u 111