# makefile prototype for the EDIM package                         Frank Lübeck
# 27.1.2000 FL   made it much more portable by using `gac' for the compilation
#  $Id: Makefile.in,v 1.3 2002/02/05 22:23:41 chevie Exp $


GAPINCL=-I$(GAPPATH)/src -I$(GAPPATH)/bin/@GAPARCH@

.PHONY: bindir clean doc test

default: bindir bin/@GAPARCH@/ediv.so 

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

bin/@GAPARCH@/ediv.so: src/ediv.c 
	$(GAPPATH)/bin/@GAPARCH@/gac -d -o bin/@GAPARCH@/ediv.so src/ediv.c

# make a statically linked GAP including the ediv module
static:
	(cd $(GAPPATH)/bin/@GAPARCH@; \
        ./gac -o gap-static -p "-DEDIVSTATIC" -P "-static" \
        ../../pkg/edim/src/ediv.c)

doc: xmldoc/manual.six

xmldoc/manual.six: xmldoc/main.xml xmldoc/edim.xml xmldoc/edim.bib 
	(gap4 makedoc.g)

clean: 
	rm -rf bin/@GAPARCH@ Makefile *~

test:
	(cd tst; gap4 -b -q -r <test.g)
