Repository with sources and generator of https://larlet.fr/david/ https://larlet.fr/david/
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 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. .DEFAULT_GOAL := help
  2. .PHONY: install
  3. install: ## Install the dependencies
  4. python -m pip install -r requirements.txt
  5. .PHONY: build
  6. build: ## Generate the site
  7. @python site.py pages tags feed home
  8. .PHONY: publish
  9. publish: ## Make heavy actions
  10. @python site.py search blogroll
  11. .PHONY: blogroll
  12. blogroll: ## Generate the blogroll
  13. @python site.py blogroll
  14. .PHONY: live
  15. live: ## Rebuild contents on file change.
  16. ls david/2023/_sources/* | entr -r make build
  17. .PHONY: toot
  18. toot: ## Pre-write the Mastodon message.
  19. @python site.py toot
  20. .PHONY: help
  21. help:
  22. @python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
  23. # See https://daniel.feldroy.com/posts/autodocumenting-makefiles
  24. define PRINT_HELP_PYSCRIPT # start of Python section
  25. import re, sys
  26. output = []
  27. # Loop through the lines in this file
  28. for line in sys.stdin:
  29. # if the line has a command and a comment start with
  30. # two pound signs, add it to the output
  31. match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
  32. if match:
  33. target, help = match.groups()
  34. output.append("\033[36m%-10s\033[0m %s" % (target, help))
  35. # Sort the output in alphanumeric order
  36. output.sort()
  37. # Print the help result
  38. print('\n'.join(output))
  39. endef
  40. export PRINT_HELP_PYSCRIPT # End of python section