##############################################################################
##
##    Makefile.in                     NQ                         Werner Nickel
##
##    $Id: Makefile.in,v 1.19 2003/10/11 23:08:31 werner Exp $
##

##
##    Values imported from the configure script
##
BINDIR=bin/@target@-@BASECC@
GAP_ROOT=$(PWD)/../..
GNU_MP_INC=.
GNU_MP_LIB=$(GNU_MP_INC)

WEB_DIR  = /www/homepages/nickel/software/NQ/
HTML_DOC = nq-2.1/doc/chap0.html   nq-2.1/doc/chap1.html \
	   nq-2.1/doc/chap2.html   nq-2.1/doc/chap3.html \
	   nq-2.1/doc/chap4.html   nq-2.1/doc/chap5.html \
	   nq-2.1/doc/chapBib.html nq-2.1/doc/chapInd.html \
	   nq-2.1/doc/manual.css   nq-2.1/doc/manual.pdf

all: compile

gap: compile gapmanual

compile:
	(cd src; make GNU_MP_LIB=$(GNU_MP_LIB) GNU_MP_INC=$(GNU_MP_INC))
	@if test ! -d bin;  then mkdir bin; fi
	@if test ! -d $(BINDIR);  then mkdir $(BINDIR); fi
	mv src/nq $(BINDIR)

gapmanual:
	cd doc; make

release-2.0:
	cvs export -D 'February 11, 2003 11:00' -d nq-2.0 GAP/4.0/pkg/nq

	find nq-2.0 -name .cvsignore -exec rm "{}" ";"

	rm -f nq-2_0.zoo nq-2_0.tgz nq-2_0.tar
	tar cf nq-2_0.tar nq-2.0
	find nq-2.0 -type f -exec zoo ah nq-2_0.zoo "{}" ";"
	gzip < nq-2_0.tar > nq-2_0.tgz

release-2.1: clean
	cvs export -D 'October 20, 2003 11:00' -d nq-2.1 GAP/4.0/pkg/nq

	find nq-2.1 -name .cvsignore -exec rm "{}" ";"

	cd nq-2.1/doc; make; make clean

	rm -f nq-2_1.zoo nq-2_1.tgz nq-2_1.tar
	tar cf nq-2_1.tar nq-2.1
	find nq-2.1 -type f -exec zoo ah nq-2_1.zoo "{}" ";"
	gzip < nq-2_1.tar > nq-2_1.tgz

WWW: release-2.1
	if [ ! -d $(WEB_DIR) ]; then mkdir $(WEB_DIR); fi

	@echo '--> Moving archive files'
	cp nq-2_1.tar nq-2_1.tgz nq-2_1.zoo $(WEB_DIR)

	@echo 'Copying README file'
	cp README $(WEB_DIR) 

	@echo '--> Preparing HTML manual'
	if [ ! -d $(WEB_DIR)/doc ]; then mkdir $(WEB_DIR)/doc; fi
	cp $(HTML_DOC) $(WEB_DIR)/doc

	@echo '--> Preparing PDF- and PS-manuals'
	cp nq-2.1/doc/manual.pdf $(WEB_DIR)/nqman.pdf
	cp nq-2.1/doc/manual.ps $(WEB_DIR)/nqman.ps
	cp nq-2.1/doc/manual.six $(WEB_DIR)/nqman.six
	@echo '--> Copying Package info'
	cp PackageInfo.g $(WEB_DIR)

test:
	(cd examples; make)

clean:
	rm -f *~ */*~ config.cache config.log config.status
	(cd src;      make clean)
	(cd doc;      make clean)
	(cd examples; make clean)

spotless: clean
	rm -rf nq-2.1 nq-2_1.tar nq-2_1.tgz nq-2_1.zoo
	rm -f Makefile
	rm -rf bin
	(cd src;      make spotless)
	(cd doc;      make spotless)
	(cd examples; make spotless)

