GAPPATH=../..
#
# makefile for the IO package                             Max Neunhoeffer
#
#  Copyright (C) 2006  Max Neunhoeffer, Lehrstuhl D f. Math., RWTH Aachen
#  This file is free software, see license information at the end.
#  
CC=cc

GAPINCL=-I$(GAPPATH)/src -I$(GAPPATH)/bin/x86_64

.PHONY: bindir clean doc test

default: bindir bin/x86_64/io.so

# this target creates a bin-directory
bindir:
	if test ! -d bin;  then mkdir bin;  fi
	if test ! -d bin/x86_64;  then mkdir bin/x86_64;  fi

bin/x86_64/io.so: src/io.c
	#cp $(GAPPATH)/bin/x86_64/config.h bin/x86_64
	$(GAPPATH)/bin/x86_64/gac -d -o bin/x86_64/io.so src/io.c

# make a statically linked GAP including the io module
static:
	(cd $(GAPPATH)/bin/x86_64; \
	./gac -o gap-static -p "-DIOSTATIC" -P "-static" \
	../../pkg/io/src/io.c)

doc: doc/manual.six

doc/manual.six: doc/main.xml doc/io.xml default VERSION
	($(GAPPATH)/bin/gap.sh makedoc.g)

clean:
	rm -rf bin/* Makefile
	(cd doc ; ./clean)

archive: doc
	(cd .. ; tar czvf io-`cat io/VERSION`.tar.gz --exclude ".svn" --exclude bin --exclude test io)

WEBPOS=/scratch/neunhoef/mywebpage.pub/Computer/Software/Gap/io

towww: archive
	echo '<?xml version="1.0" encoding="ISO-8859-1"?>' >${WEBPOS}.version
	echo '<mixer>' >>${WEBPOS}.version
	cat VERSION >>${WEBPOS}.version
	echo '</mixer>' >>${WEBPOS}.version
	cp PackageInfo.g ${WEBPOS}
	cp README ${WEBPOS}/README.io
	cp doc/manual.pdf ${WEBPOS}/io.pdf
	cp ../io-`cat VERSION`.tar.gz ${WEBPOS}
	@echo
	@echo Now please adjust the archive link in 
	@echo "    " ${WEBPOS}.mixer !

##
##  This program is free software; you can redistribute it and/or modify
##  it under the terms of the GNU General Public License as published by
##  the Free Software Foundation; version 2 of the License.
##
##  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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
##
