Makefile.am 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. SUBDIRS = src
  2. bin_SCRIPTS = 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)/ChangeLog: log
  49. log:
  50. @test -z "$(srcdir)" || cd $(srcdir) && \
  51. ( ! test -d .git || \
  52. git log --pretty=medium --date=iso --log-size --name-only --no-merges | \
  53. perl -e '$(LOG_PL)' > ChangeLog )
  54. cov-scan: clean
  55. /opt/cov-analysis-*/bin/cov-build --dir cov-int $(MAKE)
  56. tar cavf isync.tar.xz cov-int
  57. deb: deb-clean
  58. CFLAGS= fakeroot debian/rules binary
  59. deb-clean:
  60. dh_clean -Xsrc/
  61. fakeroot debian/rules clean
  62. dist-hook:
  63. find $(distdir)/debian \( -name .#\*# -o -type l \) -print0 | xargs -0r rm -rf
  64. -cd $(distdir)/debian && test -f .gitignore && rm -rf `cat .gitignore` .gitignore
  65. dist-sign: dist
  66. gpg -b -a $(PACKAGE)-$(VERSION).tar.gz
  67. rpm: dist
  68. CFLAGS="-O2 -mtune=core2" rpmbuild --clean -ta $(PACKAGE)-$(VERSION).tar.gz
  69. rpm-ia32: dist
  70. CFLAGS="-O2 -m32 -march=i686" rpmbuild --target i686-unknown-linux --clean -ta $(PACKAGE)-$(VERSION).tar.gz
  71. doc_DATA = README TODO NEWS ChangeLog AUTHORS