Advertisement
Guest User

Untitled

a guest
Apr 17th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 0.77 KB | None | 0 0
  1. BASEDIR = .
  2. TEXDIR = $(BASEDIR)/tex
  3. PDFDIR = $(BASEDIR)/pdf
  4.  
  5. SRCS = $(shell find . ! -name "abstract.rst" ! -name "conclusion.rst" -name "*.rst" -printf "%f\n" | awk -F. '{ print $$1 }')
  6. PDF_SRCS = $(foreach src,$(SRCS),$(PDFDIR)/$(src).pdf)
  7.  
  8.  
  9. all: $(PDF_SRCS) clean
  10.  
  11.  
  12. recompile_all: abstract.rst
  13.     @for src in $(SRCS); do \
  14.         rst2latex.py $(BASEDIR)/$$src.rst $(TEXDIR)/$$src.tex; \
  15.         pdflatex -output-directory=$(PDFDIR) $(TEXDIR)/$$src.tex; \
  16.     done;
  17.  
  18.  
  19. $(PDFDIR)/%.pdf: $(BASEDIR)/%.rst
  20.     rst2latex.py $(BASEDIR)/$*.rst $(TEXDIR)/$*.tex
  21.     pdflatex -output-directory=$(PDFDIR) $(TEXDIR)/$*.tex
  22.  
  23.  
  24. clean:
  25.     rm -f $(PDFDIR)/*.log $(PDFDIR)/*.bak $(PDFDIR)/*.aux \
  26.         $(PDFDIR)/*.bbl $(PDFDIR)/*.blg $(PDFDIR)/*.idx \
  27.         $(PDFDIR)/*.toc $(PDFDIR)/*.out $(PDFDIR)/*~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement