1 # Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
2 # dedicated to making software imaging solutions freely available.
4 # You may not use this file except in compliance with the License. You may
5 # obtain a copy of the License at
7 # https://imagemagick.org/script/license.php
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.
15 # Copyright (C) 2003 - 2008 GraphicsMagick Group
17 # Makefile for building PerlMagick.
19 # If source files missing, see if they can be obtained via VPATH
21 $(PERLMAGICK)/quantum/@MAGICK_ABI_SUFFIX@.xs: $(PERLMAGICK)/quantum/quantum.xs
22 $(AM_V_GEN) $(LN_S) quantum.xs $@
24 $(PERLMAGICK)/quantum/@MAGICK_ABI_SUFFIX@.pm: $(PERLMAGICK)/quantum/quantum.pm
25 $(AM_V_GEN) $(LN_S) quantum.pm $@
27 perl-quantum-sources: $(PERLMAGICK)/quantum/@MAGICK_ABI_SUFFIX@.xs $(PERLMAGICK)/quantum/@MAGICK_ABI_SUFFIX@.pm
29 perl-sources: perl-quantum-sources
30 @if test -n "$(VPATH)" ; then \
31 echo "Linking PerlMagick Sources ..." ; \
32 imagemagick=`(cd $(VPATH) ; pwd)` && \
33 ( cd $(PERLMAGICK) && \
34 sh $$imagemagick/config/lndir.sh $$imagemagick/$(PERLMAGICK) ; ) \
41 PERLMAKEMAKER=$(PERLMAGICK)/Makefile.PL
42 PERLMAKEFILE=$(PERLMAGICK)/Makefile
44 PERLMAGICK_ALL_LOCAL_TARGETS = all-perl
45 PERLMAGICK_INSTALL_EXEC_LOCAL_TARGETS = install-exec-perl
46 PERLMAGICK_INSTALL_DATA_LOCAL_TARGETS =
47 PERLMAGICK_UNINSTALL_LOCAL_TARGETS = uninstall-exec-perl
48 PERLMAGICK_CLEAN_LOCAL_TARGETS = clean-perl
49 PERLMAGICK_DISTCLEAN_LOCAL_TARGETS = clean-perl
50 PERLMAGICK_MAINTAINER_CLEAN_LOCAL_TARGETS = distclean-local
51 PERLMAGICK_TESTS = PerlMagick/check.sh
55 PERLMAGICK_CHECKSCRPTS =
57 $(PERLMAKEFILE): perl-sources $(MAGICKCORE_LIBS) $(MAGICKWAND_LIBS) $(PERLMAKEMAKER)
58 cd $(PERLMAGICK) && @PERL@ Makefile.PL $(PERL_MAKE_OPTIONS)
60 install-exec-perl: $(PERLMAKEFILE)
61 ( cd $(PERLMAGICK) && $(MAKE) CC='@CC@' && \
62 $(MAKE) CC='@CC@' install )
64 all-perl: perl-sources
66 uninstall-exec-perl: $(PERLMAKEFILE)
67 echo "Uninstall not supported for PerlMagick"
69 check-perl: $(PERLMAKEFILE)
70 cd $(PERLMAGICK) && $(abs_top_builddir)/magick.sh $(MAKE) CC='@CC@' test
72 perl-build: $(PERLMAKEFILE)
73 ( cd $(PERLMAGICK) && $(MAKE) CC='@CC@' )
78 PERLSTATICNAME=PerlMagick
80 PERLMAGICK_CHECKSCRPTS = perl-build
82 $(PERLMAKEFILE): perl-sources $(MAGICKCORE_LIBS) $(MAGICKWAND_LIBS) $(PERLMAKEMAKER)
83 cd $(PERLMAGICK) && @PERL@ Makefile.PL MAP_TARGET=$(PERLSTATICNAME) $(PERL_MAKE_OPTIONS) && $(MAKE) Makefile ; $(MAKE) Makefile
85 $(PERLMAGICK)/$(PERLSTATICNAME): $(MAGICKCORE_LIBS) $(MAGICKWAND_LIBS) $(PERLMAKEFILE)
86 ( rm -f $(PERLMAGICK)/$(PERLSTATICNAME) ; cd $(PERLMAGICK) && $(MAKE) CC='@CC@' $(PERLSTATICNAME) ; $(MAKE) CC='@CC@' $(PERLSTATICNAME) )
88 all-perl: $(PERLMAGICK)/$(PERLSTATICNAME)
90 install-exec-perl: $(PERLMAGICK)/$(PERLSTATICNAME)
91 rm -f "$(DESTDIR)$(BIN_DIR)/$(PERLSTATICNAME)"
92 if test "x$(DESTDIR)" = "x" -o "$(PERL_SUPPORTS_DESTDIR)" = 'yes' ; then \
93 ( cd $(PERLMAGICK) && \
94 $(MAKE) -f Makefile.aperl CC='@CC@' inst_perl MAP_TARGET=$(PERLSTATICNAME) \
95 INSTALLBIN="$(BIN_DIR)" \
98 ( cd $(PERLMAGICK) && \
99 $(MAKE) -f Makefile.aperl CC='@CC@' inst_perl MAP_TARGET=$(PERLSTATICNAME) \
100 INSTALLBIN="$(DESTDIR)$(BIN_DIR)" PREFIX="$(DESTDIR)$(prefix)" \
105 rm -f '$(DESTDIR)$(BIN_DIR)/$(PERLSTATICNAME)'
107 check-perl: $(PERLMAGICK)/$(PERLSTATICNAME)
108 cd $(PERLMAGICK) && $(abs_top_builddir)/magick.sh $(MAKE) -f Makefile.aperl CC='@CC@' test
110 perl-build: $(PERLMAGICK)/$(PERLSTATICNAME)
112 endif # WITH_PERL_STATIC
113 endif # WTIH_PERL_DYNAMIC
117 (cd $(PERLMAGICK) && \
118 ( if test -f Makefile.old ; then $(MAKE) -f Makefile.old CC='@CC@' clean ; fi ) ; \
119 ( if test -f Makefile ; then $(MAKE) CC='@CC@' clean ; fi ) ; \
120 ( if test -f Makefile ; then $(MAKE) CC='@CC@' clean ; fi ) ; \
121 rm -f Makefile.old PerlMagick ; \
122 rm -f t/output* t/jng/*_tmp.jng t/*/output* ; \
123 rm -f quantum/@MAGICK_ABI_SUFFIX@.xs;\
124 rm -f quantum/@MAGICK_ABI_SUFFIX@.pm;\
128 distclean-perl: clean-perl
131 # Satisfy makefile requirements if not building PERL