[configure.in] Build fails on Solaris due to non-POSIX ctime_r()
[cairo/haiku.git] / Makefile.am
blob0458998b7a9c01011b5f0bdd7a3c6ff08804aba7
1 DIST_SUBDIRS = src boilerplate test perf doc util
2 SUBDIRS = src doc
3 # libpng is required for our test programs
4 if CAIRO_HAS_PNG_FUNCTIONS
5 SUBDIRS += boilerplate test perf
6 endif
9 .PHONY: doc test retest recheck check-valgrind
10 # We have some generated header files, so we really need to build the
11 # library before we can build the docs
12 doc: all
13         cd doc && $(MAKE) $(AM_MAKEFLAGS) doc
14 test: all
15         cd test && $(MAKE) $(AM_MAKEFLAGS) test
16 retest: all
17         cd test && $(MAKE) $(AM_MAKEFLAGS) retest
18 recheck: all
19         cd test && $(MAKE) $(AM_MAKEFLAGS) recheck
20 check-valgrind: all
21         cd test && $(MAKE) $(AM_MAKEFLAGS) check-valgrind
22         cd perf && $(MAKE) $(AM_MAKEFLAGS) check-valgrind
23 perf: all
24         cd perf && $(MAKE) $(AM_MAKEFLAGS) perf
26 if CAIRO_HAS_LCOV
27 # use recursive makes in order to ignore errors during check/perf
28 lcov:
29         -$(MAKE) $(AM_MAKEFLAGS) check
30         $(MAKE) $(AM_MAKEFLAGS) genlcov
31 lcov-perf:
32         -$(MAKE) $(AM_MAKEFLAGS) perf
33         $(MAKE) $(AM_MAKEFLAGS) genlcov
35 # we have to massage the lcov.info file slightly to hide the effect of libtool
36 # placing the objects files in the .libs/ directory separate from the *.c
37 genlcov:
38         $(LTP) --directory $(top_builddir) --path $(top_builddir) --capture --output-file cairo-lcov.info --test-name CAIRO_TEST --no-checksum
39         $(SED) -e 's#.libs/##' \
40                -e 's#boilerplate/src#src#' \
41                -e 's#$(shell pwd)#$(shell cd $(top_srcdir) && pwd)#' \
42                < cairo-lcov.info > cairo-lcov.info.tmp
43         LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory cairo-lcov --title "Cairo Code Coverage" --show-details cairo-lcov.info.tmp
44         $(RM) cairo-lcov.info.tmp
45 else
46 lcov lcov-perf genlcov:
47         @echo You need to configure Cairo with support for gcov enabled.
48         @echo e.g, ./configure --enable-gcov
49 endif
51 lcov-clean:
52 if CAIRO_HAS_LCOV
53         -$(LTP) --directory $(top_builddir) -z
54 endif
55         -$(RM) -r cairo-lcov.info cairo-lcov
56         -$(FIND) -name '*.gcda' -print | $(XARGS) $(RM)
58 EXTRA_DIST = \
59         AUTHORS \
60         BIBLIOGRAPHY \
61         BUGS \
62         CODING_STYLE \
63         COPYING \
64         COPYING-LGPL-2.1 \
65         COPYING-MPL-1.1 \
66         INSTALL \
67         NEWS \
68         PORTING_GUIDE \
69         README \
70         RELEASING
71 DISTCLEANFILES = config.cache
72 distclean-local: lcov-clean
74 MAINTAINERCLEANFILES = \
75         $(srcdir)/aclocal.m4 \
76         $(srcdir)/autoscan.log \
77         $(srcdir)/compile \
78         $(srcdir)/config.guess \
79         $(srcdir)/config.h.in \
80         $(srcdir)/config.sub \
81         $(srcdir)/configure.scan \
82         $(srcdir)/depcomp \
83         $(srcdir)/install-sh \
84         $(srcdir)/ltmain.sh \
85         $(srcdir)/missing \
86         $(srcdir)/mkinstalldirs \
87         `find "$(srcdir)" -type f -name Makefile.in -print`
89 DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-test-surfaces
91 include $(srcdir)/ChangeLog.mk
93 # Some custom targets to make it easier to release things.
95 # To make real stable releases or devel snapshots, use either:
96 #               make release-check
97 # or            make release-publish
99 # To make a quick properly named (date and git hash stamped) tarball:
100 #               make snapshot
102 snapshot:
103         distdir="$(distdir)-`date '+%Y%m%d'`"; \
104         test -d "$(srcdir)/.git" && distdir=$$distdir-`cd "$(srcdir)" && git-rev-parse HEAD | cut -c 1-6`; \
105         $(MAKE) $(AM_MAKEFLAGS) distdir="$$distdir" dist
107 RELEASE_OR_SNAPSHOT = $$(if test "x$(CAIRO_VERSION_MINOR)" = "x$$(echo "$(CAIRO_VERSION_MINOR)/2*2" | bc)" ; then echo release; else echo snapshot; fi)
108 RELEASE_UPLOAD_HOST =   cairographics.org
109 RELEASE_UPLOAD_BASE =   /srv/cairo.freedesktop.org/www
110 RELEASE_UPLOAD_DIR =    $(RELEASE_UPLOAD_BASE)/$(RELEASE_OR_SNAPSHOT)s
111 RELEASE_URL_BASE =      http://cairographics.org/$(RELEASE_OR_SNAPSHOT)s
112 RELEASE_ANNOUNCE_LIST = cairo-announce@cairographics.org (and CC gnome-announce-list@gnome.org)
114 MANUAL_DATED =          cairo-manual-`date +%Y%m%d`
115 MANUAL_TAR_FILE =       $(MANUAL_DATED).tar.gz
116 MANUAL_UPLOAD_DIR =     $(RELEASE_UPLOAD_BASE)
118 tar_file = $(PACKAGE)-$(VERSION).tar.gz
119 sha1_file = $(tar_file).sha1
120 gpg_file = $(sha1_file).asc
122 $(sha1_file): $(tar_file)
123         sha1sum $^ > $@
125 $(gpg_file): $(sha1_file)
126         @echo "Please enter your GPG password to sign the checksum."
127         gpg --armor --sign $^ 
129 # Win32 package zipfiles
130 runtime_zip_file = /tmp/$(PACKAGE)-$(VERSION).zip
131 developer_zip_file = /tmp/$(PACKAGE)-dev-$(VERSION).zip
133 $(runtime_zip_file): install
134         -$(RM) $@
135         cd $(prefix); \
136         zip $@ bin/libcairo-$(LT_CURRENT_MINUS_AGE).dll
138 $(developer_zip_file): install
139         -$(RM) $@
140         cd $(prefix); \
141         zip -r $@ include/cairo lib/libcairo.dll.a lib/cairo.lib lib/pkgconfig/cairo.pc lib/pkgconfig/cairo-*.pc share/gtk-doc/html/cairo
143 zips: $(runtime_zip_file) $(developer_zip_file)
145 release-verify-sane-changelogs: changelogs
146         @echo -n "Checking that the ChangeLog files are sane..."
147         @if grep -q "is required to generate" $(CHANGELOGS); then \
148                 (echo "Ouch." && echo "Some of the ChangeLogs are not generated correctly." \
149                 && echo "Remove ChangeLog* and make changelogs" \
150                 && false); else :; fi
151         @echo "Good."
153 release-verify-sane-tests:
154         @echo "Checking that the test suite is sane..."
155         @cd test && $(MAKE) $(AM_MAKEFLAGS) release-verify-sane-tests
157 release-verify-soname-major:
158         @echo -n "Checking that the cairo soname major number is 2..."
159         @test "$(LT_CURRENT_MINUS_AGE)" = "2" \
160                 || (echo "Ouch." && echo "The soname major number is $(LT_CURRENT_MINUS_AGE) instead of 2." \
161                 && echo "The libtool shared library version numbers in configure.in must be incremented properly." \
162                 && false)
163         @echo "Good."
165 release-verify-even-micro:
166         @echo -n "Checking that $(VERSION) has an even micro component..."
167         @test "$(CAIRO_VERSION_MICRO)" = "`echo $(CAIRO_VERSION_MICRO)/2*2 | bc`" \
168                 || (echo "Ouch." && echo "The version micro component '$(CAIRO_VERSION_MICRO)' is not an even number." \
169                 && echo "The version in configure.in must be incremented before a new release." \
170                 && false)
171         @echo "Good."
173 release-verify-newer:
174         @echo -n "Checking that no $(VERSION) release already exists..."
175         @ssh $(RELEASE_UPLOAD_HOST) test ! -e $(RELEASE_UPLOAD_DIR)/$(tar_file) \
176                 || (echo "Ouch." && echo "Found: $(RELEASE_UPLOAD_HOST):$(RELEASE_UPLOAD_DIR)/$(tar_file)" \
177                 && echo "Are you sure you have an updated checkout?" \
178                 && echo "This should never happen." \
179                 && false)
180         @echo "Good."
182 release-remove-old:
183         $(RM) $(tar_file) $(sha1_file) $(gpg_file)
185 # Maybe it's just my system, but somehow group sticky bits keep
186 # getting set and this causes failures in un-tarring on some systems.
187 # Until I figure out where the sticky bit is coming from, just clean
188 # these up before building a release.
189 release-cleanup-group-sticky:
190         find . -type f | xargs chmod g-s
192 release-check: release-verify-sane-changelogs release-verify-sane-tests release-verify-soname-major release-verify-even-micro release-verify-newer release-remove-old release-cleanup-group-sticky distcheck
194 release-upload: release-check $(tar_file) $(sha1_file) $(gpg_file)
195         mkdir -p releases
196         scp $(tar_file) $(sha1_file) $(gpg_file) $(RELEASE_UPLOAD_HOST):$(RELEASE_UPLOAD_DIR)
197         mv $(tar_file) $(sha1_file) $(gpg_file) releases
198         ssh $(RELEASE_UPLOAD_HOST) "rm -f $(RELEASE_UPLOAD_DIR)/LATEST-$(PACKAGE)-[0-9]* && ln -s $(tar_file) $(RELEASE_UPLOAD_DIR)/LATEST-$(PACKAGE)-$(VERSION)"
199         git-tag -s  -m "cairo $(CAIRO_VERSION_MAJOR).$(CAIRO_VERSION_MINOR).$(CAIRO_VERSION_MICRO) release" $(CAIRO_VERSION_MAJOR).$(CAIRO_VERSION_MINOR).$(CAIRO_VERSION_MICRO)
201 release-publish-message: releases/$(sha1_file)
202         @echo "Please follow the instructions in RELEASING to push stuff out and"
203         @echo "send out the announcement mails.  Here is the excerpt you need:"
204         @echo ""
205         @echo "Subject: $(PACKAGE) $(RELEASE_OR_SNAPSHOT) $(VERSION) now available"
206         @echo ""
207         @echo "============================== CUT HERE =============================="
208         @echo "A new $(PACKAGE) $(RELEASE_OR_SNAPSHOT) $(VERSION) is now available from:"
209         @echo ""
210         @echo " $(RELEASE_URL_BASE)/$(tar_file)"
211         @echo ""
212         @echo "    which can be verified with:"
213         @echo ""
214         @echo " $(RELEASE_URL_BASE)/$(sha1_file)"
215         @echo -n "      "
216         @cat releases/$(sha1_file)
217         @echo ""
218         @echo " $(RELEASE_URL_BASE)/$(gpg_file)"
219         @echo " (signed by `getent passwd "$$USER" | cut -d: -f 5 | cut -d, -f 1`)"
220         @echo ""
221         @echo "  Additionally, a git clone of the source tree:"
222         @echo ""
223         @echo " git clone git://git.cairographics.org/git/cairo"
224         @echo ""
225         @echo "    will include a signed $(VERSION) tag which points to a commit named:"
226         @echo " `git cat-file tag $(VERSION) | grep ^object | sed -e 's,object ,,'`"
227         @echo ""
228         @echo "    which can be verified with:"
229         @echo " git verify-tag $(VERSION)"
230         @echo ""
231         @echo "    and can be checked out with a command such as:"
232         @echo " git checkout -b build $(VERSION)"
233         @echo ""
234         @echo "============================== CUT HERE =============================="
236 release-publish: release-upload release-publish-message
238 doc-publish: doc
239         rm -rf ./$(MANUAL_DATED)
240         cp -a doc/public/html $(MANUAL_DATED)
241         tar czf $(MANUAL_TAR_FILE) $(MANUAL_DATED)
242         scp $(MANUAL_TAR_FILE) $(RELEASE_UPLOAD_HOST):$(MANUAL_UPLOAD_DIR)
243         ssh $(RELEASE_UPLOAD_HOST) "cd $(MANUAL_UPLOAD_DIR) && tar xzf $(MANUAL_TAR_FILE) && rm -f manual && ln -s $(MANUAL_DATED) manual && ln -sf $(MANUAL_TAR_FILE) cairo-manual.tar.gz"
245 .PHONY: release-verify-even-micro release-verify-newer release-remove-old release-cleanup-group-sticky release-check release-upload release-publish docs-publish lcov lcov-perf lcov-clean genlcov
247 EXTRA_DIST += Makefile.win32