GAPPATH=../..
CONFIGNAME=default32
# makefile prototype for the EDIM package                         Frank Lübeck

CONFIGNAME=default32

GAPINCL=-I$(GAPPATH)/src -I$(GAPPATH)/bin/armv6l-unknown-linux-gnueabihf-mpicc-default32

PKGROOT=$(shell pwd)

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

.PHONY: clean doc test

default: bin/armv6l-unknown-linux-gnueabihf-mpicc-default32/ediv.so 

# this target creates a bin-directory
bin/armv6l-unknown-linux-gnueabihf-mpicc-default32:
	if test ! -d bin;  then mkdir bin;  fi
	if test ! -d bin/armv6l-unknown-linux-gnueabihf-mpicc-default32;  then mkdir -p bin/armv6l-unknown-linux-gnueabihf-mpicc-default32;  fi

bin/armv6l-unknown-linux-gnueabihf-mpicc-default32/ediv.so: src/ediv.c bin/armv6l-unknown-linux-gnueabihf-mpicc-default32
	$(GAPPATH)/bin/armv6l-unknown-linux-gnueabihf-mpicc-default32/gac -d -o bin/armv6l-unknown-linux-gnueabihf-mpicc-default32/ediv.so src/ediv.c

doc:
	($(GAP)  makedocrel.g)

clean: 
	rm -rf bin/armv6l-unknown-linux-gnueabihf-mpicc-default32 Makefile Makefile-$(CONFIGNAME) *~

distclean:
	rm -rf bin Makefile Makefile-*

docclean:
	(cd  doc; ./clean)

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