Makefile.am 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. SUBDIRS = src
  2. bin_SCRIPTS = mbsync-get-cert
  3. EXTRA_DIST = debian isync.spec $(bin_SCRIPTS)
  4. LOG_PL = \
  5. use POSIX qw(strftime); \
  6. use Date::Parse; \
  7. use Text::Wrap; \
  8. $$Text::Wrap::columns = 72; \
  9. while (defined($$_ = <>)) { \
  10. /^commit / or die "commit missing: $$_"; \
  11. <> =~ /^log size (\d+)$$/ or die "wrong size"; \
  12. $$len = $$1; \
  13. read(STDIN, $$log, $$len) == $$len or die "unexpected EOF"; \
  14. $$log =~ s/^Author: ([^>]+>)\nDate: (\d{4}-\d\d-\d\d \d\d:\d\d:\d\d [-+]\d{4})\n(.*)$$/$$3/s or die "unexpected log format"; \
  15. $$author = $$1; $$date = str2time($$2); \
  16. scalar(<>); \
  17. @files = (); \
  18. $$pfx = ""; \
  19. while (defined($$l = <>) and $$l ne "\n") { \
  20. chomp $$l; \
  21. next if ($$l =~ m,^(ChangeLog$$|NEWS$$|TODO$$|debian/),); \
  22. if (!@files) { \
  23. $$pfx = $$l; \
  24. $$pfx =~ s,/?[^/]+$$,,; \
  25. } else { \
  26. while (length($$pfx)) { \
  27. $$l =~ m,^\Q$$pfx/\E, and last; \
  28. $$pfx =~ s,/?[^/]+$$,,; \
  29. } \
  30. } \
  31. push @files, $$l; \
  32. } \
  33. next if (!@files); \
  34. print strftime("%F %H:%M", gmtime($$date))." ".$$author."\n\n"; \
  35. if (@files > 1 and ($$len = length($$pfx))) { \
  36. @efiles = (); \
  37. for $$f (@files) { push @efiles, substr($$f, $$len + 1); } \
  38. $$fstr = $$pfx."/: "; \
  39. } else { \
  40. @efiles = @files; \
  41. $$fstr = ""; \
  42. } \
  43. print wrap("\t* ", "\t ", $$fstr.join(", ", @efiles).":")."\n"; \
  44. $$log =~ s, +$$,,gm; \
  45. $$log =~ s,^ ,\t,gm; \
  46. print $$log."\n"; \
  47. }
  48. $(srcdir)/.git/index:
  49. $(srcdir)/ChangeLog: $(srcdir)/.git/index
  50. $(MAKE) log
  51. log:
  52. @test -z "$(srcdir)" || cd $(srcdir) && \
  53. ( ! test -d .git || \
  54. git log --pretty=medium --date=iso --log-size --name-only --no-merges | \
  55. perl -e '$(LOG_PL)' > ChangeLog )
  56. cov-scan: clean
  57. /opt/cov-analysis-*/bin/cov-build --dir cov-int $(MAKE)
  58. tar cavf isync-cov.tar.xz cov-int
  59. deb:
  60. CFLAGS= INSTALL= dpkg-buildpackage -b --no-sign
  61. dist-hook:
  62. find $(distdir)/debian \( -name .#\*# -o -type l \) -print0 | xargs -0r rm -rf
  63. -cd $(distdir)/debian && test -f .gitignore && rm -rf `cut -c2- .gitignore` .gitignore
  64. dist-sign: dist
  65. gpg -b -a $(PACKAGE)-$(VERSION).tar.gz
  66. rpm: dist
  67. CFLAGS="-O2 -mtune=core2" rpmbuild --clean -ta $(PACKAGE)-$(VERSION).tar.gz
  68. rpm-ia32: dist
  69. CFLAGS="-O2 -m32 -march=i686" rpmbuild --target i686-unknown-linux --clean -ta $(PACKAGE)-$(VERSION).tar.gz
  70. doc_DATA = README TODO NEWS ChangeLog AUTHORS