
#####
#	LINUX RedHat 5.0 (TESTED) EGCS Compilers
#####
CCMP		=gcc   -g
#### 
# this creates a PLOT file
CALPLOT	=../../lib/libcalpltc.a 
LDFLAGS	= -lm
####
# this creates tektronix output
#CALPLOT	=../../lib/libcaltekc.a -lbsd
#LDFLAGS	= -lm
####
# this creates interactive X11 output
#CALPLOT		=../../lib/libcalxvigc.a  ../../lib/calxvig.a
#LDFLAGS		=  -L/usr/X11R6/lib  -lX11 -lm
#####


###############################################################
#	All this should not have to be changed
###############################################################

RM = rm -f


.c.o:
	$(CCMP) -c $<

calplot.h:
	cp ../include/calplot.h .

all: button cdraw clip dtest gphtxt graysc gread \
	grid grytst new nseitst plttst stars \
	tabl testl testld \
	tritst tstcrs tstcur wid width xor \
	clean

button:	button.o calplot.h
	$(CCMP) button.o $(CALPLOT) $(LDFLAGS)
	mv a.out button
	button

clip :	clip.o calplot.h
	$(CCMP) clip.o $(CALPLOT) $(LDFLAGS)
	mv a.out clip
	clip
	mv INTER CLIP.PLT

cdraw:	cdraw.o calplot.h
	$(CCMP) cdraw.o $(CALPLOT) $(LDFLAGS)
	mv a.out cdraw
	cdraw

dtest: dtest.o calplot.h
	$(CCMP) dtest.o $(CALPLOT) $(LDFLAGS) -lm 
	mv a.out  dtest
	rm dtest.o
	dtest

gphtxt: gphtxt.o calplot.h
	$(CCMP) gphtxt.o $(CALPLOT) $(LDFLAGS) -lm 
	mv a.out  gphtxt
	rm gphtxt.o
	gphtxt
	mv INTER GPHTXT.PLT

graysc: graysc.o calplot.h
	$(CCMP) graysc.o $(CALPLOT) $(LDFLAGS) -lm 
	mv a.out  graysc
	rm graysc.o
	graysc

grid:	grid.o calplot.h
	$(CCMP) grid.o $(CALPLOT) $(LDFLAGS)
	mv a.out grid
	grid

grytst: grytst.o calplot.h
	$(CCMP) grytst.o $(CALPLOT) $(LDFLAGS) -lm 
	mv a.out  grytst
	rm grytst.o
	grytst

new:	new.o calplot.h
	$(CCMP) new.o $(CALPLOT) $(LDFLAGS)
	mv a.out new
	new

nseitst: nseitst.o calplot.h
	$(CCMP) nseitst.o $(CALPLOT) $(LDFLAGS) -lm 
	mv a.out  nseitst
	rm nseitst.o
	nseitst

plttst: plttst.o calplot.h
	$(CCMP) plttst.o $(CALPLOT) $(LDFLAGS) -lm 
	mv a.out  plttst
	rm plttst.o
	plttst
	reframe -N1 -O < PLTTST.PLT > PLTTST.1
	reframe -N2 -O < PLTTST.PLT > PLTTST.2

stars:	stars.o calplot.h
	$(CCMP) stars.o $(CALPLOT) $(LDFLAGS)
	mv a.out stars
	stars

gread:	gread.o calplot.h
	$(CCMP) gread.o $(CALPLOT) $(LDFLAGS)
	mv a.out gread
	gread
	

tabl: tabl.o calplot.h
	$(CCMP) tabl.o $(CALPLOT) $(LDFLAGS) -lm 
	mv a.out  tabl
	rm tabl.o
	tabl

testl: testl.o calplot.h
	$(CCMP) testl.o $(CALPLOT) $(LDFLAGS) -lm 
	mv a.out  testl
	rm testl.o
	testl

testld: testld.o calplot.h
	$(CCMP) testld.o $(CALPLOT) $(LDFLAGS) -lm 
	mv a.out  testld
	rm testld.o
	testld

tritst: tritst.o calplot.h
	$(CCMP) tritst.o $(CALPLOT) $(LDFLAGS) -lm 
	mv a.out  tritst
	rm tritst.o
	tritst

tstcrs:	tstcrs.o calplot.h
	$(CCMP) tstcrs.o $(CALPLOT) $(LDFLAGS) -lm 
	mv a.out  tstcrs
	rm tstcrs.o
	tstcrs

tstcur: tstcur.o calplot.h
	$(CCMP) tstcur.o $(CALPLOT) $(LDFLAGS) -lm 
	mv a.out  tstcur
	rm tstcur.o
	tstcur

wid: wid.o calplot.h
	$(CCMP) wid.o $(CALPLOT) $(LDFLAGS) -lm 
	mv a.out  wid
	rm wid.o
	wid
	

width: width.o calplot.h
	$(CCMP) width.o $(CALPLOT) $(LDFLAGS) -lm 
	mv a.out  width
	rm width.o
	width

xor:	xor.o calplot.h
	$(CCMP) xor.o $(CALPLOT) $(LDFLAGS)
	mv a.out xor
	xor

clean:
	rm -f *.o


