Makefile 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. # Makefile for gnustandards conversion using reposurgeon
  2. CVS_HOST = cvs.savannah.gnu.org
  3. CVS_MODULE = gnustandards
  4. REMOTE_URL = cvs://$(CVS_HOST)/sources/gnustandards\#$(CVS_MODULE)
  5. VERBOSITY = "verbose 1"
  6. REPOSURGEON = reposurgeon
  7. # Configuration ends here.
  8. .PHONY: local-clobber remote-clobber gitg gc compare clean dist stubmap
  9. # Tell make not to auto-remove tag directories, because it only tries rm
  10. # and hence fails.
  11. .PRECIOUS: gnustandards-%-checkout gnustandards-%-git
  12. default: gnustandards-git
  13. # Build the converted repo from the second-stage fast-import stream.
  14. gnustandards-git: gnustandards.fi
  15. rm -fr $@; $(REPOSURGEON) "read <$<" "prefer git" \
  16. "rebuild gnustandards-git"
  17. CONVERSION_OBJS = \
  18. gnustandards.cvs \
  19. gnustandards.opts \
  20. gnustandards.lift \
  21. gnustandards.map \
  22. # Build the second-stage fast-import stream from the first-stage stream dump
  23. gnustandards.fi: $(CONVERSION_OBJS)
  24. $(REPOSURGEON) $(VERBOSITY) "script gnustandards.opts" \
  25. "read $(READ_OPTIONS) <gnustandards.cvs" \
  26. "authors read <gnustandards.map" "sourcetype cvs" \
  27. "prefer git" "script gnustandards.lift" \
  28. "legacy write >gnustandards.fo" "write >gnustandards.fi"
  29. # Build the first-stage stream dump from the local mirror.
  30. gnustandards.cvs: gnustandards-mirror
  31. repotool mirror $<
  32. (cd gnustandards-mirror/ >/dev/null; repotool export) > $@
  33. # Build a local mirror of the remote repository.
  34. gnustandards-mirror:
  35. repotool mirror $(REMOTE_URL) $@
  36. # Make a local checkout of the source mirror for inspection.
  37. gnustandards-checkout: gnustandards-mirror
  38. cd $< >/dev/null; repotool checkout ../$@
  39. # Make a local checkout of the source mirror for inspection at a specific tag.
  40. gnustandards-%-checkout: gnustandards-mirror
  41. cd $< >/dev/null; repotool checkout ../gnustandards-$*-checkout $*
  42. # Force rebuild of first-stage stream from the local mirror on the next make.
  43. local-clobber: clean
  44. rm -fr gnustandards.fi gnustandards-git *~ .rs* \
  45. gnustandards-conversion.tar.gz gnustandards-*-git
  46. # Force full rebuild from the remote repo on the next make.
  47. remote-clobber: local-clobber
  48. rm -fr gnustandards.cvs gnustandards-mirror \
  49. gnustandards-checkout gnustandards-*-checkout
  50. # Get the (empty) state of the author mapping from the first-stage stream
  51. stubmap: gnustandards.cvs
  52. $(REPOSURGEON) "read <$<" "authors write >gnustandards.map"
  53. # Compare the histories of the unconverted and converted repositories at head
  54. # and all tags.
  55. EXCLUDE = -x CVS -x .cvs -x .git -x .cvsignore -x .gitignore
  56. headcompare:
  57. repotool compare $(EXCLUDE) gnustandards-checkout gnustandards-git
  58. tagscompare:
  59. repotool compare-tags $(EXCLUDE) gnustandards-checkout gnustandards-git
  60. # General cleanup and utility
  61. clean:
  62. rm -fr *~ *.cvs *.fi *.fo *-git gnustandards-conversion.tar.gz .rs*
  63. # Bundle up the conversion metadata for shipping
  64. SOURCES = Makefile gnustandards.lift gnustandards.map $(EXTRAS)
  65. gnustandards-conversion.tar.gz: $(SOURCES)
  66. tar -h --transform 's:^:gnustandards-conversion/:' -czvf $@ $*
  67. dist: gnustandards-conversion.tar.gz
  68. # Browse the generated git repository
  69. gitg: gnustandards-git
  70. cd gnustandards-git; $@ --all
  71. # Run a garbage-collect on the generated git repository. Import doesn't.
  72. # This repack call is the active part of gc --aggressive. This call is tuned
  73. # for very large repositories.
  74. gc: gnustandards-git
  75. cd gnustandards-git
  76. time git -c pack.threads=1 repack -AdF --window=1250 --depth=250