makeflist revision 1.46
11.2Sgwr#!/bin/sh
21.2Sgwr#
31.46Sthorpej# $NetBSD: makeflist,v 1.46 2002/05/05 01:24:24 thorpej Exp $
41.2Sgwr#
51.8Slukem# Print out the files in some or all lists.
61.8Slukem# Usage: makeflist [-b] [-x] [-a arch] [-m machine] [-s setsdir] [setname ...]
71.2Sgwr#
81.2Sgwr
91.2Sgwr# set defaults
101.14Sitohy: ${MAKE=make}
111.39Sthorpejmachine=`${MAKE} print_machine`
121.39Sthorpejmachine_arch=`${MAKE} print_machine_arch`
131.39Sthorpejmachine_cpu=`${MAKE} print_machine_cpu`
141.39Sthorpejobject_fmt=`${MAKE} print_object_fmt`
151.39Sthorpejtc=`${MAKE} print_use_new_toolchain`
161.41Stronx11_version=`${MAKE} print_x11_version`
171.2Sgwrsetd=`pwd`
181.8Slukemnlists="base comp etc games man misc text"
191.44Stronxlists="xbase xcomp xcontrib xfont xserver xmisc"
201.8Slukemlists=$nlists
211.2Sgwr
221.2Sgwr# handle args
231.8Slukemwhile : ; do
241.2Sgwr	case $1 in
251.8Slukem	-b*)
261.8Slukem		lists="$xlists $nlists"
271.8Slukem		;;
281.8Slukem	-x*)
291.8Slukem		lists=$xlists
301.8Slukem		;;
311.8Slukem	-a*)
321.39Sthorpej		machine_arch=`MACHINE_ARCH=${2} ${MAKE} print_machine_arch`
331.39Sthorpej		machine_cpu=`MACHINE_ARCH=${2} ${MAKE} print_machine_cpu`
341.39Sthorpej		shift
351.8Slukem		;;
361.8Slukem	-m*)
371.8Slukem		machine=$2; shift
381.8Slukem		;;
391.8Slukem	-s*)
401.8Slukem		setd=$2; shift
411.8Slukem		;;
421.8Slukem	-*)
431.8Slukem		cat 1>&2 <<USAGE
441.8SlukemUsage: $0 [-b] [-x] [-a arch] [-m machine] [-s setsdir] [setname ...]
451.8Slukem	-b		make netbsd + x11 lists
461.8Slukem	-x		only make x11 lists
471.40Sthorpej	-a arch		set arch (e.g, m68k, mipseb, mipsel, powerpc) [$machine_arch]
481.39Sthorpej	-m machine	set machine (e.g, amiga, i386, macppc) [$machine]
491.39Sthorpej	-s setsdir	directory to find sets [$setd]
501.39Sthorpej	[setname ...]	sets to build [$lists]
511.8SlukemUSAGE
521.8Slukem		exit 1
531.8Slukem		;;
541.8Slukem	*)
551.8Slukem		break
561.8Slukem		;;
571.2Sgwr	esac
581.2Sgwr	shift
591.2Sgwrdone
601.8Slukemif [ -n "$1" ]; then
611.8Slukem	lists="$@"
621.8Slukemfi
631.15Ssimonb
641.43Sfredette# Determine lib type.
651.39Sthorpejif [ "$object_fmt" = "ELF" ]; then
661.28Sitojun	shlib=elf
671.9Sjonathanelse
681.39Sthorpej	shlib=aout
691.9Sjonathanfi
701.43Sfredettestlib=$shlib
711.43Sfredette
721.43Sfredette# Turn off shlibs for some ports.
731.43Sfredetteif [ "$machine_cpu" = "sh3" -o "$machine_arch" = "m68000" ]; then
741.43Sfredette	shlib=no
751.43Sfredettefi
761.1Scgd
771.33Smrg# Turn off lintlibs for some ports.
781.33Smrglintlibs=
791.45Swizif [ "$machine" = "x86_64" ]; then
801.33Smrg	lintlibs=no
811.33Smrgfi
821.44Stron
831.44Stron# Automatically add XFree86 version specific sets
841.44Stronfor list in $lists
851.44Strondo
861.44Stron if [ -z "$_lists" ]
871.44Stron then
881.44Stron  _lists=$list
891.44Stron else
901.44Stron  _lists="$_lists $list"
911.44Stron fi
921.44Stron if [ -d "$setd/lists/$list${x11_version}" ]
931.44Stron then
941.44Stron  _lists="$_lists $list${x11_version}"
951.44Stron fi
961.44Strondone
971.44Stronlists=$_lists
981.44Stronunset _lists
991.33Smrg
1001.8Slukemfor setname in $lists; do
1011.29Sjwise	cat $setd/lists/$setname/mi
1021.39Sthorpej	if [ "$machine" != "$machine_arch" -a \
1031.39Sthorpej	     -f $setd/lists/$setname/ad.${machine_cpu} ]; then
1041.39Sthorpej		cat $setd/lists/$setname/ad.${machine_cpu}
1051.8Slukem	fi
1061.8Slukem	if [ -f $setd/lists/$setname/md.${machine} ]; then
1071.29Sjwise		cat $setd/lists/$setname/md.${machine}
1081.9Sjonathan	fi
1091.43Sfredette	if [ -f $setd/lists/$setname/stl.mi ]; then
1101.43Sfredette		cat $setd/lists/$setname/stl.mi
1111.43Sfredette	fi
1121.43Sfredette	if [ -f $setd/lists/$setname/stl.${stlib} ]; then
1131.43Sfredette		cat $setd/lists/$setname/stl.${stlib}
1141.43Sfredette	fi
1151.43Sfredette	if [ "$shlib" != "no" ]; then
1161.9Sjonathan		if [ -f $setd/lists/$setname/shl.mi ]; then
1171.29Sjwise			cat $setd/lists/$setname/shl.mi
1181.9Sjonathan		fi
1191.9Sjonathan		if [ -f $setd/lists/$setname/shl.${shlib} ]; then
1201.29Sjwise			cat $setd/lists/$setname/shl.${shlib}
1211.33Smrg		fi
1221.33Smrg	fi
1231.33Smrg	if [ "$lintlibs" != no ]; then
1241.33Smrg		if [ -f $setd/lists/$setname/lint.mi ]; then
1251.33Smrg			cat $setd/lists/$setname/lint.mi
1261.36Sjmc		fi
1271.36Sjmc	fi
1281.38Stv	if [ "$tc" = "yes" ]; then
1291.36Sjmc		if [ -f $setd/lists/$setname/tc.mi ]; then
1301.36Sjmc			cat $setd/lists/$setname/tc.mi
1311.46Sthorpej		fi
1321.46Sthorpej		if [ "$shlib" != "no" ]; then
1331.46Sthorpej			if [ -f $setd/lists/$setname/tc.shl ]; then
1341.46Sthorpej				$setd/lists/$setname/tc.shl
1351.46Sthorpej			fi
1361.36Sjmc		fi
1371.36Sjmc	else
1381.36Sjmc		if [ -f $setd/lists/$setname/tc.old ]; then
1391.36Sjmc			cat $setd/lists/$setname/tc.old
1401.9Sjonathan		fi
1411.8Slukem	fi
1421.42Slukemdone | awk -- '/^[^#]/ {print $1}' | sort -u
143