Makefile 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. 07_html: build/07_conclusion.html
  48. 00_tex: build/00_abstract.tex
  49. 01_tex: build/01_introduction.tex
  50. 02_tex: build/02_standard_model.tex
  51. 03_tex: build/03_lhc_and_cms_detector.tex
  52. 04_tex: build/04_simulation_and_reconstruction.tex
  53. 05_tex: build/05_tttt_measurement.tex
  54. 06_tex: build/06_pixel_assembly.tex
  55. 07_tex: build/07_conclusion.tex
  56. html: 00_html 01_html 02_html 03_html 04_html 05_html 06_html 07_html
  57. $(PELICAN) $(BUILDDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
  58. $(PELICAN) $(BUILDDIR) -o $(OUTPUTDIR) -s $(PUBLISHCONF) $(PELICANOPTS)
  59. pdf: 00_tex 01_tex 02_tex 03_tex 04_tex 05_tex 06_tex 07_tex
  60. cd $(BUILDDIR); rubber thesis
  61. [ -f $(BUILDDIR)/thesis.pdf ] && cp $(BUILDDIR)/thesis.pdf $(OUTPUTDIR)
  62. clean:
  63. [ ! -d $(OUTPUTDIR) ] || rm -rf $(OUTPUTDIR)/*
  64. cd $(BUILDDIR); git clean -f -X
  65. serve:
  66. ifdef PORT
  67. cd $(OUTPUTDIR) && $(PY) -m pelican.server $(PORT)
  68. else
  69. cd $(OUTPUTDIR) && $(PY) -m pelican.server
  70. endif
  71. rsync_upload:
  72. rsync -e "ssh -p $(SSH_PORT)" -P -rvzc --delete $(OUTPUTDIR)/ $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) --cvs-exclude
  73. .PHONY: html pdf help clean serve publish rsync_upload