: # _build -- builds a library for a specified project # # ********** Copyright 1990 by Vermont Creative Software ********** # # On some systems wildcard expansion breaks if you try to expand *.c for # vv or vvd, so this script breaks the expansion into 16 alphabetical # groups. # # When the library name is constructed, the envionment variable MODEL is # prefixed to the name. This variable will be null unless a Vermont Views # library is being built for a non-standard Xenix memory model. See the # BUILD_LIB script. if test $# -ne 3 then echo usage: _build project libtype logdir exit 1 fi case $2 in dev | prd) ;; *) echo library type must be dev or prd exit 1 ;; esac PROJECT=$1 LIBTYPE=$2 LOGFILE=$3/build.log GROUPS="[A-Z] [a-e] [f-j] k[_-e] k[f-j] k[k-o] k[p-t] k[u-z] [l-o] [p-t] [u-z] _[_-e] _[f-j] _[k-o] _[p-t] _[u-z]" # # Get rid of any existing object files # if test "`echo *.o`" != "*.o"; then rm *.o fi # # Compile and archive each file group LIBRARY=${MODEL}lib$PROJECT$LIBTYPE.a if test -f $LIBRARY; then rm $LIBRARY fi VERB="-v" echo -n "Starting $1 $2 library build: " >> $LOGFILE 2>&1 date >> $LOGFILE 2>&1 for j in $GROUPS do if test "`echo $j*.c`" != "$j*.c"; then $3/_compile $VERB $j*.c >> $LOGFILE 2>&1 ar q $LIBRARY *.o >> $LOGFILE 2>&1 rm *.o VERB="" fi done # If this system has ranlib, run the library through it to make it usable # On SCO UNIX if the archive is COFF (which it usually is) this will # produce an error message "File is not an archive", which can be ignored. if test -s /usr/bin/ranlib -o -s /bin/ranlib then ranlib $LIBRARY fi echo -n "library build complete: " >> $LOGFILE 2>&1 date >> $LOGFILE 2>&1 echo "" >> $LOGFILE 2>&1 ####### End of File #######