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

Revision 9046, 11.5 kB (checked in by cristy, 7 months ago)
Line 
1#  Copyright 1999-2005 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        ChangeLog \
84        LICENSE \
85        QuickStart.txt \
86        NOTICE \
87        Install-mac.txt \
88        Install-unix.txt \
89        Install-vms.txt \
90        Install-windows.txt \
91        Magickshr.opt \
92        Make.com \
93        NEWS \
94        Platforms.txt \
95        README.txt \
96        index.html \
97        version.sh \
98        winpath.sh
99
100# Additional files to distribute
101EXTRA_DIST = \
102        $(TOP_EXTRA_DIST) \
103        $(CONFIG_EXTRA_DIST) \
104        $(MAGICK_EXTRA_DIST) \
105        $(MAGICKPP_EXTRA_DIST) \
106        $(TESTS_EXTRA_DIST) \
107        $(UTILITIES_EXTRA_DIST) \
108        $(WAND_EXTRA_DIST)
109
110lib_LTLIBRARIES = $(LIBMAGICK) $(LIBWAND) $(LIBMAGICKPP)
111AM_LDFLAGS =
112noinst_LTLIBRARIES =
113EXTRA_LTLIBRARIES =
114BUILT_SOURCES =
115MOSTLYCLEANFILES =
116
117check_PROGRAMS = \
118        $(TESTS_CHECK_PGRMS) \
119        $(MAGICKPP_CHECK_PGRMS) \
120        $(WAND_CHECK_PGRMS)
121
122include m4/Makefile.am
123include config/Makefile.am
124include ltdl/Makefile.inc
125include coders/Makefile.am
126include magick/Makefile.am
127include filters/Makefile.am
128include wand/Makefile.am
129include Magick++/Makefile.am
130include tests/Makefile.am
131include utilities/Makefile.am
132include PerlMagick/Makefile.am
133
134# Pkgconfig directory
135pkgconfigdir = $(libdir)/pkgconfig
136
137# Files to install in Pkgconfig directory
138pkgconfig_DATA = \
139        $(MAGICK_PKGCONFIG) \
140        $(MAGICKPP_PKGCONFIG) \
141        $(WAND_PKGCONFIG)
142
143# Manual pages to install
144man_MANS = \
145        $(MAGICK_MANS) \
146        $(MAGICKPP_MANS) \
147        $(UTILITIES_MANS) \
148        $(WAND_MANS)
149
150# Architecture independent data files installed in the package's data directory
151docdir = $(SHARE_PATH)
152doc_DATA = \
153        LICENSE \
154        ChangeLog \
155        NEWS
156
157if MAINTAINER_MODE
158MAINTAINER_TARGETS = magick-version # $(TXT2HTML_TARGETS)
159endif
160
161all-local: $(MAGICKPP_LOCAL_TARGETS) $(PERLMAGICK_ALL_LOCAL_TARGETS) $(MAINTAINER_TARGETS)
162
163install-exec-local: $(PERLMAGICK_INSTALL_EXEC_LOCAL_TARGETS)
164
165install-data-local: $(MAGICK_INSTALL_DATA_LOCAL_TARGETS) $(PERLMAGICK_INSTALL_DATA_LOCAL_TARGETS) $(HTML_INSTALL_DATA_TARGETS)
166
167uninstall-local: $(MAGICK_UNINSTALL_LOCAL_TARGETS) $(PERLMAGICK_UNINSTALL_LOCAL_TARGETS) $(HTML_UNINSTALL_DATA_TARGETS)
168
169clean-local: $(PERLMAGICK_CLEAN_LOCAL_TARGETS)
170
171distclean-local: $(PERLMAGICK_DISTCLEAN_LOCAL_TARGETS)
172
173maintainer-clean-local: $(PERLMAGICK_MAINTAINER_CLEAN_LOCAL_TARGETS)
174
175check-local: $(PERLMAGICK_CHECK_LOCAL_TARGETS)
176
177# Non-Automake subdirectories to distribute
178DISTDIRS = images scenes scripts www PerlMagick
179dist-hook:
180        ( \
181          builddir=`pwd` ; \
182          cd $(srcdir) && \
183          ( \
184            for dir in $(DISTDIRS) ; do \
185              find $$dir -depth -print | egrep -v '(~$$)|(/CVS)|(/\.#)|(/\.deps)' \
186                | cpio -pdum $$builddir/$(distdir) 2> /dev/null ; \
187            done \
188          ) \
189        )
190
191#
192# Additional install rules
193#
194
195# Install HTML files
196pkgdocdir = $(DOCUMENTATION_PATH)
197DOCDIRS = images www www/api www/Magick++
198HTML_INSTALL_DATA_TARGETS = install-data-html
199install-data-html:
200        $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)
201        $(INSTALL_DATA) $(srcdir)/index.html $(DESTDIR)$(pkgdocdir)
202        @for dir in $(DOCDIRS) ; do \
203          $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$$dir && \
204          for file in $(srcdir)/$$dir/*.* ; do \
205            echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdocdir)/$$dir" ; \
206            $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdocdir)/$$dir ; \
207          done ; \
208        done
209
210# Uninstall HTML files
211HTML_UNINSTALL_DATA_TARGETS = uninstall-data-html
212uninstall-data-html:
213        rm -f $(DESTDIR)$(pkgdocdir)/index.html
214        for dir in $(DOCDIRS) ; do \
215          rm -f -r $(DESTDIR)$(pkgdocdir)/$$dir ; \
216        done
217
218# Ensure that version.h at $(srcdir)/magick/version.h is kept up to date.
219magick-version: magick/version.h
220        @if test -f "$(srcdir)/VisualMagick/installer/inc/version.isx.in" ; then \
221          ./config.status --file="$(srcdir)/../VisualMagick/installer/inc/version.isx" 2> /dev/null ; \
222        fi
223        @if test -n "$(VPATH)" ; then \
224          cmp magick/version.h $(srcdir)/magick/version.h > /dev/null ; \
225          if test $$? -eq 1 ; then \
226            echo "Updating $(srcdir)/magick/version.h ..."; \
227            cp magick/version.h $(srcdir)/magick/version.h ; \
228          fi ; \
229        fi ; \
230        touch magick-version
231
232${srcdir}/configure: ${srcdir}/version.sh
233
234if WITH_PERL
235# txt2html requires perl.
236TXT2HTML_TARGETS = \
237        $(top_srcdir)/www/Authors.html \
238        $(top_srcdir)/www/Changelog.html \
239        $(top_srcdir)/www/Install-mac.html \
240        $(top_srcdir)/www/Install-unix.html \
241        $(top_srcdir)/www/Install-vms.html \
242        $(top_srcdir)/www/Install-windows.html \
243        $(top_srcdir)/www/News.html \
244        $(top_srcdir)/www/Copyright.html \
245        $(top_srcdir)/www/Notice.html \
246        $(top_srcdir)/www/README.html
247endif # WITH_PERL
248
249# Automatically reconfigure libtool
250LIBTOOL_DEPS = @LIBTOOL_DEPS@
251libtool: $(LIBTOOL_DEPS)
252        $(SHELL) ./config.status --recheck
253
254# Build HTML version of AUTHORS
255$(top_srcdir)/www/Authors.html: $(top_srcdir)/AUTHORS
256        mkdir -p www
257        @PERL@ $(top_srcdir)/scripts/txt2html -p 4 -pb 1 -t $(PACKAGE_NAME)' Authors' < $(top_srcdir)/AUTHORS > $(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-mac.txt
264$(top_srcdir)/www/Install-mac.html: $(top_srcdir)/Install-unix.txt
265        @PERL@ $(top_srcdir)/scripts/txt2html -s 55 -p 4 -pb 1 -t $(PACKAGE_NAME)' MacOS 9 Installation' < $(top_srcdir)/Install-mac.txt > $(top_srcdir)/www/Install-mac.html
266
267# Build HTML version of Install-unix.txt
268$(top_srcdir)/www/Install-unix.html: $(top_srcdir)/Install-unix.txt
269        @PERL@ $(top_srcdir)/scripts/txt2html -s 55 -p 4 -pb 1 -t $(PACKAGE_NAME)' Unix Installation' < $(top_srcdir)/Install-unix.txt > $(top_srcdir)/www/Install-unix.html
270
271# Build HTML version of Install-vms.txt
272$(top_srcdir)/www/Install-vms.html: $(top_srcdir)/Install-vms.txt
273        @PERL@ $(top_srcdir)/scripts/txt2html -s 55 -p 4 -pb 1 -t $(PACKAGE_NAME)' VMS Installation' < $(top_srcdir)/Install-vms.txt > $(top_srcdir)/www/Install-vms.html
274
275# Build HTML version of Install-windows.txt
276$(top_srcdir)/www/Install-windows.html: $(top_srcdir)/Install-windows.txt
277        @PERL@ $(top_srcdir)/scripts/txt2html -s 55 -p 4 -pb 1 -t $(PACKAGE_NAME)' Windows Installation' < $(top_srcdir)/Install-windows.txt > $(top_srcdir)/www/Install-windows.html
278
279# Build HTML version of news
280$(top_srcdir)/www/News.html: $(top_srcdir)/NEWS
281        @PERL@ $(top_srcdir)/scripts/txt2html -t $(PACKAGE_NAME)' '$(PACKAGE_VERSION)' News' < $(top_srcdir)/NEWS  > $(top_srcdir)/www/News.html
282
283# Build HTML version of LICENSE
284$(top_srcdir)/www/Copyright.html: $(top_srcdir)/LICENSE
285        @PERL@ $(top_srcdir)/scripts/txt2html -p 4 -pb 1 -t $(PACKAGE_NAME)' License' < $(top_srcdir)/LICENSE > $(top_srcdir)/www/Copyright.html
286
287# Build HTML version of NOTICE
288$(top_srcdir)/www/Notice.html: $(top_srcdir)/NOTICE
289        @PERL@ $(top_srcdir)/scripts/txt2html -p 4 -pb 1 -t $(PACKAGE_NAME)' Notice' < $(top_srcdir)/NOTICE > $(top_srcdir)/www/Notice.html
290
291# Build HTML version of README
292$(top_srcdir)/www/README.html: $(top_srcdir)/README.txt
293        @PERL@ $(top_srcdir)/scripts/txt2html -p 4 -pb 1 -t $(PACKAGE_NAME)' Install README' < $(top_srcdir)/README.txt > $(top_srcdir)/www/README.html
294
295# Format C API documentation
296format_c_api_docs:
297        @PERL@ $(top_srcdir)/scripts/format_c_api_docs -format html --srcdir $(top_srcdir)/magick --outdir $(top_srcdir)/www/api
298
299#
300# Build a Windows source Zip-ball
301#
302DIST_WINDOWS_SRC_ZIP=$(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM)-windows.zip
303$(DIST_WINDOWS_SRC_ZIP) windows-dist:
304        if test -d $(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM) ; then \
305          chmod -R u+w $(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM) ; \
306          rm -rf $(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM) ; \
307        fi
308        rm -f $(DIST_WINDOWS_SRC_ZIP)
309        zip -r -9 -q  $(DIST_WINDOWS_SRC_ZIP) $(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM)
310        rm -rf $(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM)
311
312#
313# RPM build support
314#
315if HAS_RPM
316
317DIST_ARCHIVE_SRPM=$(distdir)-1.src.rpm
318PHONY: srpm
319$(DIST_ARCHIVE_SRPM) srpm: dist
320        rm -f $(DIST_ARCHIVE_SRPM)
321        $(RPM) --define="_sourcedir `pwd`" --define="_srcrpmdir `pwd`" --nodeps -bs ImageMagick.spec
322        @echo ==============================================================
323        @echo $(DIST_ARCHIVE_SRPM) is ready for distribution.
324        @echo ==============================================================
325
326RPMDIR=redhat
327RPMARCH=i386
328
329DIST_ARCHIVE_RPM= \
330        $(RPMDIR)/$(RPMARCH)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM)-1.$(RPMARCH).rpm \
331        $(RPMDIR)/$(RPMARCH)/$(PACKAGE_NAME)-c++-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM)-1.$(RPMARCH).rpm \
332        $(RPMDIR)/$(RPMARCH)/$(PACKAGE_NAME)-c++-devel-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM)-1.$(RPMARCH).rpm \
333        $(RPMDIR)/$(RPMARCH)/$(PACKAGE_NAME)-devel-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM)-1.$(RPMARCH).rpm \
334        $(RPMDIR)/$(RPMARCH)/$(PACKAGE_NAME)-perl-$(PACKAGE_VERSION)$(PACKAGE_VERSION_ADDENDUM)-1.$(RPMARCH).rpm
335
336PHONY: rpm
337rpm:
338        rm -rf $(RPMDIR)
339        mkdir $(RPMDIR)
340        mkdir $(RPMDIR)/BUILD
341        mkdir $(RPMDIR)/RPMS
342        $(MAKE) distcheck
343        $(RPM) --define="_sourcedir `pwd`" --define="_rpmdir `pwd`/$(RPMDIR)/RPMS" --define="_builddir `pwd`/$(RPMDIR)/BUILD" --nodeps -bb ImageMagick.spec
344        rm -rf rpmbuild
345        @echo ==============================================================
346        @echo $(DIST_ARCHIVE_RPM) is ready for distribution.
347        @echo ==============================================================
348
349else
350DIST_ARCHIVE_RPM=
351endif # HAS_RPM
352
353#
354# Build a validated snapshot release and move to the snapshots directory.
355#
356snapshot: distcheck
357        $(MAKE) $(DIST_ARCHIVE_SRPM)
358        $(MAKE) $(DIST_WINDOWS_SRC_ZIP)
359        mv $(DIST_ARCHIVES) $(DIST_WINDOWS_SRC_ZIP) $(DIST_ARCHIVE_SRPM) /var/ftp/pub/ImageMagick/beta/
Note: See TracBrowser for help on using the browser.