SHELL = /bin/bash
DESTDIR=/var/www/html/freedocs

numCores=$(shell nproc --all)

EXECUTABLES = /usr/share/xmlmind/bin/xxetool javac mvn rsync pdflatex convert figspecial2pdf figspecial2png figspecial2svg fig2dev fig2mpdf fig2msvg fig2pdf pdf2svg pdftoppm \
java ffmpeg

K := $(foreach exec,$(EXECUTABLES),\
        $(if $(shell which $(exec)),some string,$(error "No $(exec) in PATH)))

REVEALHOME=/usr/share/reveal.js
K := $(if $(shell ls ${REVEALHOME}),some string,$(error "No ${REVEALHOME} found, please execute git clone https://github.com/hakimel/reveal.js)))

doc:
	cd Doc;$(MAKE) -j ${numCores} all

all:doc
#	mvn -T ${numCores} --fail-at-end install || echo
	mvn --fail-at-end install javadoc:javadoc || exit 0
	find P -type f \( -name \*.css -o -name \*.html -o -name \*.js \) -print | tar --files-from=- -c| tar -x -C Doc/target/webhelp

clean:
	cd Doc;$(MAKE) -j ${numCores} clean
	mvn -T ${numCores} clean

install:
	cd Doc;$(MAKE) install

#end
