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