######################################################################
#
#  Name ............................................... LiDIA/makefile 
#
#  Architecture : sparc7, sparc8, mips, alpha, rs6000, hp9000/7xx 
#  Compiler     : gcc, g++, CC, cc, CodeWarrior-4.5 
#  Flags        : -g -O2
#  Program Flags: -DDEBUG, -DMEMORY, -DERRIGN 
#  Author       : Thomas Papanikolaou (TP) 
#  Release      : 1.0 
#  Last Change  : Mon Apr 11 16:09:08 MET DST 1994 
#  Copyright    : by the LiDIA Group, 1995
#

include config/CONFIG

#
# build the whole system
#

all:	build

#
# run the configure script to guess the compilers/flags
# etc to use
#

configure:
	cd config; $(MAKE) clean
	cd config; $(MAKE) conf 
	cd src; $(MAKE) configure

#
# change target architecture to OS/2
# (uses commands of the standard OS/2-Shell CMD.EXE,
#  i.e. this won't work on unix-systems!!)
#

os2:
	-del config\CONFIG 
	move config\CONFIG.os2 config\CONFIG
	-move makefile makefile.unix
	move makefile.os2 makefile
	-del config\config.h
	move config\configh.os2 config\config.h
	copy config\config.h include\LiDIA\config.h
	@echo Successfully installed the files for OS/2.

unix:
	@echo The UNIX-makefile is already installed.

#
# run the 'make' command in the src directory
#

build:
	-mkdir bin$(DIRSEP)LiDIA
	-mkdir bin$(DIRSEP)LiDIA$(DIRSEP)$(LIDIA_ARCH)
	-mkdir $(LIDIA_BIN)
	-mkdir lib$(DIRSEP)LiDIA
	-mkdir lib$(DIRSEP)LiDIA$(DIRSEP)$(LIDIA_ARCH)
	-mkdir $(LIDIA_LIB)
	cd src; $(MAKE)
	$(RANLIB) $(LIDIA_LIB)$(DIRSEP)$(libp)LiDIA.a

#
# uncomment the following to avoid the calls
# of ar and ranlib
#appl:	build
appl:
	cd src; $(MAKE) appl

#
# make documentation in doc/manual 
# 

dvi:	
	cd doc$(DIRSEP)manual; $(MAKE) dvi

ps:	
	cd doc$(DIRSEP)manual; $(MAKE) ps

html:
	cd doc$(DIRSEP)manual$(DIRSEP)html ; $(MAKE)
	echo "execute latex2html lidiaman.tex"
#	cd doc$(DIRSEP)manual$(DIRSEP)html ; latex2html lidiahtml.tex

#
# install the libraries and the include
# files of LiDIA on LIDIA_INSTALL_DIR
# see config/config.arch
#

install:	build
	cd src; $(MAKE) install


#
# clean the object and ecxecutables produced 
# through compilation
#

clean:		
	cd src; $(MAKE) clean

#
# clean additionaly the libraries produced 
#

veryclean:	
	cd src; $(MAKE) veryclean

#
# run '$(MAKE) veryclean' on all subdirectories
# remove the directories LiDIA/bin/LIDIA_ARCH/CXX
# and LiDIA/lib/LIDIA_ARCH/CXX
#

distclean:	veryclean  
	-$(RMR)   lib$(DIRSEP)LiDIA
	-$(RMR)   bin$(DIRSEP)LiDIA

#
# end of makefile
#
