root/WizardsToolkit/trunk/Makefile.am @ 1

Revision 1, 9.0 KB (checked in by cristy, 3 months ago)


RevLine 
[1]1#  Copyright 1999-2009 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.wizards-toolkit.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 the Wizard's Toolkit.
16
17AUTOMAKE_OPTIONS = 1.11 subdir-objects parallel-tests color-tests dist-zip dist-bzip2 dist-xz  foreign
18
19topincludedir = @includedir@
20
21AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir)
22
23ACLOCAL_AMFLAGS = -I m4
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        $(BZIP_CLEANFILES) \
34        $(ZIP_CLEANFILES) \
35        $(TESTS_CLEANFILES) \
36        $(UTILITIES_CLEANFILES)
37
38bin_PROGRAMS = \
39        $(UTILITIES_PGMS)
40
41# Binary scripts
42bin_SCRIPTS = \
43        $(WIZARD_BIN_SCRPTS)
44
45include_HEADERS =
46
47# Headers which are not installed but which are distributed
48noinst_HEADERS = \
49        $(BZIP_LIBS_NOINST_HDRS) \
50        $(ZIP_LIBS_NOINST_HDRS) \
51        $(WIZARD_NOINST_HDRS)
52
53if WIN32_NATIVE_BUILD
54SRCDIR='$(shell @WinPathScript@ $(srcdir)/)'
55else
56SRCDIR="$(srcdir)/"
57endif
58
59# Environment parameters to be used during tests
60TESTS_ENVIRONMENT = \
61  ENCIPHER="$(MEMCHECK) @abs_top_builddir@/utilities/encipher" \
62  DECIPHER="$(MEMCHECK) @abs_top_builddir@/utilities/decipher" \
63  CIPHERINFO="$(MEMCHECK) @abs_top_builddir@/utilities/cipher-info" \
64  KEYRING="$(MEMCHECK) @abs_top_builddir@/utilities/keyring" \
65  DIGEST="$(MEMCHECK) @abs_top_builddir@/utilities/digest" \
66  VALIDATE="$(MEMCHECK) @abs_top_builddir@/tests/validate" \
67        LD_LIBRARY_PATH="@abs_top_builddir@/wizard/.libs:${LD_LIBRARY_PATH}" \
68        WIZARD_CODER_MODULE_PATH='@WIZARD_CODER_MODULE_PATH@' \
69        WIZARD_CONFIGURE_PATH='@WIZARD_CONFIGURE_BUILD_PATH@@DIRSEP@@WIZARD_CONFIGURE_SRC_PATH@' \
70        WIZARD_FILTER_MODULE_PATH='@WIZARD_FILTER_MODULE_PATH@' \
71        MAKE="$(MAKE)" \
72        MAKEFLAGS="$(MAKEFLAGS)" \
73        MEMCHECK="$(MEMCHECK)" \
74        PATH="@abs_top_builddir@/utilities:${PATH}" \
75        SRCDIR=$(SRCDIR)
76
77# Test extensions
78TEST_EXTENSIONS = .sh
79
80# Tests to run
81TESTS = \
82        $(TESTS_TESTS) \
83        $(UTILITIES_TESTS)
84
85# Tests which are expected to fail
86XFAIL_TESTS = \
87        $(TESTS_XFAIL_TESTS)
88
89TOP_EXTRA_DIST = \
90  AUTHORS.txt \
91        README.txt \
92        QuickStart.txt \
93        ChangeLog \
94        LICENSE \
95        NOTICE \
96        NEWS.txt \
97        index.html \
98        version.sh \
99        winpath.sh \
100        wizard.sh.in
101
102# Additional files to distribute
103EXTRA_DIST = \
104        $(TOP_EXTRA_DIST) \
105        $(CONFIG_EXTRA_DIST) \
106        $(WIZARD_EXTRA_DIST) \
107        $(BZIP_EXTRA_DIST) \
108        $(ZIP_EXTRA_DIST) \
109        $(TESTS_EXTRA_DIST) \
110        $(UTILITIES_EXTRA_DIST)
111
112lib_LTLIBRARIES = $(WIZARD_LIBS) $(BZIP_LIBS) $(ZIP_LIBS)
113
114check_PROGRAMS = \
115        $(TESTS_CHECK_PGRMS) \
116        $(ZIP_CHECK_PGRMS)
117
118include m4/Makefile.am
119include config/Makefile.am
120include wizard/Makefile.am
121include tests/Makefile.am
122include utilities/Makefile.am
123
124# Pkgconfig directory
125pkgconfigdir = $(libdir)/pkgconfig
126
127# Files to install in Pkgconfig directory
128pkgconfig_DATA = \
129        $(WIZARD_PKGCONFIG)
130
131# Manual pages to install
132man_MANS = \
133        $(WIZARD_MANS) \
134        $(UTILITIES_MANS)
135
136# Architecture independent data files installed in the package's data directory
137docdir = $(SHARE_PATH)
138doc_DATA = \
139        LICENSE \
140        ChangeLog \
141        NEWS.txt
142
143if MAINTAINER_MODE
144MAINTAINER_TARGETS = wizard-version $(RST2HTML_TARGETS)
145endif
146
147all-local: $(BZIP_LOCAL_TARGETS) $(ZIP_LOCAL_TARGETS) $(MAINTAINER_TARGETS)
148
149install-exec-local:
150
151install-data-local: $(WIZARD_INSTALL_DATA_LOCAL_TARGETS) $(HTML_INSTALL_DATA_TARGETS)
152
153uninstall-local: $(WIZARD_UNINSTALL_LOCAL_TARGETS) $(HTML_UNINSTALL_DATA_TARGETS)
154
155clean-local:
156
157distclean-local:
158
159maintainer-clean-local:
160
161check-local:
162
163drd:
164        $(MAKE) MEMCHECK='valgrind --tool=drd --check-stack-var=yes --var-info=yes --quiet $(VALGRIND_EXTRA_OPTS)' check
165
166helgrind:
167        $(MAKE) MEMCHECK='valgrind --tool=helgrind --quiet $(VALGRIND_EXTRA_OPTS)' check
168
169memcheck:
170        $(MAKE) MEMCHECK='valgrind --tool=memcheck --quiet $(VALGRIND_EXTRA_OPTS)' check
171
172ptrcheck:
173        $(MAKE) MEMCHECK='valgrind --tool=exp-ptrcheck --quiet $(VALGRIND_EXTRA_OPTS)' check
174
175# Non-Automake subdirectories to distribute
176DISTDIRS = images scripts windows www
177dist-hook:
178        ( \
179          builddir=`pwd` ; \
180          cd $(srcdir) && \
181          ( \
182            for dir in $(DISTDIRS) ; do \
183              find $$dir -depth -print | egrep -v '(~$$)|(/CVS)|(/\.#)|(/\.deps)|(/\.svn)' \
184                | cpio -pdum $$builddir/$(distdir) 2> /dev/null ; \
185            done \
186          ) \
187        )
188
189#
190# Additional install rules
191#
192
193# Install HTML files
194pkgdocdir = $(DOCUMENTATION_PATH)
195DOCDIRS = images www www/api www/api/WizardsToolkit
196HTML_INSTALL_DATA_TARGETS = install-data-html
197install-data-html:
198        $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)
199        $(INSTALL_DATA) $(srcdir)/index.html $(DESTDIR)$(pkgdocdir)
200        @for dir in $(DOCDIRS) ; do \
201          $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$$dir && \
202          for file in $(srcdir)/$$dir/*.* ; do \
203            echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdocdir)/$$dir" ; \
204            $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdocdir)/$$dir ; \
205          done ; \
206        done
207
208# Uninstall HTML files
209HTML_UNINSTALL_DATA_TARGETS = uninstall-data-html
210uninstall-data-html:
211        rm -f $(DESTDIR)$(pkgdocdir)/index.html
212        for dir in $(DOCDIRS) ; do \
213          rm -f -r $(DESTDIR)$(pkgdocdir)/$$dir ; \
214        done
215
216# Ensure that version.h at $(srcdir)/wizard/version.h is kept up to date.
217wizard-version: wizard/version.h
218        @if test -f "$(srcdir)/windows/installer/scripts/version.isx.in" ; then \
219          ./config.status --file="$(srcdir)/windows/installer/scripts/version.isx" 2> /dev/null ; \
220        fi
221        @if test -n "$(VPATH)" ; then \
222          cmp wizard/version.h $(srcdir)/wizard/version.h > /dev/null ; \
223          if test $$? -eq 1 ; then \
224            echo "Updating $(srcdir)/wizard/version.h ..."; \
225            cp wizard/version.h $(srcdir)/wizard/version.h ; \
226          fi ; \
227        fi ; \
228        touch wizard-version
229
230${srcdir}/configure: ${srcdir}/version.sh
231
232# Automatically reconfigure libtool
233LIBTOOL_DEPS = @LIBTOOL_DEPS@
234libtool: $(LIBTOOL_DEPS)
235        $(SHELL) ./config.status --recheck
236
237# Format C API documentation
238html:
239        doxygen config/WizardsToolkit.dox
240
241#
242# Build Windows source Zip and 7Zip balls
243#
244if ZIP_DELEGATE
245DIST_WINDOWS_SRC_ZIP=$(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_LIB_SUBVERSION)-windows.zip
246else
247DIST_WINDOWS_SRC_ZIP=
248endif
249if P7ZIP_DELEGATE
250DIST_WINDOWS_SRC_7ZIP=$(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_LIB_SUBVERSION)-windows.7z
251else
252DIST_WINDOWS_SRC_7ZIP=
253endif
254$(DIST_WINDOWS_SRC_ZIP) $(DIST_WINDOWS_SRC_7ZIP) windows-dist:
255        if test -d $(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_LIB_SUBVERSION) ; then \
256          chmod -R u+w $(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_LIB_SUBVERSION) ; \
257          rm -rf $(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_LIB_SUBVERSION) ; \
258        fi
259if ZIP_DELEGATE
260        rm -f $(DIST_WINDOWS_SRC_ZIP)
261        $(ZIP) -r -9 -q  $(DIST_WINDOWS_SRC_ZIP) $(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_LIB_SUBVERSION)
262endif # ZIP_DELEGATE
263if P7ZIP_DELEGATE
264        rm -f $(DIST_WINDOWS_SRC_7ZIP)
265        $(P7ZIP) a -t7z -mx=9 $(DIST_WINDOWS_SRC_7ZIP) $(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_LIB_SUBVERSION)
266        chmod 644 $(DIST_WINDOWS_SRC_7ZIP)
267endif # P7ZIP_DELEGATE
268        rm -rf $(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_LIB_SUBVERSION)
269
270#
271# RPM build support
272#
273if RPM_DELEGATE
274
275DIST_ARCHIVE_SRPM=$(distdir)-$(PACKAGE_RELEASE).src.rpm
276.PHONY: srpm
277$(DIST_ARCHIVE_SRPM) srpm: dist
278        rm -f $(DIST_ARCHIVE_SRPM)
279        $(RPM) --define="_sourcedir `pwd`" --define="_srcrpmdir `pwd`" --nodeps --bs WizardsToolkit.spec
280        @echo ==============================================================
281        @echo $(DIST_ARCHIVE_SRPM) is ready for distribution.
282        @echo ==============================================================
283
284RPMDIR=redhat
285RPMARCH=i386
286
287DIST_ARCHIVE_RPM= \
288        $(RPMDIR)/$(RPMARCH)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)$(PACKAGE_LIB_SUBVERSION)-$(PACKAGE_RELEASE).$(RPMARCH).rpm \
289        $(RPMDIR)/$(RPMARCH)/$(PACKAGE_NAME)-devel-$(PACKAGE_VERSION)$(PACKAGE_LIB_SUBVERSION)-$(PACKAGE_RELEASE).$(RPMARCH).rpm
290
291.PHONY: rpm
292rpm:
293        rm -rf $(RPMDIR)
294        mkdir $(RPMDIR)
295        mkdir $(RPMDIR)/BUILD
296        mkdir $(RPMDIR)/RPMS
297        $(MAKE) distcheck
298        $(RPM) --define="_sourcedir `pwd`" --define="_rpmdir `pwd`/$(RPMDIR)/RPMS" --define="_builddir `pwd`/$(RPMDIR)/BUILD" --nodeps -bb WizardsToolkit.spec
299        rm -rf rpmbuild
300        @echo ==============================================================
301        @echo $(DIST_ARCHIVE_RPM) is ready for distribution.
302        @echo ==============================================================
303
304else
305DIST_ARCHIVE_RPM=
306endif # RPM_DELEGATE
307
308#
309# Build a validated snapshot release and move to the snapshots directory.
310#
311snapshot: distcheck
312        $(MAKE) $(DIST_ARCHIVE_SRPM)
313        $(MAKE) $(DIST_WINDOWS_SRC_ZIP)
314        mv $(DIST_ARCHIVES) $(DIST_WINDOWS_SRC_ZIP) $(DIST_ARCHIVE_SRPM) /var/ftp/pub/WizardsToolkit/beta/
Note: See TracBrowser for help on using the browser.