CFLAGS=-O3
CPPFLAGS=-g -I/usr/X11R6/include
LDFLAGS=-L /usr/X11R6/lib -lm -lX11 -lXi -lXmu -lMesaGL -lMesaGLU \
  -lglut -lg++ -lstdc++
all:		glpoisson glvibration

clean:
		rm -f test *.o *.bak core rndtest gaustest ee stockPrices \
		ee8 glpoisson crankNicholson a.out glvibration priceOption \
		*~ *.aux *.dvi *.log toetsmat

glpoisson:	glpoisson.o gauselim.o biblioteek.o

#		ld $(LDFLAGS) glpoisson.o gauselim.o

glpoisson.o:	glpoisson.cc matriks.h eElement.h grafika.h

glvibration:	glvibration.o gauselim.o biblioteek.o

glvibration.o:	glvibration.cc matriks.h eElement.h grafika.h

toetsmat:	toetsmat.cc biblioteek.o gauselim.o

ee8:		ee8.o gauselim.o biblioteek.o

ee8.o:		ee8.cc matriks.h eElement.h

biblioteek.o:	biblioteek.cc grafika.h eElement.h matriks.h

gaustest:       gaustest.o gauselim.o

gaustest.o:     gaustest.c gauselim.h

gauselim.o:     gauselim.c gauselim.h

test:		test.o stats.o

test.o:		test.c mathlib.h

stats.o:	stats.c mathlib.h

stockPrices:	stockPrices.o stats.o

stockPrices.o:	stockPrices.cc mathlib.h

rndtest:	rndtest.o stats.o

rndtest.o:	rndtest.c mathlib.h

winAcar:	winAcar.o stats.o

winAcar.o:	winAcar.c mathlib.h

crankNicholson:	crankNicholson.o gauselim.o

crankNicholson.o:	crankNicholson.c gauselim.h

ee:		ee.o gauselim.o

ee.o:		ee.c mathlib.h gauselim.h

dos:
		su -c "ascii-xfr -s ee8.cc >/dosd/borlandc/ee/ee8.cpp; \
		ascii-xfr -s matriks.h >/dosd/borlandc/ee/matriks.h; \
		ascii-xfr -s eElement.h >/dosd/borlandc/ee/eelement.h; \
		ascii-xfr -s gauselim.h >/dosd/borlandc/ee/gauselim.h; \
		ascii-xfr -s gauselim.c >/dosd/borlandc/ee/gauselim.c"

rpm:		clean
		su -c "(cd ..; \
		tar czf /usr/src/redhat/SOURCES/glpoisson.tgz glpoisson) && \
		cp glpoisson.tex /dosc/sigma ; \
		cp glpoisson.spec /usr/src/redhat/SPECS && \
		cp glpoisson.gif /usr/src/redhat/SOURCES && \
		cd /usr/lib; ln -sf xx26 libMesaGL.so.2.6 && \
		cd /usr/src/redhat/SPECS; rpm -ba glpoisson.spec --clean; \
		cp ../RPMS/i386/glp*.rpm ../SRPMS/glp*.rpm /dosc/sigma; \
		cd /usr/lib; ln -sf x26 libMesaGL.so.2.6; \
		cd /dosc/sigma; rm -rf glpoisson; dlh -f glpoisson.tex;\
		rm -f /dosc/sigma/glpoisson.tex"

install:
		install -s -m 755 -o 0 -g 0 glpoisson glvibration /usr/bin; \
		install -m 755 -o 0 -g 0 glvibrationunstable /usr/bin; \
		mkdir /usr/lib/glpoisson 2>&1 >/dev/null; \
		chmod a+rx /usr/lib/glpoisson; \
		install -m 644 -o 0 -g 0 *.fig /usr/lib/glpoisson
