48 lines
		
	
	
		
			1012 B
		
	
	
	
		
			Makefile
		
	
	
	
	
	
			
		
		
	
	
			48 lines
		
	
	
		
			1012 B
		
	
	
	
		
			Makefile
		
	
	
	
	
	
OUT_DIR := out
 | 
						|
GRAPHS_DIR := graphs
 | 
						|
CONTENTS_DIR := contents
 | 
						|
PACKAGES_DIR := packages
 | 
						|
REFERENCES_DIR := references
 | 
						|
 | 
						|
CONTENTS := $(wildcard $(CONTENTS_DIR)/*.tex)
 | 
						|
PACKAGES := $(wildcard $(PACKAGES_DIR)/*.sty)
 | 
						|
REFERENCES := $(wildcard $(REFERENCES_DIR)/*.bib)
 | 
						|
GRAPHS := $(wildcard $(GRAPHS_DIR)/*.gv)
 | 
						|
GRAPHS_IMG := $(GRAPHS:$(GRAPHS_DIR)/%.gv=$(OUT_DIR)/%.gv.png)
 | 
						|
 | 
						|
.PHONY: all
 | 
						|
all: pdf
 | 
						|
 | 
						|
$(OUT_DIR):
 | 
						|
	@mkdir -v $@
 | 
						|
 | 
						|
$(OUT_DIR)/%.gv.png: $(GRAPHS_DIR)/%.gv | $(OUT_DIR)
 | 
						|
	dot -T png $< -o $@
 | 
						|
 | 
						|
.PHONY: graphs
 | 
						|
graphs: $(GRAPHS_IMG)
 | 
						|
 | 
						|
.PHONY: index
 | 
						|
index: $(OUT_DIR)/main.idx
 | 
						|
	makeindex $^
 | 
						|
 | 
						|
.PHONY: references
 | 
						|
references: $(REFERENCES)
 | 
						|
	bibtex $(OUT_DIR)/annexes
 | 
						|
	bibtex $(OUT_DIR)/references
 | 
						|
 | 
						|
.PHONY: --inner_pdf
 | 
						|
--inner_pdf: $(CONTENTS) $(PACKAGES) $(REFERENCES) $(GRAPHS)
 | 
						|
	pdflatex -output-directory $(OUT_DIR) main.tex
 | 
						|
 | 
						|
.PHONY: pdf
 | 
						|
pdf: $(GRAPHS_IMG) --inner_pdf references index --inner_pdf references --inner_pdf
 | 
						|
 | 
						|
.PHONY: preview
 | 
						|
preview: pdf
 | 
						|
	@zathura $(OUT_DIR)/main.pdf
 | 
						|
 | 
						|
.PHONY: clean
 | 
						|
clean:
 | 
						|
	@rm -frv $(OUT_DIR)
 |