#  makefile pour Linux
#  (c) 01/1996 Bernard Parisse, 
#  Institut Fourier, Universit\'e de Grenoble I, 
#  F-38402 St Martin d'Heres
#  This file is part of the GNU ALGB package.
#  This program can be redistributed and modified under the terms of
#  the GNU General Public License as published by the Free Software
#  Foundation either version 2.0 or (at your option) any later version#

#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#  GNU General Public License for more details.

#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc, 675 Mass Ave, Cambridge, MA 02139, USA.
# sload 
all: algblib algb algbg arit intg quadr func matr tsimp algbus.ps algbfr.ps
	cat binhd algblib > algb.lib
	zip algb.zip fr
	zip algb.zip us
	zip algb.zip ALGBG.LIB
	zip algb.zip ALGB.LIB
	zip algb.zip ARIT
	zip algb.zip INTG
	zip algb.zip QUADR
	zip algb.zip MATR
	zip algb.zip FUNC
	zip algb.zip ALGBG
	zip algb.zip ALGB
	zip algb.zip TSIMP
	zip algb.zip risch.doc
	zip algb.zip algb.inf
	zip algb.zip copying.gnu
	zip algbdoc.zip algbus.ps
	zip algbdoc.zip algbfr.ps
algbus.ps: algbus.dvi
	dvips algbus -o algbus.ps
algbfr.ps: algbfr.dvi
	dvips algbfr -o algbfr.ps
algbfr.dvi: algbfr.tex
	latex algbfr
algbus.dvi: algbus.tex
	latex algbus
algblib : algblib.m algblib.o
	sload -e -H algblib.m
algbg : algbg.m algbg.o alhash.o
	sload -e -H algbg.m
algb : algb.m algb.o alhash.o
	sload -e -H algb.m
arit : arit.m arit.o  alhash.o
	sload -e -H arit.m
intg : intg.m intg.o  alhash.o
	sload -e -H intg.m
quadr : quadr.m quadr.o  alhash.o
	sload -e -H quadr.m
func : func.m func.o  alhash.o
	sload -e -H func.m
matr : matr.m matr.o  alhash.o
	sload -e -H matr.m
tsimp :	tsimp.m tsimp.o alhash.o
	sload -e -H tsimp.m	
# sasm
matr.o: matr.a 
	sasm -e matr.a
algbg.o: algbg.a
	sasm -e algbg.a
algb.o: algb.a 
	sasm -e algb.a
quadr.o: quadr.a 
	sasm -e quadr.a
intg.o: intg.a 
	sasm -e intg.a
func.o: func.a 
	sasm -e func.a
arit.o: arit.a 
	sasm -e arit.a
tsimp.o: tsimp.a 
	sasm -e tsimp.a
algblib.a: alhead.a alsys.a alhash.a alend.a
	cat alhead.a alsys.a alhash.a alend.a > algblib.a
algblib.o: algblib.a
	sasm -e algblib.a
alhash.o: alhash.a
	sasm -e alhash.a
# makerom
# on cree les fichiers alhead.a, alhash.a, alend.a 
# on enleve leur END finaux
# on cree le fichier d'en-tete alhash.h a inclure dans les fichiers utilisant
# ALGB
al.m: al.mn alextdec.h alromid.h
	makerom al.mn al.m
alhash.h: al.m
	echo "ASSEMBLE" > alhash.h
	awk -f equ.awk alhash0.a  >> alhash.h
	echo "RPL" >> alhash.h
alhash.a: al.m
	awk -f end.awk alhash0.a > alhash.a
alhead.a: al.m
	awk -f end.awk alhead0.a > alhead.a
alend.a: al.m
	cp alend0.a alend.a
# rplcomp
algbg.a: algbg.s alextdec.h alromid.h alhash.h
	rplcomp algbg.s algbg.a algbg.ext
algb.a: algb.s alextdec.h alromid.h alhash.h
	rplcomp algb.s algb.a algb.ext
quadr.a: quadr.s alextdec.h alromid.h alhash.h
	rplcomp quadr.s quadr.a quadr.ext
intg.a: intg.s alextdec.h alromid.h alhash.h
	rplcomp intg.s intg.a intg.ext
func.a: func.s alextdec.h alromid.h alhash.h
	rplcomp func.s func.a func.ext
matr.a: matr.s alextdec.h alromid.h alhash.h
	rplcomp matr.s matr.a matr.ext
arit.a: arit.s alextdec.h alromid.h alhash.h
	rplcomp arit.s arit.a arit.ext
tsimp.a: tsimp.s alextdec.h alromid.h alhash.h
	rplcomp tsimp.s tsimp.a tsimp.ext
alsys.s: aluser.s almain.s alsubs.s alsolv.s alsolv.g alextdec.h alromid.h\
         almsg.s alcfg.s alextdec.h alromid.h
	cat aluser.s almain.s alsubs.s almsg.s alcfg.s > alsys.s
alsys.a: alsys.s
	rplcomp alsys.s alsys.a alsys.ext
clean:
	rm alhash.h *.o *.a *.l *.lr alsys.s al.m
