1#!/bin/sh 2# 3# $NetBSD: makeflist,v 1.47 2002/05/06 23:38:47 nathanw 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} 11machine=`${MAKE} print_machine` 12machine_arch=`${MAKE} print_machine_arch` 13machine_cpu=`${MAKE} print_machine_cpu` 14object_fmt=`${MAKE} print_object_fmt` 15tc=`${MAKE} print_use_new_toolchain` 16x11_version=`${MAKE} print_x11_version` 17setd=`pwd` 18nlists="base comp etc games man misc text" 19xlists="xbase xcomp xcontrib xfont xserver xmisc" 20lists=$nlists 21 22# handle args 23while : ; 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 44Usage: $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] 51USAGE 52 exit 1 53 ;; 54 *) 55 break 56 ;; 57 esac 58 shift 59done 60if [ -n "$1" ]; then 61 lists="$@" 62fi 63 64# Determine lib type. 65if [ "$object_fmt" = "ELF" ]; then 66 shlib=elf 67else 68 shlib=aout 69fi 70stlib=$shlib 71 72# Turn off shlibs for some ports. 73if [ "$machine_cpu" = "sh3" -o "$machine_arch" = "m68000" ]; then 74 shlib=no 75fi 76 77# Turn off lintlibs for some ports. 78lintlibs= 79if [ "$machine" = "x86_64" ]; then 80 lintlibs=no 81fi 82 83# Automatically add XFree86 version specific sets 84for list in $lists 85do 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 96done 97lists=$_lists 98unset _lists 99 100for 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 cat $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 142done | awk -- '/^[^#]/ {print $1}' | sort -u 143