Le site internet de CLI
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 3.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. SSH_HOST=www2.frepoteries.fr
  10. SSH_PORT=22
  11. SSH_USER=www-git
  12. SSH_TARGET_DIR=/home/wwww-git/scop-cli
  13. DEBUG ?= 0
  14. ifeq ($(DEBUG), 1)
  15. PELICANOPTS += -D
  16. endif
  17. RELATIVE ?= 0
  18. ifeq ($(RELATIVE), 1)
  19. PELICANOPTS += --relative-urls
  20. endif
  21. help:
  22. @echo 'Makefile for a pelican Web site '
  23. @echo ' '
  24. @echo 'Usage: '
  25. @echo ' make html (re)generate the web site '
  26. @echo ' make clean remove the generated files '
  27. @echo ' make regenerate regenerate files upon modification '
  28. @echo ' make publish generate using production settings '
  29. @echo ' make serve [PORT=8000] serve site at http://localhost:8000'
  30. @echo ' make serve-global [SERVER=0.0.0.0] serve (as root) to $(SERVER):80 '
  31. @echo ' make devserver [PORT=8000] serve and regenerate together '
  32. @echo ' make ssh_upload upload the web site via SSH '
  33. @echo ' make rsync_upload upload the web site via rsync+ssh '
  34. @echo ' '
  35. @echo 'Set the DEBUG variable to 1 to enable debugging, e.g. make DEBUG=1 html '
  36. @echo 'Set the RELATIVE variable to 1 to enable relative urls '
  37. @echo ' '
  38. html:
  39. $(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
  40. clean:
  41. [ ! -d $(OUTPUTDIR) ] || rm -rf $(OUTPUTDIR)
  42. regenerate:
  43. $(PELICAN) -r $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
  44. serve:
  45. ifdef PORT
  46. $(PELICAN) -l $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) -p $(PORT)
  47. else
  48. $(PELICAN) -l $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
  49. endif
  50. serve-global:
  51. ifdef SERVER
  52. $(PELICAN) -l $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) -p $(PORT) -b $(SERVER)
  53. else
  54. $(PELICAN) -l $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) -p $(PORT) -b 0.0.0.0
  55. endif
  56. devserver:
  57. ifdef PORT
  58. $(PELICAN) -lr $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) -p $(PORT)
  59. else
  60. $(PELICAN) -lr $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
  61. endif
  62. publish:
  63. $(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(PUBLISHCONF) $(PELICANOPTS)
  64. ssh_upload: publish
  65. scp -P $(SSH_PORT) -r $(OUTPUTDIR)/* $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR)
  66. rsync_upload: publish
  67. rsync -e "ssh -p $(SSH_PORT)" -P -rvzc --cvs-exclude --delete $(OUTPUTDIR)/ $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR)
  68. .PHONY: html help clean regenerate serve serve-global devserver publish ssh_upload rsync_upload