Makefile.am 2.8 KB

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