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