makeflist revision 1.63
1#!/bin/sh 2# 3# $NetBSD: makeflist,v 1.63 2003/09/21 19:26:03 tron 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 10make="${MAKE:-make} -j 1 -f `dirname $0`/Makefile" 11machine=`${make} print_machine` 12machine_arch=`${make} print_machine_arch` 13machine_cpu=`${make} print_machine_cpu` 14object_fmt=`${make} print_object_fmt` 15toolchain_missing=`${make} print_toolchain_missing` 16use_tools_toolchain=`${make} print_use_tools_toolchain` 17x11_version=`${make} print_x11_version` 18setd=`pwd` 19nlists="base comp etc games man misc text" 20if [ "`${make} print_have_gcc3`" != yes ] 21then 22 nlists="$nlists gcc" 23fi 24xlists="xbase xcomp xcontrib xfont xserver xmisc" 25lists=$nlists 26 27. ./sets.subr 28 29# handle args 30while : ; do 31 case $1 in 32 -b*) 33 lists="$xlists $nlists" 34 ;; 35 -x*) 36 lists=$xlists 37 ;; 38 -a*) 39 machine_arch=`MACHINE_ARCH=${2} ${make} print_machine_arch` 40 machine_cpu=`MACHINE_ARCH=${2} ${make} print_machine_cpu` 41 shift 42 ;; 43 -m*) 44 machine=$2; shift 45 ;; 46 -s*) 47 setd=$2; shift 48 ;; 49 -*) 50 cat 1>&2 <<USAGE 51Usage: $0 [-b] [-x] [-a arch] [-m machine] [-s setsdir] [setname ...] 52 -b make netbsd + x11 lists 53 -x only make x11 lists 54 -a arch set arch (e.g, m68k, mipseb, mipsel, powerpc) [$machine_arch] 55 -m machine set machine (e.g, amiga, i386, macppc) [$machine] 56 -s setsdir directory to find sets [$setd] 57 [setname ...] sets to build [$lists] 58USAGE 59 exit 1 60 ;; 61 *) 62 break 63 ;; 64 esac 65 shift 66done 67if [ -n "$1" ]; then 68 lists="$@" 69fi 70 71# Determine lib type. 72if [ "$object_fmt" = "ELF" ]; then 73 shlib=elf 74else 75 shlib=aout 76fi 77stlib=$shlib 78 79# Turn off shlibs for some ports. 80if [ "$machine_cpu" = "sh3" -o "$machine_arch" = "m68000" ]; then 81 shlib=no 82fi 83lkm=yes 84# Turn off LKMs for some ports. 85if [ "$machine" = "evbppc" ]; then 86 lkm=no 87fi 88 89# Turn off lintlibs for some ports. 90# Not needed anymore, leave the hook here for future use. 91lintlibs= 92 93# Automatically add XFree86 version specific sets 94for list in $lists 95do 96 if [ -z "$_lists" ] 97 then 98 _lists=$list 99 else 100 _lists="$_lists $list" 101 fi 102 if [ -d "$setd/lists/$list${x11_version}" ] 103 then 104 _lists="$_lists $list${x11_version}" 105 fi 106done 107lists=$_lists 108unset _lists 109 110for setname in $lists; do 111 list_set_files $setname 112done | awk -- '/^[^#]/ {print $1}' | sort -u 113