#!/bin/csh
# --- Copyright University of Sussex 1987.  All rights reserved. ---------
# File:         C.pwm/com/mkpwmtool
# Purpose:      compile and link new sun pwmtool
# Author:       Ben Rubinstein, Feb 20 1987 (see revisions)

#
#   make a "pwmtool" in $popsys from source files in $usepop/pop/pwm
#   this is unsuitable for those who only get the .o files
#
cd $usepop/pop/pwm

echo -n "MAKING NEW PWMTOOL IN "
pwd

# create a makefile with $popsys and date expanded

# assuming Sun3 in the case of not(sun2) may be bad...
if { sun2 } then
		set sun=sun2
else
		set sun=sun3
endif

cat > Makefile_temp << ***
PWMID_MACH = '"$sun"'
PWMID_DATE = '"`date | awk '{printf "%s %s %s %s", \$1, \$2, \$3, \$6}'`"'
OBJECT = $popsys/pwmtool
PREFIX = pw
COM = cc -s
***

make -f Makefile_temp -f private.make
rm Makefile_temp

echo "NEW PWMTOOL MADE"
ls -l $popsys/*pwm*

# --- Revision History ---------------------------------------------------
# --- Roger Evans, Jun 15 1988 - renamed Makefile private.make to
#     discourage independant use
# --- Aled Morris, May 31 1988 - no longer assumes Sun-3 (but it still
#       assumes it's a Sun-2 or 3)
# --- Ben Rubinstein, Mar  4 1987 - no longer asks you to set sticky bit
