#
# makefile for the IO package                             Max Neunhoeffer
#
#  Copyright (C) by Max Neunhoeffer
#  This file is free software, see license information at the end.
#  
CC=cc

GAPINCL=-I/scratch/neunhoef/gap4r4/pkg/io/bin/x86_64-unknown-linux-gnu-gcc

.PHONY: clean doc test

default: bin/x86_64-unknown-linux-gnu-gcc/io.so

bin/x86_64-unknown-linux-gnu-gcc/io.so: src/io.c bin/x86_64-unknown-linux-gnu-gcc/ioconfig.h
	../../bin/x86_64-unknown-linux-gnu-gcc/gac -d -p "$(GAPINCL)" -o bin/x86_64-unknown-linux-gnu-gcc/io.so src/io.c

# make a statically linked GAP including the io module
static: src/io.c bin/x86_64-unknown-linux-gnu-gcc/ioconfig.h
	(cd ../../bin/x86_64-unknown-linux-gnu-gcc; ./gac -o gap-static -p "-DIOSTATIC $(GAPINCL)" -P "-static" /scratch/neunhoef/gap4r4/pkg/io/src/io.c)

doc: doc/manual.six

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

clean:
	rm -rf bin/x86_64-unknown-linux-gnu-gcc/* 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, either version 3 of the License, or
##  (at your option) any later version.
##
##  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, see <http://www.gnu.org/licenses/>.
##
