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