Makefile 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. .PHONY: build clean-examples
  2. build: html
  3. SHELL := /bin/bash
  4. # this pattern rule lets you run "make build" (or any other target
  5. # in docs/Makefile) in this directory as though you were in docs/
  6. %:
  7. cd docs && make $@
  8. clean-build:
  9. rm -rf docs/_build
  10. # wipe out all recorded examples
  11. clean-examples:
  12. # check if we have something like .xsession or a .bashrc
  13. @[ -n "$$(ls -a /home/me/.x* /home/me/.*rc 2>/dev/null)" ] && echo "/home/me looks like a real HOME dir. Refusing to bring chaos" && exit 1 || true
  14. @find docs/*/_examples -name 'DL*' | sed 's/docs\/usecases\/_examples//' | sed 's/docs\/beyond_basics\/_examples\/DL-101-168-[0-9]*[a,b]*//' |xargs rm -vrf
  15. # also wipe the workdirs, otherwise a rebuild will lead to chaos
  16. @for d in $$(git grep ':workdir:' -- docs | cut -d ':' -f 4- | sort | uniq|cut -d '/' -f 1 | uniq | sed 's/usecases//' | sed 's/DVCvsDL//'); do chmod +w -R /home/me/$$d; rm -vrf /home/me/$$d ; done
  17. # wipe out bare push repos
  18. @chmod +w -R /home/me/pushes/DataLad-101 /home/me/pushes/midterm_project; rm -vrf /home/me/pushes/DataLad-101 /home/me/pushes/midterm_project
  19. @rm -vrf /home/me/makepushtarget.py
  20. # wipe out the RIA store
  21. @rm -vrf /home/me/myriastore
  22. # do not touch what's in the DataLad narrative, only certain unrelated wdirs and examples
  23. clean-DVC:
  24. # wipe out the DVC comparison
  25. @find docs/beyond_basics/_examples -name DL-101-168* -type f | xargs rm -vrf
  26. @chmod +w -R /home/me/DVCvsDL; rm -vrf /home/me/DVCvsDL
  27. @chmod +w -R /home/me/pushes/data-version-control; rm -vrf /home/me/pushes/data-version-control
  28. # wipe out usecases
  29. clean-usecases:
  30. # check if we have something like .xsession or a .bashrc
  31. @[ -n "$$(ls -a /home/me/.x* /home/me/.*rc 2>/dev/null)" ] && echo "/home/me looks like a real HOME dir. Refusing to bring chaos" && exit 1 || true
  32. @rm -vrf docs/usecases/_examples
  33. # also wipe the workdirs, otherwise a rebuild will lead to chaos
  34. @chmod +w -R /home/me/usecases; rm -vrf /home/me/usecases
  35. # wipe out everything
  36. clean:
  37. # check if we have something like .xsession or a .bashrc
  38. @[ -n "$$(ls -a /home/me/.x* /home/me/.*rc 2>/dev/null)" ] && echo "/home/me looks like a real HOME dir. Refusing to bring chaos" && exit 1 || true
  39. @find docs -name _examples -type d | xargs rm -vrf
  40. # also wipe the workdirs, otherwise a rebuild will lead to chaos
  41. @for d in $$(git grep ':workdir:' -- docs | cut -d ':' -f 4- | sort | uniq|cut -d '/' -f 1 | uniq); do chmod +w -R /home/me/$$d; rm -vrf /home/me/$$d ; done
  42. # wipe out bare push repos
  43. @chmod +w -R /home/me/pushes; rm -vrf /home/me/pushes
  44. @rm -vrf /home/me/makepushtarget.py
  45. # wipe out the RIA store
  46. @rm -vrf /home/me/myriastore
  47. # wipe out the DVC comparison
  48. @chmod +w -R /home/me/DVCvsDL; rm -vrf /home/me/DVCvsDL