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