1 #!/bin/sh 2 # 3 # $NetBSD: makeflist,v 1.46 2002/05/05 01:24:24 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 x11_version=`${MAKE} print_x11_version` 17 setd=`pwd` 18 nlists="base comp etc games man misc text" 19 xlists="xbase xcomp xcontrib xfont xserver xmisc" 20 lists=$nlists 21 22 # handle args 23 while : ; do 24 case $1 in 25 -b*) 26 lists="$xlists $nlists" 27 ;; 28 -x*) 29 lists=$xlists 30 ;; 31 -a*) 32 machine_arch=`MACHINE_ARCH=${2} ${MAKE} print_machine_arch` 33 machine_cpu=`MACHINE_ARCH=${2} ${MAKE} print_machine_cpu` 34 shift 35 ;; 36 -m*) 37 machine=$2; shift 38 ;; 39 -s*) 40 setd=$2; shift 41 ;; 42 -*) 43 cat 1>&2 <<USAGE 44 Usage: $0 [-b] [-x] [-a arch] [-m machine] [-s setsdir] [setname ...] 45 -b make netbsd + x11 lists 46 -x only make x11 lists 47 -a arch set arch (e.g, m68k, mipseb, mipsel, powerpc) [$machine_arch] 48 -m machine set machine (e.g, amiga, i386, macppc) [$machine] 49 -s setsdir directory to find sets [$setd] 50 [setname ...] sets to build [$lists] 51 USAGE 52 exit 1 53 ;; 54 *) 55 break 56 ;; 57 esac 58 shift 59 done 60 if [ -n "$1" ]; then 61 lists="$@" 62 fi 63 64 # Determine lib type. 65 if [ "$object_fmt" = "ELF" ]; then 66 shlib=elf 67 else 68 shlib=aout 69 fi 70 stlib=$shlib 71 72 # Turn off shlibs for some ports. 73 if [ "$machine_cpu" = "sh3" -o "$machine_arch" = "m68000" ]; then 74 shlib=no 75 fi 76 77 # Turn off lintlibs for some ports. 78 lintlibs= 79 if [ "$machine" = "x86_64" ]; then 80 lintlibs=no 81 fi 82 83 # Automatically add XFree86 version specific sets 84 for list in $lists 85 do 86 if [ -z "$_lists" ] 87 then 88 _lists=$list 89 else 90 _lists="$_lists $list" 91 fi 92 if [ -d "$setd/lists/$list${x11_version}" ] 93 then 94 _lists="$_lists $list${x11_version}" 95 fi 96 done 97 lists=$_lists 98 unset _lists 99 100 for setname in $lists; do 101 cat $setd/lists/$setname/mi 102 if [ "$machine" != "$machine_arch" -a \ 103 -f $setd/lists/$setname/ad.${machine_cpu} ]; then 104 cat $setd/lists/$setname/ad.${machine_cpu} 105 fi 106 if [ -f $setd/lists/$setname/md.${machine} ]; then 107 cat $setd/lists/$setname/md.${machine} 108 fi 109 if [ -f $setd/lists/$setname/stl.mi ]; then 110 cat $setd/lists/$setname/stl.mi 111 fi 112 if [ -f $setd/lists/$setname/stl.${stlib} ]; then 113 cat $setd/lists/$setname/stl.${stlib} 114 fi 115 if [ "$shlib" != "no" ]; then 116 if [ -f $setd/lists/$setname/shl.mi ]; then 117 cat $setd/lists/$setname/shl.mi 118 fi 119 if [ -f $setd/lists/$setname/shl.${shlib} ]; then 120 cat $setd/lists/$setname/shl.${shlib} 121 fi 122 fi 123 if [ "$lintlibs" != no ]; then 124 if [ -f $setd/lists/$setname/lint.mi ]; then 125 cat $setd/lists/$setname/lint.mi 126 fi 127 fi 128 if [ "$tc" = "yes" ]; then 129 if [ -f $setd/lists/$setname/tc.mi ]; then 130 cat $setd/lists/$setname/tc.mi 131 fi 132 if [ "$shlib" != "no" ]; then 133 if [ -f $setd/lists/$setname/tc.shl ]; then 134 $setd/lists/$setname/tc.shl 135 fi 136 fi 137 else 138 if [ -f $setd/lists/$setname/tc.old ]; then 139 cat $setd/lists/$setname/tc.old 140 fi 141 fi 142 done | awk -- '/^[^#]/ {print $1}' | sort -u 143