SUBDIRS=ia point list valueset pointset idm image
#GMAKE=/local/gnu/make
GMAKE=/local/bin/gnumake
#GMAKE=/local/bin/gmake
TOP=$(shell pwd)/..

DISTDIR=/cis/tmp/iac++-dist

all reallib clean spotless headers-force::
	for dir in ${SUBDIRS}; do \
	test -d $$dir && \
	(	echo Making $@ in $$dir; cd $$dir; ${MAKE} $@ TOP=${TOP} ; \
		echo done Making $@ in $$dir) ; \
	done; exit 0


dist:
	- mkdir ${DISTDIR}
	- mkdir ${DISTDIR}/src
	- mkdir ${DISTDIR}/lib
	- mkdir ${DISTDIR}/include
	- mkdir ${DISTDIR}/bin
	for file in add-templobj.perl; do \
		cp ${TOP}/bin/$$file ${DISTDIR}/bin/; \
	done
	for file in GNUmakefile gnumake.templ; do \
		cp ${TOP}/src/$$file ${DISTDIR}/src/; \
	done
	for file in ${SUBDIRS}; do \
		mkdir ${DISTDIR}/src/$$file; (cd $$file; ${MAKE} $@ TOP=${TOP} SUBDIR="$$file" DISTDIR="${DISTDIR}"); \
	done

spotless clean:: local-clean

local-clean:
	rm -f *~

spotless::
	rm ar-remangling
