Website behind the splash page at http://www.cygnal.eu/. http://www.cygnal.eu

Makefile 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. PY?=python3
  2. PELICAN?=pelican
  3. PELICANOPTS=
  4. BASEDIR=$(CURDIR)
  5. INPUTDIR=$(BASEDIR)/content
  6. OUTPUTDIR=$(BASEDIR)/output
  7. CONFFILE=$(BASEDIR)/pelicanconf.py
  8. PUBLISHCONF=$(BASEDIR)/publishconf.py
  9. DEBUG ?= 0
  10. ifeq ($(DEBUG), 1)
  11. PELICANOPTS += -D
  12. endif
  13. RELATIVE ?= 0
  14. ifeq ($(RELATIVE), 1)
  15. PELICANOPTS += --relative-urls
  16. endif
  17. help:
  18. @echo 'Makefile for a pelican Web site '
  19. @echo ' '
  20. @echo 'Usage: '
  21. @echo ' make html (re)generate the web site '
  22. @echo ' make clean remove the generated files '
  23. @echo ' make regenerate regenerate files upon modification '
  24. @echo ' make publish generate using production settings '
  25. @echo ' make serve [PORT=8000] serve site at http://localhost:8000'
  26. @echo ' make serve-global [SERVER=0.0.0.0] serve (as root) to $(SERVER):80 '
  27. @echo ' make devserver [PORT=8000] start/restart develop_server.sh '
  28. @echo ' make stopserver stop local server '
  29. @echo ' make ssh upload the web site via SSH '
  30. @echo ' make rsync upload the web site via rsync+ssh '
  31. @echo ' '
  32. @echo 'Set the DEBUG variable to 1 to enable debugging, e.g. make DEBUG=1 html '
  33. @echo 'Set the RELATIVE variable to 1 to enable relative urls '
  34. @echo ' '
  35. html:
  36. $(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
  37. clean:
  38. [ ! -d $(OUTPUTDIR) ] || rm -rf $(OUTPUTDIR)
  39. regenerate:
  40. $(PELICAN) -r $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
  41. serve:
  42. ifdef PORT
  43. cd $(OUTPUTDIR) && $(PY) -m pelican.server $(PORT)
  44. else
  45. cd $(OUTPUTDIR) && $(PY) -m pelican.server
  46. endif
  47. serve-global:
  48. ifdef SERVER
  49. cd $(OUTPUTDIR) && $(PY) -m pelican.server 80 $(SERVER)
  50. else
  51. cd $(OUTPUTDIR) && $(PY) -m pelican.server 80 0.0.0.0
  52. endif
  53. devserver:
  54. ifdef PORT
  55. $(BASEDIR)/develop_server.sh restart $(PORT)
  56. else
  57. $(BASEDIR)/develop_server.sh restart
  58. endif
  59. stopserver:
  60. $(BASEDIR)/develop_server.sh stop
  61. @echo 'Stopped Pelican and SimpleHTTPServer processes running in background.'
  62. publish:
  63. $(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(PUBLISHCONF) $(PELICANOPTS)
  64. ssh : publish
  65. scp -P $(SSH_PORT) -r $(OUTPUTDIR)/* $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR)
  66. rsync: publish
  67. rsync -e "ssh -p $(SSH_PORT)" -P -rvzc --delete $(OUTPUTDIR)/ $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) --cvs-exclude
  68. install:
  69. pip install --user pelican Markdown toc bs4
  70. .PHONY: html help clean regenerate serve serve-global devserver stopserver publish ssh rsync