## commands

cmd_log := echo "--"
cmd_quarto := quarto
cmd_mkdir := mkdir -p
cmd_cp := cp

## rules

all: \
	${dir_build}/praesentation.html \
	${dir_build}/fortlaufend.html \
	bewerbung \
	${dir_build}/index.html

${dir_build}/praesentation.html: ${dir_source}/main.qmd
	@ ${cmd_log} "Präsentation …"
	@ ${cmd_mkdir} $(dir $@)
	@ ${cmd_quarto} render $^ --quiet --to revealjs --output-dir ${dir_build} && mv ${dir_build}/main.html $@

${dir_build}/fortlaufend.html: ${dir_source}/main.qmd
	@ ${cmd_log} "Fortlaufend …"
	@ ${cmd_mkdir} $(dir $@)
	@ ${cmd_quarto} render $^ --quiet --to html --output-dir ${dir_build} && mv ${dir_build}/main.html $@

.PHONY: bewerbung
bewerbung:
	@ ${cmd_log} "Bewerbung …"
	@ ${cmd_mkdir} ${dir_build}/bewerbung/
	@ ${cmd_cp} -r -u -v ${dir_source}/bewerbung/* ${dir_build}/bewerbung/

${dir_build}/index.html: ${dir_source}/index.html
	@ ${cmd_log} "index …"
	@ ${cmd_mkdir} $(dir $@)
	@ ${cmd_cp} -u $^ $@

