Makefile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. [ -f $(BUILDDIR)/thesis.pdf ] && cp $(BUILDDIR)/thesis.pdf $(OUTPUTDIR)
  60. clean:
  61. [ ! -d $(OUTPUTDIR) ] || rm -rf $(OUTPUTDIR)
  62. cd $(BUILDDIR); git clean -f -X
  63. serve:
  64. ifdef PORT
  65. cd $(OUTPUTDIR) && $(PY) -m pelican.server $(PORT)
  66. else
  67. cd $(OUTPUTDIR) && $(PY) -m pelican.server
  68. endif
  69. rsync_upload: html pdf
  70. rsync -e "ssh -p $(SSH_PORT)" -P -rvzc --delete $(OUTPUTDIR)/ $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) --cvs-exclude
  71. .PHONY: html pdf help clean serve publish rsync_upload