summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 8bf82750ba833c6cf6b365803ab8d9348b8eae7d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
dirs := $(subst  . , ,$(subst /Makefile,,$(shell find -name Makefile)))
pdfs := $(subst .md,.pdf,$(shell find -name *.md))
texs := $(subst .tex,.pdf,$(shell find -name dokument.tex))
.PHONY: clean default
default: $(dirs) $(pdfs) $(texs)
$(dirs):
	$(MAKE) -C $@
%.pdf: %.md
	pandoc -V geometry:margin=1cm $< -o $@
%.pdf: %.tex
	@echo za tole rabiš moje magične skripte
	cd $(subst dokument.pdf,,$@) && ~/projects/doc/f5ff.sh dokument && biber dokument && ~/projects/doc/f5ff.sh dokument
clean:
	@echo cleaning $(dirs)
	for dir in $(dirs); do \
		$(MAKE) -C $$dir clean; \
	done
	rm -rf $(pdfs) $(texs)