

IDEFS = -I/usr/include/tcl -DDOUBLE -I/usr/local/plplot/include -I/usr/X11/include -I/usr/local/include
L1DEFS = -L/usr/local/plplot/lib -lplplotdtk -L/usr/local/lib -L/usr/lib -L/usr/X11/lib -lf2c 
L2DEFS = -ltk -ltcl -lX11 -lieee -lm
DDEFS = -Wall -ggdb

plplot/graphic.o:	plplot/graphic.c
	(cd plplot; cc $(DDEFS) $(IDEFS) -c graphic.c -o graphic.o) 
	(cd plplot; ar rcs libxbwexp.a graphic.o $(L1DEFS) )

all:	plplot/graphic.o
	makemfx runexp.h       # create MFX communication files from runexp.h
	cc -c runexp.c -o runexp.o $(DDEFS)
	cc -o runexp runexp.o -lgraphic/libxbwexp.a $(L2DEFS)
	runexp -M              # this creates all .mfx files
	#xbw runexpwdw         # user interface for runexp.c (automatic version)
	xbw startexp           # user interface; handmade version

clean:
	rm -f *~
	rm -f runexp
	rm -f *.xbc *.xbh *mfx.c
	rm -f *.o
	rm -f *.mfx
	rm -f xbmfx.*
	rm -f *mfx.mta
	rm -f *wdw.mta
