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.1KB

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