Merged default into xdg-dirs
[pidgin-git.git] / Makefile.am
blobe26a60f798436df1f418555c46754093c0bc30bc
1 EXTRA_DIST = \
2                 COPYRIGHT \
3                 ChangeLog.API \
4                 ChangeLog.win32 \
5                 HACKING \
6                 Makefile.mingw \
7                 PLUGIN_HOWTO \
8                 README.hg \
9                 README.mingw \
10                 config.h.mingw \
11                 intltool-extract.in \
12                 intltool-merge.in \
13                 intltool-update.in \
14                 m4macros/introspection.m4 \
15                 package_revision.h \
16                 po/Makefile.mingw \
17                 tap-driver.sh \
18                 tap-test \
19                 valgrind-suppressions
21 noinst_HEADERS = config.h package_revision.h
23 dist-pre-hook: package_revision.h
24 if !ENABLE_GTK_DOC
25         $(AM_V_at)echo "error: gtk-doc must be installed and enabled in order to make dist"
26         $(AM_V_at)echo "re-run ./configure with --enable-gtk-doc switch and try again"
27         $(AM_V_at)false
28 endif
29         $(AM_V_at)if [ ! -f "$(top_builddir)libpurple/libpurple.la" ]; then \
30                 $(MAKE) -C libpurple libpurple.la; \
31         fi
32         $(AM_V_at)if [ ! -f "$(top_builddir)libpurple/protocols/facebook/libfacebook.la" ]; then \
33                 $(MAKE) -C libpurple/protocols/facebook libfacebook.la; \
34         fi
35 if ENABLE_GNT
36         $(AM_V_at)if [ ! -f "$(top_builddir)finch/libgnt/libgnt.la" ]; then \
37                 $(MAKE) -C finch/libgnt libgnt.la; \
38         fi
39         $(AM_V_at)if [ ! -f "$(top_builddir)finch/libfinch.la" ]; then \
40                 $(MAKE) -C finch libfinch.la; \
41         fi
42 endif
43 if ENABLE_GTK
44         $(AM_V_at)if [ ! -f "$(top_builddir)pidgin/libpidgin.la" ]; then \
45                 $(MAKE) -C pidgin libpidgin.la; \
46         fi
47 endif
49 dist: dist-pre-hook
51 dist-hook:
52         rm $(distdir)/config.h
54 commit-check:
55         (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)
57 # Ensure these files are sorted and contain no duplicates:
58         LC_ALL=C sort -c -t/ -u po/POTFILES.in
59         LC_ALL=C sort -c -t/ -u po/POTFILES.skip
61 # Ensure COPYRIGHT is 100% UTF-8
62         iconv -f utf8 -t utf8 COPYRIGHT | cmp COPYRIGHT -
64 version-check:
65 # Ensure our version string does not contain "dev"
66         test x`echo $(PACKAGE_VERSION) | grep dev` = x
68 # Ensure ChangeLogs have the correct version
69         head ChangeLog     | grep "^version $(PACKAGE_VERSION) (.*):$$" >/dev/null
70         head ChangeLog.API | grep "^version $(PACKAGE_VERSION):$$" >/dev/null
72 # Ensure we're working from a tag...
73         test x`hg log -r "tag($(PACKAGE_VERSION))" --template "{node}"` = x`hg log -r . -T '{node}'`
74 # ... and have no changes in the working copy.
75         test "x`hg st -mard`" = x
77 sign-packages: dist
78         gpg -ab pidgin-$(PACKAGE_VERSION).tar.gz
79         gpg -ab pidgin-$(PACKAGE_VERSION).tar.bz2
80         gpg --verify pidgin-$(PACKAGE_VERSION).tar.gz.asc pidgin-$(PACKAGE_VERSION).tar.gz
81         gpg --verify pidgin-$(PACKAGE_VERSION).tar.bz2.asc pidgin-$(PACKAGE_VERSION).tar.bz2
83 release: commit-check version-check distcheck sign-packages
85 if INSTALL_I18N
86 PO_DIR=po
87 endif
89 if ENABLE_GTK
90 GTK_DIR=pidgin
91 endif
93 if ENABLE_GNT
94 GNT_DIR=finch
95 endif
97 # We always try to rebuild all objects that depends on this dummy target.
98 .FORCE:
100 # if both attempts fail, then we need to remove the empty file that >
101 # creates, and also make sure that the shell command exits
102 # successfully; the rm -f ensures both
103 package_revision_raw.txt: .FORCE
104         $(AM_V_GEN)REAL_BLDDIR=$$PWD/$(top_builddir); \
105         (hg --cwd $(srcdir) log -r . -T {node}) 2>/dev/null >$@.new \
106         || rm -f $@.new
107         $(AM_V_at)if test -f $@.new; then \
108                 if ! test -f "$@" || ! diff "$@" "$@".new > /dev/null ; then \
109                         mv $@.new $@; \
110                 else \
111                         rm $@.new; \
112                 fi \
113         fi
114 package_revision.h: package_revision_raw.txt
115         $(AM_V_GEN)if test -f $<; then \
116                 echo "#define REVISION \"`cat $<`\"" > $@; \
117         fi
118         $(AM_V_at)if test ! -f $@ -a -f $(srcdir)/$@; then \
119                 cp $(srcdir)/$@ $@; \
120         fi
121         $(AM_V_at)test -f $@ || echo "#define REVISION \"unknown\"" > $@
123 # This is a magic directive copy-and-pasted, then modified, from the
124 # automake 1.9 manual, section 13.4, "Checking the distribution".
125 # Normally, 'distcheck' does a clean build, and then afterwards runs
126 # 'distclean', and 'distclean' is supposed to remove everything that
127 # the build created.  However, we have some targets (package_revision.txt)
128 # that we distribute, but then always attempt to rebuild optimistically, and
129 # then if that fails fall back on the distributed versions.  This
130 # means that 'distclean' should _not_ remove those files, since they
131 # are distributed, yet building the package will generate those files,
132 # thus automake thinks that 'distclean' _should_ remove those files,
133 # and 'distcheck' gets cranky if we don't.  So basically what this
134 # line does is tell 'distcheck' to shut up and ignore those two files.
135 distcleancheck_listfiles = find . -type f -a ! -name package_revision.h
137 AM_DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
139 SUBDIRS = . m4macros libpurple $(GNT_DIR) $(GTK_DIR) $(PO_DIR) share/ca-certs share/sounds doc
141 DISTCLEANFILES= intltool-extract intltool-merge intltool-update \
142                         package_revision_raw.txt