1 # Copyright 1999-2016 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 # 21 $(PERLMAGICK)/quantum/@MAGICK_ABI_SUFFIX@.xs: $(PERLMAGICK)/quantum/quantum.xs 22 $(AM_V_GEN) $(LN_S) quantum.xs $@ 23 24 $(PERLMAGICK)/quantum/@MAGICK_ABI_SUFFIX@.pm: $(PERLMAGICK)/quantum/quantum.pm 25 $(AM_V_GEN) $(LN_S) quantum.pm $@ 26 27 perl-quantum-sources: $(PERLMAGICK)/quantum/@MAGICK_ABI_SUFFIX@.xs $(PERLMAGICK)/quantum/@MAGICK_ABI_SUFFIX@.pm 28 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) ; ) \ 35 fi ; \ 36 touch perl-sources 37 38 if WITH_PERL 39 40 PERLMAGICK=PerlMagick 41 PERLMAKEMAKER=$(PERLMAGICK)/Makefile.PL 42 PERLMAKEFILE=$(PERLMAGICK)/Makefile 43 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 52 53 if WITH_PERL_DYNAMIC 54 55 PERLMAGICK_CHECKSCRPTS = 56 57 $(PERLMAKEFILE): perl-sources $(MAGICKCORE_LIBS) $(MAGICKWAND_LIBS) $(PERLMAKEMAKER) 58 cd $(PERLMAGICK) && @PERL@ Makefile.PL $(PERL_MAKE_OPTIONS) 59 60 install-exec-perl: $(PERLMAKEFILE) 61 ( cd $(PERLMAGICK) && $(MAKE) CC='@CC@' && \ 62 $(MAKE) CC='@CC@' install ) 63 64 all-perl: perl-sources 65 66 uninstall-exec-perl: $(PERLMAKEFILE) 67 echo "Uninstall not supported for PerlMagick" 68 69 check-perl: $(PERLMAKEFILE) 70 cd $(PERLMAGICK) && $(abs_top_builddir)/magick.sh $(MAKE) CC='@CC@' test 71 72 perl-build: $(PERLMAKEFILE) 73 ( cd $(PERLMAGICK) && $(MAKE) CC='@CC@' ) 74 75 else 76 if WITH_PERL_STATIC 77 78 PERLSTATICNAME=PerlMagick 79 80 PERLMAGICK_CHECKSCRPTS = perl-build 81 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 84 85 $(PERLMAGICK)/$(PERLSTATICNAME): $(MAGICKCORE_LIBS) $(MAGICKWAND_LIBS) $(PERLMAKEFILE) 86 ( rm -f $(PERLMAGICK)/$(PERLSTATICNAME) ; cd $(PERLMAGICK) && $(MAKE) CC='@CC@' $(PERLSTATICNAME) ; $(MAKE) CC='@CC@' $(PERLSTATICNAME) ) 87 88 all-perl: $(PERLMAGICK)/$(PERLSTATICNAME) 89 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)" \ 96 ) ; \ 97 else \ 98 ( cd $(PERLMAGICK) && \ 99 $(MAKE) -f Makefile.aperl CC='@CC@' inst_perl MAP_TARGET=$(PERLSTATICNAME) \ 100 INSTALLBIN="$(DESTDIR)$(BIN_DIR)" PREFIX="$(DESTDIR)$(prefix)" \ 101 ) ; \ 102 fi 103 104 uninstall-exec-perl: 105 rm -f '$(DESTDIR)$(BIN_DIR)/$(PERLSTATICNAME)' 106 107 check-perl: $(PERLMAGICK)/$(PERLSTATICNAME) 108 cd $(PERLMAGICK) && $(abs_top_builddir)/magick.sh $(MAKE) -f Makefile.aperl CC='@CC@' test 109 110 perl-build: $(PERLMAGICK)/$(PERLSTATICNAME) 111 112 endif # WITH_PERL_STATIC 113 endif # WTIH_PERL_DYNAMIC 114 115 116 clean-perl: 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;\ 125 rm -f Magick.pm;) 126 rm -f perl-sources 127 128 distclean-perl: clean-perl 129 130 else 131 # Satisfy makefile requirements if not building PERL 132 all-perl: 133 install-exec-perl: 134 uninstall-exec-perl: 135 check-perl: 136 clean-perl: 137 distclean-perl: 138 endif # WITH_PERL 139