makeflist revision 1.40
11.2Sgwr#!/bin/sh
21.2Sgwr#
31.40Sthorpej# $NetBSD: makeflist,v 1.40 2001/11/24 03:06:17 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.2Sgwrsetd=`pwd`
171.8Slukemnlists="base comp etc games man misc text"
181.23Sthorpejxlists="xbase xcomp xcontrib xfont xserver xmisc"
191.8Slukemlists=$nlists
201.2Sgwr
211.2Sgwr# handle args
221.8Slukemwhile : ; do
231.2Sgwr	case $1 in
241.8Slukem	-b*)
251.8Slukem		lists="$xlists $nlists"
261.8Slukem		;;
271.8Slukem	-x*)
281.8Slukem		lists=$xlists
291.8Slukem		;;
301.8Slukem	-a*)
311.39Sthorpej		machine_arch=`MACHINE_ARCH=${2} ${MAKE} print_machine_arch`
321.39Sthorpej		machine_cpu=`MACHINE_ARCH=${2} ${MAKE} print_machine_cpu`
331.39Sthorpej		shift
341.8Slukem		;;
351.8Slukem	-m*)
361.8Slukem		machine=$2; shift
371.8Slukem		;;
381.8Slukem	-s*)
391.8Slukem		setd=$2; shift
401.8Slukem		;;
411.8Slukem	-*)
421.8Slukem		cat 1>&2 <<USAGE
431.8SlukemUsage: $0 [-b] [-x] [-a arch] [-m machine] [-s setsdir] [setname ...]
441.8Slukem	-b		make netbsd + x11 lists
451.8Slukem	-x		only make x11 lists
461.40Sthorpej	-a arch		set arch (e.g, m68k, mipseb, mipsel, powerpc) [$machine_arch]
471.39Sthorpej	-m machine	set machine (e.g, amiga, i386, macppc) [$machine]
481.39Sthorpej	-s setsdir	directory to find sets [$setd]
491.39Sthorpej	[setname ...]	sets to build [$lists]
501.8SlukemUSAGE
511.8Slukem		exit 1
521.8Slukem		;;
531.8Slukem	*)
541.8Slukem		break
551.8Slukem		;;
561.2Sgwr	esac
571.2Sgwr	shift
581.2Sgwrdone
591.8Slukemif [ -n "$1" ]; then
601.8Slukem	lists="$@"
611.8Slukemfi
621.15Ssimonb
631.39Sthorpej# Determine shlib type.
641.39Sthorpejif [ "$object_fmt" = "ELF" ]; then
651.28Sitojun	shlib=elf
661.39Sthorpejelif [ "$machine_cpu" = "sh3" ]; then
671.39Sthorpej	shlib=
681.9Sjonathanelse
691.39Sthorpej	shlib=aout
701.9Sjonathanfi
711.1Scgd
721.33Smrg# Turn off lintlibs for some ports.
731.33Smrglintlibs=
741.39Sthorpejif [ "$machine" = "sparc64" -o "$machine_cpu" = "sh3" -o \
751.39Sthorpej     "$machine_arch" = "m68000" ]; then
761.33Smrg	lintlibs=no
771.33Smrgfi
781.33Smrg
791.8Slukemfor setname in $lists; do
801.29Sjwise	cat $setd/lists/$setname/mi
811.39Sthorpej	if [ "$machine" != "$machine_arch" -a \
821.39Sthorpej	     -f $setd/lists/$setname/ad.${machine_cpu} ]; then
831.39Sthorpej		cat $setd/lists/$setname/ad.${machine_cpu}
841.8Slukem	fi
851.8Slukem	if [ -f $setd/lists/$setname/md.${machine} ]; then
861.29Sjwise		cat $setd/lists/$setname/md.${machine}
871.9Sjonathan	fi
881.9Sjonathan	if [ "$shlib" != "" ]; then
891.9Sjonathan		if [ -f $setd/lists/$setname/shl.mi ]; then
901.29Sjwise			cat $setd/lists/$setname/shl.mi
911.9Sjonathan		fi
921.9Sjonathan		if [ -f $setd/lists/$setname/shl.${shlib} ]; then
931.29Sjwise			cat $setd/lists/$setname/shl.${shlib}
941.33Smrg		fi
951.33Smrg	fi
961.33Smrg	if [ "$lintlibs" != no ]; then
971.33Smrg		if [ -f $setd/lists/$setname/lint.mi ]; then
981.33Smrg			cat $setd/lists/$setname/lint.mi
991.36Sjmc		fi
1001.36Sjmc	fi
1011.38Stv	if [ "$tc" = "yes" ]; then
1021.36Sjmc		if [ -f $setd/lists/$setname/tc.mi ]; then
1031.36Sjmc			cat $setd/lists/$setname/tc.mi
1041.36Sjmc		fi
1051.36Sjmc	else
1061.36Sjmc		if [ -f $setd/lists/$setname/tc.old ]; then
1071.36Sjmc			cat $setd/lists/$setname/tc.old
1081.9Sjonathan		fi
1091.8Slukem	fi
1101.29Sjwisedone | egrep -v '^#' | awk -- '{print $1}' | sort -u
111