Makefile 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. PY?=python3
  2. PELICAN?=pelican
  3. PELICANOPTS=
  4. BASEDIR=$(CURDIR)
  5. INPUTDIR=$(BASEDIR)/content
  6. BUILDDIR=$(BASEDIR)/build
  7. OUTPUTDIR=$(BASEDIR)/output
  8. CONFFILE=$(BASEDIR)/pelicanconf.py
  9. PUBLISHCONF=$(BASEDIR)/publishconf.py
  10. SSH_HOST=fangmeier.tech
  11. SSH_PORT=22
  12. SSH_USER=caleb
  13. SSH_TARGET_DIR=/var/www/thesis
  14. DEBUG ?= 0
  15. ifeq ($(DEBUG), 1)
  16. PELICANOPTS += -D
  17. endif
  18. RELATIVE ?= 0
  19. ifeq ($(RELATIVE), 1)
  20. PELICANOPTS += --relative-urls
  21. endif
  22. help:
  23. @echo 'Makefile for a pelican Web site '
  24. @echo ' '
  25. @echo 'Usage: '
  26. @echo ' make html (re)generate the web site '
  27. @echo ' make pdf (re)generate the pdf '
  28. @echo ' make clean remove the generated files '
  29. @echo ' make publish generate using production settings '
  30. @echo ' make serve [PORT=8000] serve site at http://localhost:8000'
  31. @echo ' make rsync_upload upload the web site via rsync+ssh '
  32. @echo ' '
  33. @echo 'Set the DEBUG variable to 1 to enable debugging, e.g. make DEBUG=1 html '
  34. @echo 'Set the RELATIVE variable to 1 to enable relative urls '
  35. @echo ' '
  36. build/%.html: content/%.md
  37. @./convert.py $*.md html
  38. build/%.tex: content/%.md
  39. @./convert.py $*.md tex
  40. 00_html: build/00_abstract.html
  41. 01_html: build/01_introduction.html
  42. 02_html: build/02_standard_model.html
  43. 03_html: build/03_lhc_and_cms_detector.html
  44. 04_html: build/04_simulation_and_reconstruction.html
  45. 05_html: build/05_tttt_measurement.html
  46. 06_html: build/06_pixel_assembly.html
  47. 00_tex: build/00_abstract.tex
  48. 01_tex: build/01_introduction.tex
  49. 02_tex: build/02_standard_model.tex
  50. 03_tex: build/03_lhc_and_cms_detector.tex
  51. 04_tex: build/04_simulation_and_reconstruction.tex
  52. 05_tex: build/05_tttt_measurement.tex
  53. 06_tex: build/06_pixel_assembly.tex
  54. html: 00_html 01_html 02_html 03_html 04_html 05_html 06_html
  55. $(PELICAN) $(BUILDDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
  56. $(PELICAN) $(BUILDDIR) -o $(OUTPUTDIR) -s $(PUBLISHCONF) $(PELICANOPTS)
  57. pdf: 00_tex 01_tex 02_tex 03_tex 04_tex 05_tex 06_tex
  58. cd $(BUILDDIR); rubber thesis
  59. # cd $(BUILDDIR); pandoc --bibliography=references.bib --csl=american-physics-society.csl -o thesis.pdf thesis.tex
  60. [ -f $(BUILDDIR)/thesis.pdf ] && cp $(BUILDDIR)/thesis.pdf $(OUTPUTDIR)
  61. clean:
  62. [ ! -d $(OUTPUTDIR) ] || rm -rf $(OUTPUTDIR)
  63. cd $(BUILDDIR); git clean -f -X
  64. serve:
  65. ifdef PORT
  66. cd $(OUTPUTDIR) && $(PY) -m pelican.server $(PORT)
  67. else
  68. cd $(OUTPUTDIR) && $(PY) -m pelican.server
  69. endif
  70. rsync_upload: html pdf
  71. rsync -e "ssh -p $(SSH_PORT)" -P -rvzc --delete $(OUTPUTDIR)/ $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) --cvs-exclude
  72. .PHONY: html pdf help clean serve publish rsync_upload