blob: 08723f760de01fb6929442bae79ac5105836a1ec [file] [log] [blame]
cristy16af1cb2009-12-11 21:38:29 +00001# Copyright 1999-2010 ImageMagick Studio LLC, a non-profit organization
cristy3ed852e2009-09-05 21:47:34 +00002# dedicated to making software imaging solutions freely available.
3#
4# You may not use this file except in compliance with the License. You may
5# obtain a copy of the License at
6#
7# http://www.imagemagick.org/script/license.php
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14#
15# Copyright (C) 2003 - 2008 GraphicsMagick Group
16#
17# Top-Level Makefile for building ImageMagick.
18#
19
20AUTOMAKE_OPTIONS = 1.11 subdir-objects parallel-tests color-tests dist-zip dist-bzip2 dist-xz foreign
21
22topincludedir = @includedir@/ImageMagick
23
24AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir)
25
26ACLOCAL_AMFLAGS = -I m4
27
cristyf5ee5be2009-11-06 02:22:56 +000028MODULECOMMONFLAGS = -no-undefined -export-symbols-regex ".*" -shared -module -avoid-version
cristy3ed852e2009-09-05 21:47:34 +000029
30# Options to pass when running configure in the distcheck target.
31#
32# We want to preserve user-provided option variables so the same
33# compiler, headers, and libraries are used as for a normal build.
34DISTCHECK_CONFIGURE_FLAGS=$(DISTCHECK_CONFIG_FLAGS)
35
cristy50620792010-02-09 00:42:32 +000036DISTCLEANFILES = _configs.sed magick/magick-config.h
37
cristy3ed852e2009-09-05 21:47:34 +000038## Make sure these will be cleaned even when they're not built by default.
39CLEANFILES = \
40 $(LTDL_CLEANFILES) \
41 $(WAND_CLEANFILES) \
42 $(MAGICKPP_CLEANFILES) \
43 $(UTILITIES_CLEANFILES) \
cristy52cf7f12010-02-07 18:07:56 +000044 $(TESTS_CLEANFILES)
cristy3ed852e2009-09-05 21:47:34 +000045
46bin_PROGRAMS = \
47 $(UTILITIES_PGMS)
48
49# Binary scripts
50bin_SCRIPTS = \
51 $(MAGICK_BIN_SCRPTS) \
52 $(WAND_BIN_SCRPTS) \
53 $(MAGICKPP_SCRPTS)
54
55include_HEADERS = \
56 $(LTDL_INSTALLHEADERS)
57
58# Headers which are not installed but which are distributed
59noinst_HEADERS = \
60 $(LIBLTDL_NOINST_HDRS) \
61 $(MAGICK_NOINST_HDRS)
62
63if WIN32_NATIVE_BUILD
64SRCDIR='$(shell @WinPathScript@ $(srcdir)/)'
65else
66SRCDIR="$(srcdir)/"
67endif
68
69# Environment parameters to be used during tests
70TESTS_ENVIRONMENT = \
cristy06ac4412010-05-24 01:08:07 +000071 COMPARE="$(MEMCHECK) @abs_top_builddir@/utilities/compare" \
72 COMPOSITE="$(MEMCHECK) @abs_top_builddir@/utilities/composite" \
73 CONJURE="$(MEMCHECK) @abs_top_builddir@/utilities/conjure" \
74 CONVERT="$(MEMCHECK) @abs_top_builddir@/utilities/convert" \
75 DISPLAY="$(MEMCHECK) @abs_top_builddir@/utilities/display" \
76 IDENTIFY="$(MEMCHECK) @abs_top_builddir@/utilities/identify" \
77 MONTAGE="$(MEMCHECK) @abs_top_builddir@/utilities/montage" \
78 VALIDATE="$(MEMCHECK) @abs_top_builddir@/tests/validate" \
cristy3ed852e2009-09-05 21:47:34 +000079 LD_LIBRARY_PATH="@abs_top_builddir@/magick/.libs:${LD_LIBRARY_PATH}" \
80 MAGICK_CODER_MODULE_PATH='@MAGICK_CODER_MODULE_PATH@' \
81 MAGICK_CONFIGURE_PATH='@MAGICK_CONFIGURE_BUILD_PATH@@DIRSEP@@MAGICK_CONFIGURE_SRC_PATH@' \
82 MAGICK_FILTER_MODULE_PATH='@MAGICK_FILTER_MODULE_PATH@' \
83 MAKE="$(MAKE)" \
84 MAKEFLAGS="$(MAKEFLAGS)" \
85 MEMCHECK="$(MEMCHECK)" \
86 PATH="@abs_top_builddir@/utilities:${PATH}" \
87 SRCDIR=$(SRCDIR)
88
89# Test extensions
90TEST_EXTENSIONS = .sh
91
92# Tests to run
93TESTS = \
cristy3ed852e2009-09-05 21:47:34 +000094 $(TESTS_TESTS) \
95 $(MAGICKPP_TESTS) \
96 $(WAND_TESTS) \
97 $(UTILITIES_TESTS)
98
99# Tests which are expected to fail
100XFAIL_TESTS = \
101 $(TESTS_XFAIL_TESTS) \
102 $(UTILITIES_XFAIL_TESTS)
103
104TOP_EXTRA_DIST = \
105 AUTHORS.txt \
106 ChangeLog \
107 LICENSE \
108 QuickStart.txt \
109 NOTICE \
110 Install-mac.txt \
111 Install-unix.txt \
112 Install-vms.txt \
113 Install-windows.txt \
114 magick.sh.in \
115 Magickshr.opt \
116 Make.com \
117 NEWS.txt \
118 Platforms.txt \
119 README.txt \
120 index.html \
121 version.sh \
122 winpath.sh
123
124# Additional files to distribute
125EXTRA_DIST = \
126 $(TOP_EXTRA_DIST) \
127 $(CONFIG_EXTRA_DIST) \
128 $(MAGICK_EXTRA_DIST) \
129 $(WAND_EXTRA_DIST) \
130 $(MAGICKPP_EXTRA_DIST) \
131 $(UTILITIES_EXTRA_DIST) \
132 $(TESTS_EXTRA_DIST)
133
134lib_LTLIBRARIES = $(MAGICKCORE_LIBS) $(MAGICKWAND_LIBS) $(MAGICKPP_LIBS)
135AM_LDFLAGS =
136noinst_LTLIBRARIES =
137EXTRA_LTLIBRARIES =
138BUILT_SOURCES =
139MOSTLYCLEANFILES =
140
141check_PROGRAMS = \
142 $(TESTS_CHECK_PGRMS) \
143 $(MAGICKPP_CHECK_PGRMS) \
144 $(WAND_CHECK_PGRMS)
145
146include m4/Makefile.am
147include config/Makefile.am
148include ltdl/Makefile.inc
149include coders/Makefile.am
150include magick/Makefile.am
151include filters/Makefile.am
152include wand/Makefile.am
153include Magick++/Makefile.am
154include utilities/Makefile.am
155include tests/Makefile.am
156include PerlMagick/Makefile.am
157
158# Pkgconfig directory
159pkgconfigdir = $(libdir)/pkgconfig
160
161# Files to install in Pkgconfig directory
162pkgconfig_DATA = \
163 $(MAGICK_PKGCONFIG) \
164 $(WAND_PKGCONFIG) \
165 $(MAGICKPP_PKGCONFIG)
166
167# Manual pages to install
168man_MANS = \
169 $(MAGICK_MANS) \
170 $(WAND_MANS) \
171 $(MAGICKPP_MANS) \
172 $(UTILITIES_MANS)
173
174# Architecture independent data files installed in the package's data directory
175docdir = $(SHARE_PATH)
176doc_DATA = \
177 LICENSE \
178 ChangeLog \
179 NEWS.txt
180
181if MAINTAINER_MODE
cristye6922d42010-03-04 01:56:45 +0000182MAINTAINER_TARGETS = \
cristy999b6472010-04-15 01:18:53 +0000183 magick-version \
184 ImageMagick.spec \
185 $(PERLMAGICK_MAINTAINER_TARGETS)
cristy3ed852e2009-09-05 21:47:34 +0000186endif
187
188all-local: $(MAGICKPP_LOCAL_TARGETS) $(PERLMAGICK_ALL_LOCAL_TARGETS) $(MAINTAINER_TARGETS)
189
190install-exec-local: $(PERLMAGICK_INSTALL_EXEC_LOCAL_TARGETS)
191
192install-data-local: $(MAGICK_INSTALL_DATA_LOCAL_TARGETS) $(PERLMAGICK_INSTALL_DATA_LOCAL_TARGETS) $(HTML_INSTALL_DATA_TARGETS)
193
194uninstall-local: $(MAGICK_UNINSTALL_LOCAL_TARGETS) $(PERLMAGICK_UNINSTALL_LOCAL_TARGETS) $(HTML_UNINSTALL_DATA_TARGETS)
195
196clean-local: $(PERLMAGICK_CLEAN_LOCAL_TARGETS)
197
198distclean-local: $(PERLMAGICK_DISTCLEAN_LOCAL_TARGETS)
199
200maintainer-clean-local: $(PERLMAGICK_MAINTAINER_CLEAN_LOCAL_TARGETS)
201
202check-local: $(PERLMAGICK_CHECK_LOCAL_TARGETS)
203
cristy2d9c0312010-04-17 23:58:07 +0000204# drd: valgrind's newer thread error detector
cristy3ed852e2009-09-05 21:47:34 +0000205drd:
cristy2d9c0312010-04-17 23:58:07 +0000206 $(MAKE) MEMCHECK='valgrind --tool=drd --check-stack-var=yes --var-info=yes \
207 --quiet $(VALGRIND_EXTRA_OPTS)' check
cristy3ed852e2009-09-05 21:47:34 +0000208
cristy9c7e2af2010-05-23 23:13:27 +0000209# drd: valgrind's newer thread error detector
210drd:
211 $(MAKE) MEMCHECK='valgrind --tool=drd --check-stack-var=yes --var-info=yes \
212 --quiet $(VALGRIND_EXTRA_OPTS)' check
213
cristy2d9c0312010-04-17 23:58:07 +0000214# helgrind: valgrind's older thread error detector
cristy3ed852e2009-09-05 21:47:34 +0000215helgrind:
cristy9c7e2af2010-05-23 23:13:27 +0000216 $(MAKE) MEMCHECK='valgrind --tool=helgrind --error-exitcode=2 --quiet \
217 $(VALGRIND_EXTRA_OPTS)' check
cristy3ed852e2009-09-05 21:47:34 +0000218
cristy2d9c0312010-04-17 23:58:07 +0000219# memcheck: valgrind's memory access checker
cristy3ed852e2009-09-05 21:47:34 +0000220memcheck:
cristy9c7e2af2010-05-23 23:13:27 +0000221 $(MAKE) MEMCHECK='valgrind --tool=memcheck --leak-check=full --read-var-info=yes \
222 --error-exitcode=2 --track-origins=yes --num-callers=12 \
223 --quiet $(VALGRIND_EXTRA_OPTS)' check
cristy3ed852e2009-09-05 21:47:34 +0000224
cristy2d9c0312010-04-17 23:58:07 +0000225# ptrcheck: valgrind's experimental pointer checking tool.
cristy3ed852e2009-09-05 21:47:34 +0000226ptrcheck:
cristy9c7e2af2010-05-23 23:13:27 +0000227 $(MAKE) MEMCHECK='valgrind --tool=exp-ptrcheck --quiet $(VALGRIND_EXTRA_OPTS)' check
cristy3ed852e2009-09-05 21:47:34 +0000228
229# Non-Automake subdirectories to distribute
230DISTDIRS = images scenes scripts www PerlMagick
231dist-hook:
232 ( \
233 builddir=`pwd` ; \
234 cd $(srcdir) && \
235 ( \
236 for dir in $(DISTDIRS) ; do \
237 find $$dir -depth -print | egrep -v '(~$$)|(/CVS)|(/\.#)|(/\.deps)|(/\.svn)' \
238 | cpio -pdum $$builddir/$(distdir) 2> /dev/null ; \
239 done \
240 ) \
241 )
242
243#
244# Additional install rules
245#
246
247# Install HTML files
248pkgdocdir = $(DOCUMENTATION_PATH)
249DOCDIRS = images www www/api www/api/MagickCore www/api/MagickWand www/Magick++
250HTML_INSTALL_DATA_TARGETS = install-data-html
251install-data-html:
252 $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)
253 $(INSTALL_DATA) $(srcdir)/index.html $(DESTDIR)$(pkgdocdir)
254 @for dir in $(DOCDIRS) ; do \
255 $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$$dir && \
256 for file in $(srcdir)/$$dir/*.* ; do \
257 echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdocdir)/$$dir" ; \
258 $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdocdir)/$$dir ; \
259 done ; \
260 done
261
262# Uninstall HTML files
263HTML_UNINSTALL_DATA_TARGETS = uninstall-data-html
264uninstall-data-html:
265 rm -f $(DESTDIR)$(pkgdocdir)/index.html
266 for dir in $(DOCDIRS) ; do \
267 rm -f -r $(DESTDIR)$(pkgdocdir)/$$dir ; \
268 done
269
270# Ensure that version.h at $(srcdir)/magick/version.h is kept up to date.
271magick-version: magick/version.h
272 @if test -f "$(srcdir)/VisualMagick/installer/inc/version.isx.in" ; then \
273 ./config.status --file="$(srcdir)/../VisualMagick/installer/inc/version.isx" 2> /dev/null ; \
274 fi
275 @if test -n "$(VPATH)" ; then \
276 cmp magick/version.h $(srcdir)/magick/version.h > /dev/null ; \
277 if test $$? -eq 1 ; then \
278 echo "Updating $(srcdir)/magick/version.h ..."; \
279 cp magick/version.h $(srcdir)/magick/version.h ; \
280 fi ; \
281 fi ; \
282 touch magick-version
283
284${srcdir}/configure: ${srcdir}/version.sh
285
286# Automagically reconfigure libtool
287LIBTOOL_DEPS = @LIBTOOL_DEPS@
288libtool: $(LIBTOOL_DEPS)
289 $(SHELL) ./config.status --recheck
290
291# Format C API documentation
292html:
293 doxygen config/MagickCore.dox
294 doxygen config/MagickWand.dox
295
296#
297# Build Windows source Zip and 7Zip balls
298#
299if ZIP_DELEGATE
cristy15a88782010-01-31 23:24:49 +0000300DIST_WINDOWS_SRC_ZIP=$(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM)-windows.zip
cristy3ed852e2009-09-05 21:47:34 +0000301else
302DIST_WINDOWS_SRC_ZIP=
303endif
304if P7ZIP_DELEGATE
cristy15a88782010-01-31 23:24:49 +0000305DIST_WINDOWS_SRC_7ZIP=$(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM)-windows.7z
cristy3ed852e2009-09-05 21:47:34 +0000306else
307DIST_WINDOWS_SRC_7ZIP=
308endif
309$(DIST_WINDOWS_SRC_ZIP) $(DIST_WINDOWS_SRC_7ZIP) windows-dist:
cristy15a88782010-01-31 23:24:49 +0000310 if test -d $(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM) ; then \
311 chmod -R u+w $(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM) ; \
312 rm -rf $(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM) ; \
cristy3ed852e2009-09-05 21:47:34 +0000313 fi
cristy15a88782010-01-31 23:24:49 +0000314 svn export https://subversion.imagemagick.org/subversion/ImageMagick-Windows/trunk $(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM)
cristy3ed852e2009-09-05 21:47:34 +0000315if ZIP_DELEGATE
316 rm -f $(DIST_WINDOWS_SRC_ZIP)
cristy15a88782010-01-31 23:24:49 +0000317 $(ZIP) -r -9 -q $(DIST_WINDOWS_SRC_ZIP) $(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM)
cristy3ed852e2009-09-05 21:47:34 +0000318endif # ZIP_DELEGATE
319if P7ZIP_DELEGATE
320 rm -f $(DIST_WINDOWS_SRC_7ZIP)
cristy15a88782010-01-31 23:24:49 +0000321 $(P7ZIP) a -t7z -mx=9 $(DIST_WINDOWS_SRC_7ZIP) $(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM)
cristy3ed852e2009-09-05 21:47:34 +0000322 chmod 644 $(DIST_WINDOWS_SRC_7ZIP)
323endif # P7ZIP_DELEGATE
cristy15a88782010-01-31 23:24:49 +0000324 rm -rf $(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM)
cristy3ed852e2009-09-05 21:47:34 +0000325
326#
327# RPM build support
328#
329if RPM_DELEGATE
330
cristy2d9c0312010-04-17 23:58:07 +0000331DIST_ARCHIVE_SRPM=$(distdir)-1.src.rpm
cristy3ed852e2009-09-05 21:47:34 +0000332.PHONY: srpm
cristy2d9c0312010-04-17 23:58:07 +0000333$(DIST_ARCHIVE_SRPM) srpm: dist
cristy3ed852e2009-09-05 21:47:34 +0000334 rm -f $(DIST_ARCHIVE_SRPM)
335 $(RPM) --define="_sourcedir `pwd`" --define="_srcrpmdir `pwd`" --nodeps --bs ImageMagick.spec
336 @echo ==============================================================
337 @echo $(DIST_ARCHIVE_SRPM) is ready for distribution.
338 @echo ==============================================================
339
cristy3225a072010-04-17 01:47:28 +0000340RPMDIR=rpmbuild
341RPMARCH=$(MAGICK_TARGET_CPU)
cristy3ed852e2009-09-05 21:47:34 +0000342
343DIST_ARCHIVE_RPM= \
cristy15a88782010-01-31 23:24:49 +0000344 $(RPMDIR)/$(RPMARCH)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM)-$(PACKAGE_RELEASE).$(RPMARCH).rpm \
345 $(RPMDIR)/$(RPMARCH)/$(PACKAGE_NAME)-c++-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM)-$(PACKAGE_RELEASE).$(RPMARCH).rpm \
346 $(RPMDIR)/$(RPMARCH)/$(PACKAGE_NAME)-c++-devel-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM)-$(PACKAGE_RELEASE).$(RPMARCH).rpm \
347 $(RPMDIR)/$(RPMARCH)/$(PACKAGE_NAME)-devel-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM)-$(PACKAGE_RELEASE).$(RPMARCH).rpm \
348 $(RPMDIR)/$(RPMARCH)/$(PACKAGE_NAME)-perl-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM)-$(PACKAGE_RELEASE).$(RPMARCH).rpm
cristy3ed852e2009-09-05 21:47:34 +0000349
350.PHONY: rpm
cristy2d9c0312010-04-17 23:58:07 +0000351rpm: dist
cristy3ed852e2009-09-05 21:47:34 +0000352 rm -rf $(RPMDIR)
cristy78cd7652010-04-17 22:50:03 +0000353 $(MKDIR_P) $(RPMDIR)
354 $(MKDIR_P) $(RPMDIR)/BUILD
355 $(MKDIR_P) $(RPMDIR)/RPMS
cristy3ed852e2009-09-05 21:47:34 +0000356 $(RPM) --define="_sourcedir `pwd`" --define="_rpmdir `pwd`/$(RPMDIR)/RPMS" --define="_builddir `pwd`/$(RPMDIR)/BUILD" --nodeps -bb ImageMagick.spec
cristy3ed852e2009-09-05 21:47:34 +0000357 @echo ==============================================================
358 @echo $(DIST_ARCHIVE_RPM) is ready for distribution.
359 @echo ==============================================================
360
361else
362DIST_ARCHIVE_RPM=
363endif # RPM_DELEGATE
364
365#
366# Build a validated snapshot release and move to the snapshots directory.
367#
368snapshot: distcheck
369 $(MAKE) $(DIST_ARCHIVE_SRPM)
370 $(MAKE) $(DIST_WINDOWS_SRC_ZIP)
371 $(MAKE) $(DIST_WINDOWS_SRC_7ZIP)
372 mv $(DIST_ARCHIVES) $(DIST_WINDOWS_SRC_ZIP) $(DIST_WINDOWS_SRC_7ZIP) $(DIST_ARCHIVE_SRPM) /var/ftp/pub/ImageMagick/beta/