summaryrefslogblamecommitdiffstats
path: root/Makefile
blob: c356e47ff8343efed7b581dcc3c5a59275c6da04 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                  
                                                                       
                                                  
                                                    
                     
                                
        
                     

                                              

                                                  
                                                                                                                                                                                                                                 
      
                              
                                
                                         
            
                              
SHELL := /bin/bash
dirs := $(subst  . , ,$(subst /Makefile,,$(shell find -name Makefile)))
pdfs := $(subst .md,.pdf,$(shell find -name *.md))
texs := $(subst .tex,.pdf,$(shell find -name *.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
	n=`rev <<< $@ | cut -d/ -f1 | cut -d. -f2- | rev` && cd `rev <<< $@ | cut -d/ -f2- | rev` && ~/projects/doc/f5ff.sh $$n && (test -e `rev <<< $@ | cut -d. -f2- | rev`.bib && biber $$n ||:) && ~/projects/doc/f5ff.sh $$n
clean:
	@echo cleaning $(dirs)
	for dir in $(dirs); do \
		$(MAKE) -C $$dir clean; \
	done
	rm -rf $(pdfs) $(texs)