Makefile 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. .PHONY: build clean-ml clean-neuro2 clean-neuro clean-provenance clean-collaboration clean-usecases clean-beyond_basics clean-basics clean
  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. $(MAKE) -C docs $@
  8. clean-build:
  9. rm -rf docs/_build
  10. # wipe out everything
  11. clean:
  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 -name _examples -type d | 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); 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; rm -vrf /home/me/pushes
  19. @rm -vrf /home/me/makepushtarget.py
  20. # wipe out the RIA store
  21. @rm -vrf /home/me/myriastore
  22. # wipe out the DVC comparison
  23. @chmod +w -R /home/me/DVCvsDL; rm -vrf /home/me/DVCvsDL
  24. # remove the Basics
  25. clean-basics:
  26. # check if we have something like .xsession or a .bashrc
  27. @[ -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
  28. @find docs/basics/_examples -name 'DL*' |xargs rm -vrf
  29. # also wipe the workdirs, otherwise a rebuild will lead to chaos
  30. @for d in $$(git grep ':workdir:' -- docs | cut -d ':' -f 4- | sort | uniq|cut -d '/' -f 1 | uniq | sed 's/usecases//' | sed 's/DVCvsDL//' | sed 's/beyond_basics//'); do chmod +w -R /home/me/$$d; rm -vrf /home/me/$$d ; done
  31. # wipe out bare push repos
  32. @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
  33. @rm -vrf /home/me/makepushtarget.py
  34. # remove Beyond-Basics
  35. clean-beyond_basics:
  36. # check if we have something like .xsession or a .bashrc
  37. @[ -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
  38. @find docs/beyond_basics/_examples -name 'DL*' |xargs rm -vrf
  39. # also wipe the workdirs, otherwise a rebuild will lead to chaos
  40. @chmod +w -R /home/me/beyond_basics; rm -vrf /home/me/beyond_basics
  41. # wipe out bare push repos
  42. @chmod +w -R /home/me/pushes/data-version-control; rm -vrf /home/me/pushes/data-version-control
  43. # wipe myriastore
  44. @rm -vrf /home/me/myriastore
  45. # remove all usecases
  46. clean-usecases:
  47. # check if we have something like .xsession or a .bashrc
  48. @[ -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
  49. @find docs/usecases/_examples -name 'DL*' |xargs rm -vrf
  50. # also wipe the workdirs, otherwise a rebuild will lead to chaos
  51. @chmod +w -R /home/me/usecases; rm -vrf /home/me/usecases
  52. # remove specific usecases
  53. clean-collaboration:
  54. # check if we have something like .xsession or a .bashrc
  55. @[ -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
  56. @find docs/usecases/_examples -name 'collab*' |xargs rm -vrf
  57. # also wipe the workdirs, otherwise a rebuild will lead to chaos
  58. @chmod +w -R /home/me/usecases/collab; rm -vrf /home/me/usecases/collab
  59. clean-provenance:
  60. # check if we have something like .xsession or a .bashrc
  61. @[ -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
  62. @find docs/usecases/_examples -name 'prov*' |xargs rm -vrf
  63. # also wipe the workdirs, otherwise a rebuild will lead to chaos
  64. @chmod +w -R /home/me/usecases/provenance; rm -vrf /home/me/usecases/provenance
  65. clean-neuro:
  66. # check if we have something like .xsession or a .bashrc
  67. @[ -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
  68. @find docs/usecases/_examples -name 'repro-*' |xargs rm -vrf
  69. # also wipe the workdirs, otherwise a rebuild will lead to chaos
  70. @chmod +w -R /home/me/usecases/repro; rm -vrf /home/me/usecases/repro
  71. clean-neuro2:
  72. # check if we have something like .xsession or a .bashrc
  73. @[ -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
  74. @find docs/usecases/_examples -name 'repro2*' |xargs rm -vrf
  75. # also wipe the workdirs, otherwise a rebuild will lead to chaos
  76. @chmod +w -R /home/me/usecases/repro2; rm -vrf /home/me/usecases/repro2
  77. clean-ml:
  78. # check if we have something like .xsession or a .bashrc
  79. @[ -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
  80. @find docs/usecases/_examples -name 'ml*' |xargs rm -vrf
  81. # also wipe the workdirs, otherwise a rebuild will lead to chaos
  82. @chmod +w -R /home/me/usecases/{ml-project,imagenette}; rm -vrf /home/me/usecases/{ml-project,imagenette}