root/ImageMagick/trunk/PerlMagick/Makefile.am

Revision 1341, 4.0 KB (checked in by cristy, 6 days ago)
Line 
1#  Copyright 1999-2010 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#  Copyright (C) 2003 - 2008 GraphicsMagick Group
16#
17#  Makefile for building PerlMagick.
18
19# If source files missing, see if they can be obtained via VPATH
20perl-sources:
21        @if test -n "$(VPATH)" ; then \
22          echo "Linking PerlMagick Sources ..." ; \
23          imagemagick=`(cd $(VPATH) ; pwd)` && \
24          ( cd $(PERLMAGICK) && \
25            sh $$imagemagick/config/lndir.sh $$imagemagick/$(PERLMAGICK) ) \
26        fi ; \
27        touch perl-sources
28
29if WITH_PERL
30
31PERLMAGICK=PerlMagick
32PERLMAKEMAKER=$(PERLMAGICK)/Makefile.PL
33PERLMAKEFILE=$(PERLMAGICK)/Makefile
34
35PERLMAGICK_ALL_LOCAL_TARGETS = all-perl
36PERLMAGICK_INSTALL_EXEC_LOCAL_TARGETS = install-exec-perl
37PERLMAGICK_INSTALL_DATA_LOCAL_TARGETS =
38PERLMAGICK_UNINSTALL_LOCAL_TARGETS = uninstall-exec-perl
39PERLMAGICK_CLEAN_LOCAL_TARGETS = clean-perl
40PERLMAGICK_DISTCLEAN_LOCAL_TARGETS = clean-perl
41PERLMAGICK_MAINTAINER_CLEAN_LOCAL_TARGETS = distclean-local
42PERLMAGICK_TESTS = PerlMagick/check.sh
43
44if WITH_PERL_DYNAMIC
45
46PERLMAGICK_CHECKSCRIPTS =
47
48$(PERLMAKEFILE): perl-sources $(MAGICKCORE_LIBS) $(MAGICKWAND_LIBS) $(PERLMAKEMAKER)
49        cd $(PERLMAGICK) && @PERL@ Makefile.PL $(PERL_MAKE_OPTIONS)
50
51install-exec-perl: $(PERLMAKEFILE)
52        ( cd $(PERLMAGICK) && $(MAKE) CC='@CC@' && \
53        $(MAKE) CC='@CC@' install && \
54        $(MAKE) clean && rm -f  Makefile.old )
55
56all-perl: perl-sources
57
58uninstall-exec-perl: $(PERLMAKEFILE)
59        echo "Uninstall not supported for PerlMagick"
60
61check-perl: $(PERLMAKEFILE)
62        cd $(PERLMAGICK) && $(abs_top_builddir)/magick.sh $(MAKE) CC='@CC@' test
63
64perl-build: $(PERLMAKEFILE)
65        ( cd $(PERLMAGICK) && $(MAKE) CC='@CC@' )
66
67else
68if WITH_PERL_STATIC
69
70PERLSTATICNAME=PerlMagick
71
72PERLMAGICK_CHECKSCRIPTS = perl-build
73
74$(PERLMAKEFILE): perl-sources $(MAGICKCORE_LIBS) $(MAGICKWAND_LIBS) $(PERLMAKEMAKER)
75        cd $(PERLMAGICK) && @PERL@ Makefile.PL MAP_TARGET=$(PERLSTATICNAME) $(PERL_MAKE_OPTIONS) && $(MAKE) Makefile ; $(MAKE) Makefile
76
77$(PERLMAGICK)/$(PERLSTATICNAME): $(MAGICKCORE_LIBS) $(MAGICKWAND_LIBS) $(PERLMAKEFILE)
78        ( rm -f $(PERLMAGICK)/$(PERLSTATICNAME) ; cd $(PERLMAGICK) && $(MAKE) CC='@CC@' $(PERLSTATICNAME) ; $(MAKE) CC='@CC@' $(PERLSTATICNAME) )
79
80all-perl: $(PERLMAGICK)/$(PERLSTATICNAME)
81
82install-exec-perl: $(PERLMAGICK)/$(PERLSTATICNAME)
83        rm -f "$(DESTDIR)$(BIN_DIR)/$(PERLSTATICNAME)"
84        if test "x$(DESTDIR)" = "x" -o "$(PERL_SUPPORTS_DESTDIR)" = 'yes' ; then \
85          ( cd $(PERLMAGICK) && \
86            $(MAKE) -f Makefile.aperl CC='@CC@' inst_perl MAP_TARGET=$(PERLSTATICNAME) \
87            INSTALLBIN="$(BIN_DIR)" \
88          ) ; \
89        else \
90          ( cd $(PERLMAGICK) && \
91            $(MAKE) -f Makefile.aperl CC='@CC@' inst_perl MAP_TARGET=$(PERLSTATICNAME) \
92            INSTALLBIN="$(DESTDIR)$(BIN_DIR)" PREFIX="$(DESTDIR)$(prefix)" \
93          ) ; \
94        fi
95
96uninstall-exec-perl:
97        rm -f '$(DESTDIR)$(BIN_DIR)/$(PERLSTATICNAME)'
98
99check-perl: $(PERLMAGICK)/$(PERLSTATICNAME)
100        cd $(PERLMAGICK) && $(abs_top_builddir)/magick.sh $(MAKE) -f Makefile.aperl CC='@CC@' test
101
102perl-build: $(PERLMAGICK)/$(PERLSTATICNAME)
103
104endif # WITH_PERL_STATIC
105endif # WTIH_PERL_DYNAMIC
106
107
108clean-perl:
109        (cd $(PERLMAGICK) && \
110        ( if test -f Makefile.old ; then $(MAKE) -f Makefile.old CC='@CC@' clean ; fi ) ; \
111        ( if test -f Makefile ; then $(MAKE) CC='@CC@' clean ; fi ) ; \
112        ( if test -f Makefile ; then $(MAKE) CC='@CC@' clean ; fi ) ; \
113        rm -f Makefile.old PerlMagick ; \
114        rm -f t/output* t/jng/*_tmp.jng t/*/output* )
115        rm -f perl-sources
116
117distclean-perl: clean-perl
118
119else
120# Satisfy makefile requirements if not building PERL
121all-perl:
122install-exec-perl:
123uninstall-exec-perl:
124check-perl:
125clean-perl:
126distclean-perl:
127endif # WITH_PERL
Note: See TracBrowser for help on using the browser.