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

CONFIGNAME=default32

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

PKGROOT=$(shell pwd)

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

.PHONY: clean doc test

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

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

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

doc:
	($(GAP)  makedocrel.g)

clean: 
	rm -rf bin/armv7l-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
