]> granicus.if.org Git - imagemagick/blob - PerlMagick/Makefile.am
725fad29a37ec917a2896cbe326246911debd6bb
[imagemagick] / PerlMagick / Makefile.am
1 #  Copyright 1999-2012 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
20 perl-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
29 if WITH_PERL
30
31 PERLMAGICK=PerlMagick
32 PERLMAKEMAKER=$(PERLMAGICK)/Makefile.PL
33 PERLMAKEFILE=$(PERLMAGICK)/Makefile
34
35 PERLMAGICK_ALL_LOCAL_TARGETS = all-perl
36 PERLMAGICK_INSTALL_EXEC_LOCAL_TARGETS = install-exec-perl
37 PERLMAGICK_INSTALL_DATA_LOCAL_TARGETS = 
38 PERLMAGICK_UNINSTALL_LOCAL_TARGETS = uninstall-exec-perl
39 PERLMAGICK_CLEAN_LOCAL_TARGETS = clean-perl
40 PERLMAGICK_DISTCLEAN_LOCAL_TARGETS = clean-perl
41 PERLMAGICK_MAINTAINER_CLEAN_LOCAL_TARGETS = distclean-local
42 PERLMAGICK_TESTS = PerlMagick/check.sh
43
44 if WITH_PERL_DYNAMIC
45
46 PERLMAGICK_CHECKSCRIPTS =
47
48 $(PERLMAKEFILE): perl-sources $(MAGICKCORE_LIBS) $(MAGICKWAND_LIBS) $(PERLMAKEMAKER)
49         cd $(PERLMAGICK) && @PERL@ Makefile.PL $(PERL_MAKE_OPTIONS)
50
51 install-exec-perl: $(PERLMAKEFILE)
52         ( cd $(PERLMAGICK) && $(MAKE) CC='@CC@' && \
53         $(MAKE) CC='@CC@' install )
54
55 all-perl: perl-sources
56
57 uninstall-exec-perl: $(PERLMAKEFILE)
58         echo "Uninstall not supported for PerlMagick"
59
60 check-perl: $(PERLMAKEFILE)
61         cd $(PERLMAGICK) && $(abs_top_builddir)/magick.sh $(MAKE) CC='@CC@' test
62
63 perl-build: $(PERLMAKEFILE)
64         ( cd $(PERLMAGICK) && $(MAKE) CC='@CC@' )
65
66 else
67 if WITH_PERL_STATIC
68
69 PERLSTATICNAME=PerlMagick
70
71 PERLMAGICK_CHECKSCRIPTS = perl-build
72
73 $(PERLMAKEFILE): perl-sources $(MAGICKCORE_LIBS) $(MAGICKWAND_LIBS) $(PERLMAKEMAKER)
74         cd $(PERLMAGICK) && @PERL@ Makefile.PL MAP_TARGET=$(PERLSTATICNAME) $(PERL_MAKE_OPTIONS) && $(MAKE) Makefile ; $(MAKE) Makefile
75
76 $(PERLMAGICK)/$(PERLSTATICNAME): $(MAGICKCORE_LIBS) $(MAGICKWAND_LIBS) $(PERLMAKEFILE)
77         ( rm -f $(PERLMAGICK)/$(PERLSTATICNAME) ; cd $(PERLMAGICK) && $(MAKE) CC='@CC@' $(PERLSTATICNAME) ; $(MAKE) CC='@CC@' $(PERLSTATICNAME) )
78
79 all-perl: $(PERLMAGICK)/$(PERLSTATICNAME)
80
81 install-exec-perl: $(PERLMAGICK)/$(PERLSTATICNAME)
82         rm -f "$(DESTDIR)$(BIN_DIR)/$(PERLSTATICNAME)"
83         if test "x$(DESTDIR)" = "x" -o "$(PERL_SUPPORTS_DESTDIR)" = 'yes' ; then \
84           ( cd $(PERLMAGICK) && \
85             $(MAKE) -f Makefile.aperl CC='@CC@' inst_perl MAP_TARGET=$(PERLSTATICNAME) \
86             INSTALLBIN="$(BIN_DIR)" \
87           ) ; \
88         else \
89           ( cd $(PERLMAGICK) && \
90             $(MAKE) -f Makefile.aperl CC='@CC@' inst_perl MAP_TARGET=$(PERLSTATICNAME) \
91             INSTALLBIN="$(DESTDIR)$(BIN_DIR)" PREFIX="$(DESTDIR)$(prefix)" \
92           ) ; \
93         fi
94
95 uninstall-exec-perl:
96         rm -f '$(DESTDIR)$(BIN_DIR)/$(PERLSTATICNAME)'
97
98 check-perl: $(PERLMAGICK)/$(PERLSTATICNAME)
99         cd $(PERLMAGICK) && $(abs_top_builddir)/magick.sh $(MAKE) -f Makefile.aperl CC='@CC@' test
100
101 perl-build: $(PERLMAGICK)/$(PERLSTATICNAME)
102
103 endif # WITH_PERL_STATIC
104 endif # WTIH_PERL_DYNAMIC
105
106
107 clean-perl:
108         (cd $(PERLMAGICK) && \
109         ( if test -f Makefile.old ; then $(MAKE) -f Makefile.old CC='@CC@' clean ; fi ) ; \
110         ( if test -f Makefile ; then $(MAKE) CC='@CC@' clean ; fi ) ; \
111         ( if test -f Makefile ; then $(MAKE) CC='@CC@' clean ; fi ) ; \
112         rm -f Makefile.old PerlMagick ; \
113         rm -f t/output* t/jng/*_tmp.jng t/*/output* )
114         rm -f perl-sources
115
116 distclean-perl: clean-perl
117
118 else
119 # Satisfy makefile requirements if not building PERL
120 all-perl:
121 install-exec-perl:
122 uninstall-exec-perl:
123 check-perl:
124 clean-perl:
125 distclean-perl:
126 endif # WITH_PERL