root / ImageMagick / branches / ImageMagick-6.3.9 / Makefile.am

Revision 10239, 10.8 kB (checked in by cristy, 6 months ago)
Line 
1#  Copyright 1999-2008 ImageMagick Studio LLC, a non-profit organization
2#  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#  Top-Level Makefile for building ImageMagick.
16
17topincludedir = @includedir@
18
19AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir)
20
21ACLOCAL_AMFLAGS = -I m4
22
23MODULECOMMONFLAGS = -no-undefined -export-symbols-regex ".*" -module -avoid-version
24
25# Options to pass when running configure in the distcheck target.
26#
27# We want to preserve user-provided option variables so the same
28# compiler, headers, and libraries are used as for a normal build.
29DISTCHECK_CONFIGURE_FLAGS=$(DISTCHECK_CONFIG_FLAGS)
30
31## Make sure these will be cleaned even when they're not built by default.
32CLEANFILES = \
33        $(LTDL_CLEANFILES) \
34        $(MAGICKPP_CLEANFILES) \
35        $(UTILITIES_CLEANFILES) \
36        $(TESTS_CLEANFILES) \
37        $(WAND_CLEANFILES)
38
39bin_PROGRAMS = \
40        $(UTILITIES_PGMS)
41
42# Binary scripts
43bin_SCRIPTS = \
44        $(MAGICK_BIN_SCRPTS) \
45        $(MAGICKPP_SCRPTS) \
46        $(WAND_BIN_SCRPTS)
47
48include_HEADERS = \
49        $(LTDL_INSTALLHEADERS)
50
51# Headers which are not installed but which are distributed
52noinst_HEADERS = \
53        $(LIBLTDL_NOINST_HDRS) \
54        $(MAGICK_NOINST_HDRS)
55
56if WIN32_NATIVE_BUILD
57SRCDIR='$(shell @WinPathScript@ $(srcdir)/)'
58else
59SRCDIR="$(srcdir)/"
60endif
61
62RUNENV = $(SHELL) `pwd`/magick.sh
63
64# Environment parameters to be used during tests
65TESTS_ENVIRONMENT = \
66        RUNENV="$(RUNENV)" \
67        SRCDIR=$(SRCDIR) \
68        CONVERT="$(RUNENV) `pwd`/utilities/convert" \
69        COMPOSITE="$(RUNENV) `pwd`/utilities/composite" \
70        MONTAGE="$(RUNENV) `pwd`/utilities/montage"
71
72# Tests to run
73TESTS = \
74        $(TESTS_TESTS) \
75        $(MAGICKPP_TESTS) \
76        $(UTILITIES_TESTS)
77
78# Tests which are expected to fail
79XFAIL_TESTS = \
80        $(TESTS_XFAIL_TESTS)
81
82TOP_EXTRA_DIST = \
83  AUTHORS.txt \
84        ChangeLog \
85        LICENSE \
86        QuickStart.txt \
87        NOTICE \
88        Install-mac.txt \
89        Install-unix.txt \
90        Install-vms.txt \
91        Install-windows.txt \
92        Magickshr.opt \
93        Make.com \
94        NEWS.txt \
95        Platforms.txt \
96        README.txt \
97        index.html \
98        version.sh \
99        winpath.sh
100
101# Additional files to distribute
102EXTRA_DIST = \
103        $(TOP_EXTRA_DIST) \
104        $(CONFIG_EXTRA_DIST) \
105        $(MAGICK_EXTRA_DIST) \
106        $(MAGICKPP_EXTRA_DIST) \
107        $(TESTS_EXTRA_DIST) \
108        $(UTILITIES_EXTRA_DIST) \
109        $(WAND_EXTRA_DIST)
110
111lib_LTLIBRARIES = $(LIBMAGICK) $(LIBWAND) $(LIBMAGICKPP)
112AM_LDFLAGS =
113noinst_LTLIBRARIES =
114EXTRA_LTLIBRARIES =
115BUILT_SOURCES =
116MOSTLYCLEANFILES =
117
118check_PROGRAMS = \
119        $(TESTS_CHECK_PGRMS) \
120        $(MAGICKPP_CHECK_PGRMS) \
121        $(WAND_CHECK_PGRMS)
122
123include m4/Makefile.am
124include config/Makefile.am
125include ltdl/Makefile.inc
126include coders/Makefile.am
127include magick/Makefile.am
128include filters/Makefile.am
129include wand/Makefile.am
130include Magick++/Makefile.am
131include tests/Makefile.am
132include utilities/Makefile.am
133include PerlMagick/Makefile.am
134
135# Pkgconfig directory
136pkgconfigdir = $(libdir)/pkgconfig
137
138# Files to install in Pkgconfig directory
139pkgconfig_DATA = \
140        $(MAGICK_PKGCONFIG) \
141        $(MAGICKPP_PKGCONFIG) \
142        $(WAND_PKGCONFIG)
143
144# Manual pages to install
145man_MANS = \
146        $(MAGICK_MANS) \
147        $(MAGICKPP_MANS) \
148        $(UTILITIES_MANS) \
149        $(WAND_MANS)
150
151# Architecture independent data files installed in the package's data directory
152docdir = $(SHARE_PATH)
153doc_DATA = \
154        LICENSE \
155        ChangeLog \
156        NEWS.txt
157
158if MAINTAINER_MODE
159MAINTAINER_TARGETS = magick-version # $(RST2HTML_TARGETS)
160endif
161
162all-local: $(MAGICKPP_LOCAL_TARGETS) $(PERLMAGICK_ALL_LOCAL_TARGETS) $(MAINTAINER_TARGETS)
163
164install-exec-local: $(PERLMAGICK_INSTALL_EXEC_LOCAL_TARGETS)
165
166install-data-local: $(MAGICK_INSTALL_DATA_LOCAL_TARGETS) $(PERLMAGICK_INSTALL_DATA_LOCAL_TARGETS) $(HTML_INSTALL_DATA_TARGETS)
167
168uninstall-local: $(MAGICK_UNINSTALL_LOCAL_TARGETS) $(PERLMAGICK_UNINSTALL_LOCAL_TARGETS) $(HTML_UNINSTALL_DATA_TARGETS)
169
170clean-local: $(PERLMAGICK_CLEAN_LOCAL_TARGETS)
171
172distclean-local: $(PERLMAGICK_DISTCLEAN_LOCAL_TARGETS)
173
174maintainer-clean-local: $(PERLMAGICK_MAINTAINER_CLEAN_LOCAL_TARGETS)
175
176check-local: $(PERLMAGICK_CHECK_LOCAL_TARGETS)
177
178# Non-Automake subdirectories to distribute
179DISTDIRS = images scenes scripts www PerlMagick
180dist-hook:
181        ( \
182          builddir=`pwd` ; \
183          cd $(srcdir) && \
184          ( \
185            for dir in $(DISTDIRS) ; do \
186              find $$dir -depth -print | egrep -v '(~$$)|(/CVS)|(/\.#)|(/\.deps)|(/\.svn)' \
187                | cpio -pdum $$builddir/$(distdir) 2> /dev/null ; \
188            done \
189          ) \
190        )
191
192#
193# Additional install rules
194#
195
196# Install HTML files
197pkgdocdir = $(DOCUMENTATION_PATH)
198DOCDIRS = images www www/api www/api/MagickCore www/api/MagickWand www/Magick++
199HTML_INSTALL_DATA_TARGETS = install-data-html
200install-data-html:
201        $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)
202        $(INSTALL_DATA) $(srcdir)/index.html $(DESTDIR)$(pkgdocdir)
203        @for dir in $(DOCDIRS) ; do \
204          $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$$dir && \
205          for file in $(srcdir)/$$dir/*.* ; do \
206            echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdocdir)/$$dir" ; \
207            $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdocdir)/$$dir ; \
208          done ; \
209        done
210
211# Uninstall HTML files
212HTML_UNINSTALL_DATA_TARGETS = uninstall-data-html
213uninstall-data-html:
214        rm -f $(DESTDIR)$(pkgdocdir)/index.html
215        for dir in $(DOCDIRS) ; do \
216          rm -f -r $(DESTDIR)$(pkgdocdir)/$$dir ; \
217        done
218
219# Ensure that version.h at $(srcdir)/magick/version.h is kept up to date.
220magick-version: magick/version.h
221        @if test -f "$(srcdir)/VisualMagick/installer/inc/version.isx.in" ; then \
222          ./config.status --file="$(srcdir)/../VisualMagick/installer/inc/version.isx" 2> /dev/null ; \
223        fi
224        @if test -n "$(VPATH)" ; then \
225          cmp magick/version.h $(srcdir)/magick/version.h > /dev/null ; \
226          if test $$? -eq 1 ; then \
227            echo "Updating $(srcdir)/magick/version.h ..."; \
228            cp magick/version.h $(srcdir)/magick/version.h ; \
229          fi ; \
230        fi ; \
231        touch magick-version
232
233${srcdir}/configure: ${srcdir}/version.sh
234
235if HasRST2HTML
236RST2HTML_COMMAND = $(RST2HTML) --stylesheet=$(srcdir)/www/magick.css --date --time
237RST2HTML_TARGETS = \
238        $(top_srcdir)/www/Authors.html \
239        $(top_srcdir)/www/Changelog.html \
240        $(top_srcdir)/www/Install-mac.html \
241        $(top_srcdir)/www/Install-unix.html \
242        $(top_srcdir)/www/Install-vms.html \
243        $(top_srcdir)/www/Install-windows.html \
244        $(top_srcdir)/www/News.html \
245        $(top_srcdir)/www/Copyright.html \
246        $(top_srcdir)/www/Notice.html \
247        $(top_srcdir)/www/README.html
248endif
249
250# Automatically reconfigure libtool
251LIBTOOL_DEPS = @LIBTOOL_DEPS@
252libtool: $(LIBTOOL_DEPS)
253        $(SHELL) ./config.status --recheck
254
255# Build HTML version of AUTHORS.txt
256$(top_srcdir)/www/AUTHORS.html: $(top_srcdir)/AUTHORS.txt
257        $(RST2HTML_COMMAND) $(top_srcdir)/AUTHORS.txt $(top_srcdir)/www/AUTHORS.html
258
259# Build HTML version of ChangeLog
260$(top_srcdir)/www/Changelog.html: $(top_srcdir)/ChangeLog
261        @PERL@ $(top_srcdir)/scripts/txt2html  -t $(PACKAGE_NAME)' '$(PACKAGE_VERSION)' ChangeLog' < $(top_srcdir)/ChangeLog > $(top_srcdir)/www/Changelog.html
262
263# Build HTML version of Install-unix.txt
264$(top_srcdir)/www/Install-unix.html: $(top_srcdir)/Install-unix.txt
265        $(RST2HTML_COMMAND) $(top_srcdir)/Install-unix.txt $(top_srcdir)/www/Install-unix.html
266
267# Build HTML version of Install-windows.txt
268$(top_srcdir)/www/Install-windows.html: $(top_srcdir)/Install-windows.txt
269        $(RST2HTML_COMMAND) $(top_srcdir)/Install-windows.txt $(top_srcdir)/www/Install-windows.html
270
271# Build HTML version of news
272$(top_srcdir)/www/NEWS.html: $(top_srcdir)/NEWS.txt
273        $(RST2HTML_COMMAND) $(top_srcdir)/NEWS.txt $(top_srcdir)/www/NEWS.html
274
275# Build HTML version of PLATFORMS
276$(top_srcdir)/www/PLATFORMS.html: $(top_srcdir)/Platforms.txt
277        $(RST2HTML_COMMAND) $(top_srcdir)/PLATFORMS.txt $(top_srcdir)/www/Platforms.html
278
279# Build HTML version of README
280$(top_srcdir)/www/README.html: $(top_srcdir)/README.txt
281        $(RST2HTML_COMMAND) $(top_srcdir)/README.txt $(top_srcdir)/www/README.html
282
283# Format C API documentation
284html:
285        doxygen config/MagickCore.dox
286        doxygen config/MagickWand.dox
287
288#
289# Build Windows source Zip and 7Zip balls
290#
291if HAS_ZIP
292DIST_WINDOWS_SRC_ZIP=$(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM)-windows.zip
293else
294DIST_WINDOWS_SRC_ZIP=
295endif
296if HAS_P7ZIP
297DIST_WINDOWS_SRC_7ZIP=$(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM)-windows.7z
298else
299DIST_WINDOWS_SRC_7ZIP=
300endif
301$(DIST_WINDOWS_SRC_ZIP) windows-dist:
302        if test -d $(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM) ; then \
303          chmod -R u+w $(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM) ; \
304          rm -rf $(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM) ; \
305        fi
306if HAS_ZIP
307        rm -f $(DIST_WINDOWS_SRC_ZIP)
308        $(ZIP) -r -9 -q  $(DIST_WINDOWS_SRC_ZIP) $(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM)
309endif # HAS_ZIP
310if HAS_P7ZIP
311        rm -f $(DIST_WINDOWS_SRC_7ZIP)
312        $(P7ZIP) a -t7z -mx=9 $(DIST_WINDOWS_SRC_7ZIP) $(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM)
313        chmod 644 $(DIST_WINDOWS_SRC_7ZIP)
314endif # HAS_P7ZIP
315        rm -rf $(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM)
316
317#
318# RPM build support
319#
320if HAS_RPM
321
322DIST_ARCHIVE_SRPM=$(distdir)-1.src.rpm
323PHONY: srpm
324$(DIST_ARCHIVE_SRPM) srpm: dist
325        rm -f $(DIST_ARCHIVE_SRPM)
326        $(RPM) --define="_sourcedir `pwd`" --define="_srcrpmdir `pwd`" --nodeps -bs ImageMagick.spec
327        @echo ==============================================================
328        @echo $(DIST_ARCHIVE_SRPM) is ready for distribution.
329        @echo ==============================================================
330
331RPMDIR=redhat
332RPMARCH=i386
333
334DIST_ARCHIVE_RPM= \
335        $(RPMDIR)/$(RPMARCH)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM)-1.$(RPMARCH).rpm \
336        $(RPMDIR)/$(RPMARCH)/$(PACKAGE_NAME)-c++-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM)-1.$(RPMARCH).rpm \
337        $(RPMDIR)/$(RPMARCH)/$(PACKAGE_NAME)-c++-devel-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM)-1.$(RPMARCH).rpm \
338        $(RPMDIR)/$(RPMARCH)/$(PACKAGE_NAME)-devel-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM)-1.$(RPMARCH).rpm \
339        $(RPMDIR)/$(RPMARCH)/$(PACKAGE_NAME)-perl-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM)-1.$(RPMARCH).rpm
340
341PHONY: rpm
342rpm:
343        rm -rf $(RPMDIR)
344        mkdir $(RPMDIR)
345        mkdir $(RPMDIR)/BUILD
346        mkdir $(RPMDIR)/RPMS
347        $(MAKE) distcheck
348        $(RPM) --define="_sourcedir `pwd`" --define="_rpmdir `pwd`/$(RPMDIR)/RPMS" --define="_builddir `pwd`/$(RPMDIR)/BUILD" --nodeps -bb ImageMagick.spec
349        rm -rf rpmbuild
350        @echo ==============================================================
351        @echo $(DIST_ARCHIVE_RPM) is ready for distribution.
352        @echo ==============================================================
353
354else
355DIST_ARCHIVE_RPM=
356endif # HAS_RPM
357
358#
359# Build a validated snapshot release and move to the snapshots directory.
360#
361snapshot: distcheck
362        $(MAKE) $(DIST_ARCHIVE_SRPM)
363        $(MAKE) $(DIST_WINDOWS_SRC_ZIP)
364        mv $(DIST_ARCHIVES) $(DIST_WINDOWS_SRC_ZIP) $(DIST_ARCHIVE_SRPM) /var/ftp/pub/ImageMagick/beta/
Note: See TracBrowser for help on using the browser.