makeflist revision 1.48
11.2Sgwr#!/bin/sh 21.2Sgwr# 31.48Sfredette# $NetBSD: makeflist,v 1.48 2002/07/17 23:34:20 fredette 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.48Sfredette if [ "$machine" != "$machine_arch" ]; then 1031.48Sfredette if [ -f $setd/lists/$setname/ad.${machine_cpu} ]; then 1041.48Sfredette cat $setd/lists/$setname/ad.${machine_cpu} 1051.48Sfredette fi 1061.48Sfredette if [ "$shlib" != "no" -a \ 1071.48Sfredette -f $setd/lists/$setname/ad.${machine_cpu}.shl ]; then 1081.48Sfredette cat $setd/lists/$setname/ad.${machine_cpu}.shl 1091.48Sfredette fi 1101.8Slukem fi 1111.8Slukem if [ -f $setd/lists/$setname/md.${machine} ]; then 1121.29Sjwise cat $setd/lists/$setname/md.${machine} 1131.9Sjonathan fi 1141.43Sfredette if [ -f $setd/lists/$setname/stl.mi ]; then 1151.43Sfredette cat $setd/lists/$setname/stl.mi 1161.43Sfredette fi 1171.43Sfredette if [ -f $setd/lists/$setname/stl.${stlib} ]; then 1181.43Sfredette cat $setd/lists/$setname/stl.${stlib} 1191.43Sfredette fi 1201.43Sfredette if [ "$shlib" != "no" ]; then 1211.9Sjonathan if [ -f $setd/lists/$setname/shl.mi ]; then 1221.29Sjwise cat $setd/lists/$setname/shl.mi 1231.9Sjonathan fi 1241.9Sjonathan if [ -f $setd/lists/$setname/shl.${shlib} ]; then 1251.29Sjwise cat $setd/lists/$setname/shl.${shlib} 1261.33Smrg fi 1271.33Smrg fi 1281.33Smrg if [ "$lintlibs" != no ]; then 1291.33Smrg if [ -f $setd/lists/$setname/lint.mi ]; then 1301.33Smrg cat $setd/lists/$setname/lint.mi 1311.36Sjmc fi 1321.36Sjmc fi 1331.38Stv if [ "$tc" = "yes" ]; then 1341.36Sjmc if [ -f $setd/lists/$setname/tc.mi ]; then 1351.36Sjmc cat $setd/lists/$setname/tc.mi 1361.46Sthorpej fi 1371.46Sthorpej if [ "$shlib" != "no" ]; then 1381.46Sthorpej if [ -f $setd/lists/$setname/tc.shl ]; then 1391.47Snathanw cat $setd/lists/$setname/tc.shl 1401.46Sthorpej fi 1411.36Sjmc fi 1421.36Sjmc else 1431.36Sjmc if [ -f $setd/lists/$setname/tc.old ]; then 1441.36Sjmc cat $setd/lists/$setname/tc.old 1451.9Sjonathan fi 1461.8Slukem fi 1471.42Slukemdone | awk -- '/^[^#]/ {print $1}' | sort -u 148