# Makefile for xvmstat
# Written by
# Roy Williams, California Institute of Technology 
# Jim Souder, Intel Supercomputing Systems Division
# February 1994

# The C compiler for the X-server which shows the display
WORKSTATION_CC =   cc

# The C compiler for the Paragon
PARAGON_CC =       icc

# The place in the file system that the X-servar can read
#    the file is ROOT/DFLTMACHINE/xvmstat.dat
ROOT=              /usr/local/lib
DFLTMACHINE=       trex

# The interval in seconds between writes by the Paragon daemon
INTERVAL=          15

#-------------------------------------------------------------
all: xvmstat xvmstatd myphysnode
	cp ./xvmstat.dat ${ROOT}/${DFLTMACHINE}/xvmstat.dat
	chmod 666 ${ROOT}/${DFLTMACHINE}/xvmstat.dat

xvmstat: xvmstat.c xdriv.c
	cc -I/usr/local/X11/include -O -o xvmstat xvmstat.c xdriv.c -lX11 \
		-DFILEROOT=\"${ROOT}\" \
		-DDEFAULTMACHINE=\"${DFLTMACHINE}\"

xvmstatd: xvmstatd.c
	icc -DINTERVAL=${INTERVAL} -o xvmstatd xvmstatd.c -lnx \
		-DDEFAULT_FILE=\"${ROOT}/${DFLTMACHINE}/xvmstat.dat\"

myphysnode: myphysnode.c
	icc -o myphysnode myphysnode.c -lnx

tar: 
	(cd ..; tar cvf xvmstat.tar xvmstat/Readme.* xvmstat/*.c xvmstat/*.icon xvmstat/Makefile xvmstat/*.dat; mv xvmstat.tar xvmstat;)

shar: 
	shar Readme.* *.c *.icon Makefile *.dat > xvmstat.shar

clean:
	rm -f *.o *.shar xvmstat xvmstatd myphysnode
