# makefile prototype for the EDIM package                         Frank Lübeck

CONFIGNAME=@CONFIGNAME@

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

PKGROOT=$(shell pwd)

GAP=$(PKGROOT)/../../bin/gap-$(CONFIGNAME).sh

.PHONY: clean doc test

default: bin/@GAPARCH@/ediv.so 

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

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

doc:
	($(GAP)  makedocrel.g)

clean: 
	rm -rf bin/@GAPARCH@ Makefile Makefile-$(CONFIGNAME) *~

distclean:
	rm -rf bin Makefile Makefile-*

docclean:
	(cd  doc; ./clean)

test:
	$(GAP) -b -q -r < tst/test.g
