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