######################################################################
#
#  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; ./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/LiDIA
	-mkdir bin/LiDIA/$(LIDIA_ARCH)
	-mkdir $(LIDIA_BIN)
	-mkdir lib/LiDIA
	-mkdir lib/LiDIA/$(LIDIA_ARCH)
	-mkdir $(LIDIA_LIB)
	cd src; make

#
# 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/manual; make dvi

ps:	
	cd doc/manual; make ps

html:
	cd doc/manual/html ; make
	echo "execute latex2html lidiahtml.tex"
#	cd doc/manual/html ; latex2html lidiahtml.tex

#
# install the libraries and the include
# files of LiDIA on LIDIA_INSTALL_DIR
# see config/config.arch
#
#install:
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/CPP
# and LiDIA/lib/LIDIA_ARCH/CPP
#

distclean:	veryclean  
	-rm -r lib/LiDIA
	-rm -r bin/LiDIA

#
# end of makefile
#
