Add a few comments and change version-check to not depend on commit-check
[pidgin-git.git] / Makefile.am
blob71a1ae16d87dfd983abc92ab2b8f4a432eb500e9
1 EXTRA_DIST = \
2                 COPYRIGHT \
3                 ChangeLog.API \
4                 ChangeLog.win32 \
5                 Doxyfile.in \
6                 HACKING \
7                 Makefile.mingw \
8                 PLUGIN_HOWTO \
9                 README.MTN \
10                 README.mingw \
11                 config.h.mingw \
12                 doxy2devhelp.xsl \
13                 fix-casts.sh \
14                 gaim.pc.in \
15                 gaim-uninstalled.pc.in \
16                 intltool-extract.in \
17                 intltool-merge.in \
18                 intltool-update.in \
19                 package_revision.h \
20                 pidgin.apspec.in \
21                 pidgin.spec.in \
22                 pidgin.desktop.in \
23                 po/Makefile.mingw \
24                 valgrind-suppressions
26 noinst_HEADERS = config.h package_revision.h
28 dist-hook: pidgin.spec
29         cp pidgin.spec $(distdir)
30         rm $(distdir)/config.h
32 distcheck-hook: libpurple/plugins/perl/common/Purple.pm pidgin/plugins/perl/common/Pidgin.pm
33 #       cp libpurple/plugins/perl/common/Gaim.pm $(distdir)/libpurple/plugins/perl/common
35 commit-check:
36         (cd po ; intltool-update -m 2>&1 | grep -v '^mismatched quotes.*\.py$$' | sed "s|current directory|po directory|" | grep . ; if [ $$? = 0 ] ; then exit 1 ; else exit 0 ; fi)
38 # Ensure these files are sorted and contain no duplicates:
39         LC_ALL=C sort -c -t/ -u po/POTFILES.in
40         LC_ALL=C sort -c -t/ -u po/POTFILES.skip
42 # Ensure COPYRIGHT is 100% UTF-8
43         iconv -f utf8 -t utf8 COPYRIGHT | cmp COPYRIGHT -
45 version-check:
46 # We don't want to release development versions.
47         test x`echo $(PACKAGE_VERSION) | grep dev` = x
49 # When doing a new minor (or major) release (X.Y.0), there must be a section in
50 # ChangeLog.API.
51         echo $(PACKAGE_VERSION) | grep -v "^[0-9]\+\.[0-9]\+\.0$$" >/dev/null || head ChangeLog.API | grep "^version $(PACKAGE_VERSION) (`date +%m/%d/%Y`):$$" >/dev/null
53 # For all releases, check the ChangeLogs.
54         head ChangeLog | grep "^version $(PACKAGE_VERSION) (`date +%m/%d/%Y`):$$" >/dev/null
55         head po/ChangeLog | grep "^version $(PACKAGE_VERSION)$$" >/dev/null
57 # Ensure we're working from a tag...
58         test x`hg log -r "tag($(PACKAGE_VERSION))" --template "{node}"` = x`hg id -i --debug`
59 # ... and have no changes in the working copy. (this isn't really necessary with hg because hg id appends a "+")
60         test "x`hg st -mard`" = x
62 release: commit-check version-check distcheck packages
64 packages:
65         gpg -ab pidgin-$(PACKAGE_VERSION).tar.gz
66         gpg -ab pidgin-$(PACKAGE_VERSION).tar.bz2
67         gpg --verify pidgin-$(PACKAGE_VERSION).tar.gz.asc pidgin-$(PACKAGE_VERSION).tar.gz
68         gpg --verify pidgin-$(PACKAGE_VERSION).tar.bz2.asc pidgin-$(PACKAGE_VERSION).tar.bz2
70 if INSTALL_I18N
71 PO_DIR=po
72 DESKTOP_FILE=pidgin.desktop
74 if ENABLE_GTK
75 appsdir = $(datadir)/applications
76 apps_in_files = pidgin.desktop.in
77 apps_DATA = $(apps_in_files:.desktop.in=.desktop)
78 @INTLTOOL_DESKTOP_RULE@
79 endif #ENABLE_GTK
81 endif #INSTALL_I18N
83 if ENABLE_GTK
84 GTK_DIR=pidgin
85 endif
87 if ENABLE_GNT
88 GNT_DIR=finch
89 endif
91 # This is phony, so that we always try to rebuild it.  If it succeeds
92 # in calculating changes, it produces its target; otherwise, its
93 # target does not exist.
94 .PHONY: package_revision_raw.txt
95 # if both attempts fail, then we need to remove the empty file that >
96 # creates, and also make sure that the shell command exits
97 # successfully; the rm -f ensures both
98 package_revision_raw.txt:
99         $(AM_V_GEN)REAL_BLDDIR=$$PWD/$(top_builddir); \
100         (hg --cwd $(srcdir) id -i --debug) 2>/dev/null >$@ \
101         || rm -f $@
102 package_revision.h: package_revision_raw.txt
103         $(AM_V_GEN)if test -f $<; then \
104           echo "#define REVISION \"`cat $<`\"" > $@; \
105         fi
106         $(AM_V_at)if test ! -f $@ -a -f $(srcdir)/$@; then \
107           cp $(srcdir)/$@ $@; \
108         fi
109         $(AM_V_at)test -f $@ || echo "#define REVISION \"unknown\"" > $@
111 # This is a magic directive copy-and-pasted, then modified, from the
112 # automake 1.9 manual, section 13.4, "Checking the distribution".
113 # Normally, 'distcheck' does a clean build, and then afterwards runs
114 # 'distclean', and 'distclean' is supposed to remove everything that
115 # the build created.  However, we have some targets (package_revision.txt)
116 # that we distribute, but then always attempt to rebuild optimistically, and
117 # then if that fails fall back on the distributed versions.  This
118 # means that 'distclean' should _not_ remove those files, since they
119 # are distributed, yet building the package will generate those files,
120 # thus automake thinks that 'distclean' _should_ remove those files,
121 # and 'distcheck' gets cranky if we don't.  So basically what this
122 # line does is tell 'distcheck' to shut up and ignore those two files.
123 distcleancheck_listfiles = find . -type f -a ! -name package_revision.h
125 SUBDIRS = . libpurple doc $(GNT_DIR) $(GTK_DIR) m4macros $(PO_DIR) share/ca-certs share/sounds
127 docs: Doxyfile
128 if HAVE_DOXYGEN
129         @echo "Running doxygen..."
130         @doxygen
131 if HAVE_XSLTPROC
132         @echo "Generating devhelp index..."
133         @xsltproc $(top_srcdir)/doxy2devhelp.xsl doc/xml/index.xml > doc/html/pidgin.devhelp
134         @echo "(Symlink $$(pwd)/doc/html to ~/.local/share/gtk-doc/html/pidgin to make devhelp see the documentation)"
135 else
136         @echo "Not generating devhelp index: xsltproc was not found by configure"
137 endif
138 else
139         @echo "doxygen was not found during configure.  Unable to build documentation."
140         @echo;
141 endif
143 # perl's MakeMaker uninstall foo doesn't work well with DESTDIR set, which
144 # breaks "make distcheck" unless we ignore perl things
146 distuninstallcheck_listfiles = \
147         find . -type f -print | grep -v perl | grep -v Purple.3pm
149 DISTCLEANFILES= $(DESKTOP_FILE) libpurple/gconf/purple.schemas intltool-extract \
150                         intltool-merge intltool-update