######################################################################
#
#  Name ................................................. src makefile 
#
#  Architecture : sparc7, sparc8, mips, linux, hp, os2 
#  Compiler     : gcc, g++ 
#  Flags        : -g -O2
#  Program Flags: -DDEBUG, -DMEMORY, -DERRIGN 
#  Author       : Papanikolaou Thomas & Stefan Neis
#  Release      : 1.0 
#  Last Change  : Mon Apr 11 16:09:08 MET DST 1994 
#  Copyright    : by the University of Saarland, 1994 
#

#
# include the configuration file
#

include ../config/CONFIG

#
# call 'make' for all subdirectories
#

default:
	cd c_kernel $(SEP) make 
	cd system $(SEP) make 
	cd interfaces $(SEP) make 
	cd interfaces$(DIRSEP)lib $(SEP) make 
	cd simple_classes $(SEP) make 
	cd simple_classes$(DIRSEP)factorization $(SEP) make 
	cd simple_classes$(DIRSEP)bigint_matrix $(SEP) make 
	cd simple_classes$(DIRSEP)lattice $(SEP) make 
	cd templates $(SEP) make 
	cd packages$(DIRSEP)discrete_log$(DIRSEP)pohlig_hellman $(SEP) make

#
# call 'make appl' for all subdirectories
#

appl:
	cd system $(SEP) make appl
	cd interfaces $(SEP) make appl
	cd interfaces$(DIRSEP)lib $(SEP) make appl
	cd simple_classes $(SEP) make appl
	cd simple_classes$(DIRSEP)factorization $(SEP) make appl
	cd simple_classes$(DIRSEP)bigint_matrix $(SEP) make appl
	cd simple_classes$(DIRSEP)lattice $(SEP) make appl
	cd templates $(SEP) make appl
	cd packages$(DIRSEP)discrete_log$(DIRSEP)pohlig_hellman $(SEP) make appl

#
# create the directories 
#
#          LIDIA_INSTALL_DIR/include
#          LIDIA_INSTALL_DIR/include/LiDIA
#          LIDIA_INSTALL_DIR/bin
#          LIDIA_INSTALL_DIR/bin/LiDIA
#          LIDIA_INSTALL_DIR/bin/LiDIA/ARCH
#          LIDIA_INSTALL_DIR/bin/LiDIA/ARCH/CPP
#          LIDIA_INSTALL_DIR/lib
#          LIDIA_INSTALL_DIR/lib/LiDIA
#          LIDIA_INSTALL_DIR/lib/LiDIA/ARCH
#          LIDIA_INSTALL_DIR/lib/LiDIA/ARCH/CPP
#
# if they do not already exist. LIDIA_INSTALL_DIR
# must be a valid directory. 'createdir' is needed
# by 'install'
#

createdir:
	-mkdir $(LIDIA_INSTALL_DIR)$(DIRSEP)include
	-mkdir $(LIDIA_INSTALL_DIR)$(DIRSEP)include$(DIRSEP)LiDIA
	-mkdir $(LIDIA_INSTALL_DIR)$(DIRSEP)bin
	-mkdir $(LIDIA_INSTALL_DIR)$(DIRSEP)bin$(DIRSEP)LiDIA
	-mkdir $(LIDIA_INSTALL_DIR)$(DIRSEP)bin$(DIRSEP)LiDIA$(DIRSEP)$(LIDIA_ARCH)
	-mkdir $(LIDIA_INSTALL_BIN)
	-mkdir $(LIDIA_INSTALL_DIR)$(DIRSEP)lib
	-mkdir $(LIDIA_INSTALL_DIR)$(DIRSEP)lib$(DIRSEP)LiDIA
	-mkdir $(LIDIA_INSTALL_DIR)$(DIRSEP)lib$(DIRSEP)LiDIA$(DIRSEP)$(LIDIA_ARCH)
	-mkdir $(LIDIA_INSTALL_LIB)

#
# install the LiDIA/include/LiDIA directory to
# LIDIA_INSTALL_INC; use recursive preserving
# copying to do this
#

installh:
	-$(CPR) $(LIDIA_INC)$(DIRSEP)LiDIA$(DIRSEP)* $(LIDIA_INSTALL_INC)$(DIRSEP)LiDIA

#
# install the LiDIA/bin/ARCH directory to
# LIDIA_INSTALL_BIN; use recursive preserving
# copying to do this
#

installbin:
	-$(CPR) $(LIDIA_BIN)$(DIRSEP)* $(LIDIA_INSTALL_BIN)

#
# install the LiDIA/lib/ARCH directory to
# LIDIA_INSTALL_LIB; use recursive preserving
# copying to do this
#

installlib:
	-$(CP) $(LIDIA_LIB)$(DIRSEP)$(libp)LiDIA.a $(LIDIA_INSTALL_LIB)
	$(RANLIB) $(LIDIA_INSTALL_LIB)$(DIRSEP)$(libp)LiDIA.a 

#
# install the include files, the binaries and libraries of LiDIA to
# LIDIA_INSTALL_INC
#

install:	createdir installh installlib installbin
	-$(CP) $(LIDIA_PRIMES)$(DIRSEP)LIDIA_PRIMES $(LIDIA_INSTALL_PRIMES)

#
# run 'make clean' on all subdirectories
#

clean:
	cd c_kernel $(SEP) make clean
	cd system $(SEP) make clean
	cd interfaces $(SEP) make clean
	cd interfaces$(DIRSEP)lib $(SEP) make clean
	cd simple_classes $(SEP) make clean
	cd simple_classes$(DIRSEP)factorization $(SEP) make clean
	cd simple_classes$(DIRSEP)bigint_matrix $(SEP) make clean
	cd simple_classes$(DIRSEP)lattice $(SEP) make clean
	cd templates $(SEP) make clean
	cd packages$(DIRSEP)discrete_log$(DIRSEP)pohlig_hellman $(SEP) make clean
	cd ../config $(SEP) make clean

#
# run 'make veryclean' on all subdirectories
#

veryclean:
	cd c_kernel $(SEP) make veryclean
	cd system $(SEP) make veryclean
	cd interfaces $(SEP) make veryclean
	cd interfaces$(DIRSEP)lib $(SEP) make veryclean
	cd simple_classes $(SEP) make veryclean
	cd simple_classes$(DIRSEP)factorization $(SEP) make veryclean
	cd simple_classes$(DIRSEP)bigint_matrix $(SEP) make veryclean
	cd simple_classes$(DIRSEP)lattice $(SEP) make veryclean
	cd packages$(DIRSEP)discrete_log$(DIRSEP)pohlig_hellman $(SEP) make veryclean
	cd templates $(SEP) make veryclean
	cd ../config $(SEP) make veryclean

#
# end of makefile
#
