DOCUM=present
BIBBACKEND=biber
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
mkfile_path_=$(mkfile_path)|sed 's/locgolem\///g'
make=make -f $(mkfile_path)

snb:
	echo $(mkfile_path_)

final:
	$(make) biblatex 
	$(make) GSreduction
	$(make) clean


biblatex:
	$(make) pdf
	$(BIBBACKEND) $(DOCUM)
	$(make) pdf

pdf:	
	pdflatex $(DOCUM)

GSreduction:	
	#dle http://milan.kupcevic.net/ghostscript-ps-pdf/
	gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=present4w.pdf present.pdf
	mv present4w.pdf present.pdf

	
rsLB:
	rsync -r -u -v -K -delete -e ssh $$PWD golem@golem:$${PWD%/*}

rsBL:
	rsync -r -u -v -e ssh golem@golem:$$PWD $${PWD%/*}

	
clean:
	ls ${DOCUM}.*|grep -v pdf|grep -v tex|grep -v zip|xargs rm
	rm *.dbx *.tex.bbl *.tex.blg
