#
# Makefile - Template Makefile for Platon SDG documents
#
# Developed by Lubomir Host 'rajo' <rajo AT platon.sk>
# Copyright (c) 2004 Platon SDG
# Licensed under terms of GNU General Public License.
# All rights reserved.
#
# $Platon: platos/prednasky/Lugcon/Makefile,v 1.11 2005/11/11 00:28:45 rajo Exp $
#

# here specify name of your document
PACKAGE = @DIRNAME@
VERSION = $(shell date "+%y-%m-%d-%H-%M")
distdir = $(PACKAGE)-$(VERSION)
TOP_DIR = ../..

# define next variable, if you wish use autoprefix
PREFIX  = Platon-Lugcon
# Uncomment next line if you wish automaticaly add directory name to the
# name of output file
#APPEND_DIRNAME = 1

# Nazov vystupneho PostScriptoveho suboru (alebo PDF suboro[v])
# sa pise do suborov ps__OUTPUT a pdf_OUTPUT 
ps__OUTPUT        = $(shell cat ps__OUTPUT 2>/dev/null)
pdf_OUTPUT        = $(shell cat pdf_OUTPUT 2>/dev/null) 

# Dalsie pridavne obrazky alebo vstupne subory, ktore sa nijako nevytvaraju

IMAGES = img/t.png \
		 img/t.eps \
		 img/ch08dia1.png \
		 img/ch08dia1.eps \
		 img/ch08dia2.png \
		 img/ch08dia2.eps

# dalsie subory, ktore su potrebne pre vysadzanie
DEPEND = img \
		 10-Vim-content.tex \
		 uvodzovky.sty \
		 13-CVS-and-SVN-comparison-content.tex

DISTFILES = Makefile \
			uvodzovky.sty \
			10-Vim-slides.tex \
			10-Vim-preview.tex \
			10-Vim-prihlaska.tex \
			13-CVS-and-SVN-comparison-preview.tex \
			13-CVS-and-SVN-comparison-prihlaska.tex \
			13-CVS-and-SVN-comparison-slides.tex \
			ps__OUTPUT \
			pdf_OUTPUT \
			$(DEPEND)
			#$(OUTPUT)


########################################
########################################
## END of user setup
########################################
########################################

allimg: $(IMAGES) all

%.eps: %.png
	convert $< $@

$(PREFIX)%.pdf:: $(PREFIX)%.ps
	$(PS2PDF) $<

# include rules from Rules.make:
-include $(TOP_DIR)/_templates/Rules.make

ps2pdf__INPUT = $(patsubst %.ps,%.pdf,$(ps__OUTPUT))
ps2pdf_OUTPUT = $(patsubst %,$(PREFIX)-%,$(ps2pdf__INPUT))

#all: ps2pdf
all: timing

ps2pdf: $(ps2pdf_OUTPUT)

clean: clean-ps2pdf clean-img

clean-ps2pdf:
	rm -f $(ps2pdf_OUTPUT)

clean-img:
	rm -f img/*.eps

time: timing
timing:
	@echo -en "[32;1mTIMING:[0m"; echo;
	@awk -v FS="[{}]+" \
		'BEGIN { sum = 0; count = 0; } \
		/^[ \t]*\\slideheading/ { count++; printf "[34;1m%g. %s[0;0m\n", count, $$2; } \
		/^[ \t]*\\TIMING/ { sum += $$2; printf "\tTIMING %g / %g\n", $$2, sum; } \
		END { printf "TOTAL DURATION = [33;1m%g[0;0m mins\n", sum; }   ' 13-CVS-and-SVN-comparison-content.tex

# vim: ts=4 isk+=- ft=make
# vim600: fdm=marker fdc=3

