1N/A#
1N/A# CDDL HEADER START
1N/A#
1N/A# The contents of this file are subject to the terms of the
1N/A# Common Development and Distribution License (the "License").
1N/A# You may not use this file except in compliance with the License.
1N/A#
1N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1N/A# or http://www.opensolaris.org/os/licensing.
1N/A# See the License for the specific language governing permissions
1N/A# and limitations under the License.
1N/A#
1N/A# When distributing Covered Code, include this CDDL HEADER in each
1N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1N/A# If applicable, add the following below this CDDL HEADER, with the
1N/A# fields enclosed by brackets "[]" replaced with your own identifying
1N/A# information: Portions Copyright [yyyy] [name of copyright owner]
1N/A#
1N/A# CDDL HEADER END
1N/A#
1N/A
1N/A#
1N/A# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
1N/A#
1N/A
1N/A#
1N/A# The perl5 installation for Solaris differs from that generated by the
1N/A# Perl Configure procedure. The configuration appropriate for the current
1N/A# build is automatically generated from pre-existing configuration files
1N/A# for the build platform.
1N/A#
1N/A
1N/APROG = perl
1N/A
1N/A#
1N/A# Some of the Makefile.master and Makefile.cmd flags are overridden by
1N/A# ../Makefile.perlcfg which is in turn generated from config.sh by
1N/A# ../extract_config.sh - check there first before overriding anything in this
1N/A# Makefile.
1N/A#
1N/Ainclude ../../../Makefile.cmd
1N/Ainclude ../Makefile.perlcfg
1N/A
1N/A# DynaLoader is a special extension as it has to be built statically.
1N/ADYNALOADER=lib/auto/DynaLoader/DynaLoader.a
1N/A
1N/A# Uuencoded files that need to have SCCS keyword expansion prevented, see below.
1N/AUUENCODED_FILES = \
1N/A ext/Storable/t/downgrade.t
1N/A
1N/A# Because autosplit generates a lot of files, we create a dummy timestamp file
1N/A# so that dependency checking can be performed.
1N/AAUTOSPLIT = lib/auto/.tstamp
1N/A
1N/ACLEANFILES = miniperlmain.o perlmain.o opmini.o perlmain.c writemain cflags \
1N/A ext.libs
1N/A
1N/ACLOBBERFILES = $(MINIPERL) $(PROG) $(PERL_CONFIGDEP) libperl.so lib/re.pm \
1N/A lib/lib.pm lib/ExtUtils/Miniperl.pm t/perl
1N/Aclobber := CLOBBERFILES += CLEANFILES
1N/A
1N/A# Add in the perl-specific flags (including largefile flags).
1N/ACPPFLAGS += $(PERL_COREFLAGS) $(PERL_LFFLAGS)
1N/A
1N/A# Add in the libraries perl needs to be linked against.
1N/ALDLIBS += $(PERL_LDLIBS)
1N/A
1N/A# Compiler replacement rules
1N/ASED_UN_CC = -e "s!'$(CC) -_gcc=-w!'cc!"
1N/ASED_UN_CC_E = -e "s!'$(REAL_CC)!'cc!"
1N/A
1N/Aall := TARGET = all
1N/Ainstall := TARGET = install
1N/Aclobber := TARGET = clobber
1N/Aclean := TARGET = clean
1N/Atest := TARGET = test
1N/A
1N/Aall: get_no_keywords perl extensions utilities
1N/A
1N/A#
1N/A# Some of the files in the perl distribution are uuencoded, or contain uuencoded
1N/A# data. Some of the sequences of uuencoded data look like SCCS keywords, i.e.
1N/A# "%<letter>%", so it is necessary to prevent the keywords from being expanded.
1N/A# The SCCS 'y' flag can be added to the SCCS files to prevent keyword expansion
1N/A# when the file is retrieved. However due to bugs in SCCS and wx we can't
1N/A# always be sure that these flags are propagated correctly.
1N/A#
1N/A
1N/Aget_no_keywords: FRC
1N/A @ ../get_no_keywords $(UUENCODED_FILES)
1N/A
1N/A#
1N/A# Expand template files that depend on config.sh.
1N/A#
1N/A
1N/A$(PERL_CONFIG_H): config_h.SH config.sh
1N/A $(CHMOD) 0555 config_h.SH
1N/A ./config_h.SH
1N/A
1N/Aperlmain.c: writemain $(PERL_CONFIG_H)
1N/A ./writemain $(DYNALOADER) > perlmain.c
1N/A
1N/Awritemain: writemain.SH $(PERL_CONFIG_H)
1N/A $(CHMOD) 0555 writemain.SH
1N/A ./writemain.SH
1N/A
1N/A#
1N/A# Build the libperl.so and libperl.so.1 shared objects using Makefile.lib,
1N/A# which uses the correct library build environment.
1N/A#
1N/A
1N/Alibperl.so: $(PERL_CONFIG_H) FRC
1N/A @ $(ECHO) "Building libperl.so"; $(MAKE) -f Makefile.lib $(TARGET)
1N/A
1N/A#
1N/A# Build miniperl, the bootstrap perl executable, and check it executes OK.
1N/A#
1N/A$(MINIPERL): miniperlmain.o opmini.o libperl.so
1N/A $(LINK.c) $(ZIGNORE) -o $@ miniperlmain.o opmini.o \
1N/A -R \$$ORIGIN -L. -lperl $(LDLIBS)
1N/A @ $(RUN_MINIPERL) -w -Ilib -MExporter -e 'exit(0);' || \
1N/A { $(ECHO) "error building miniperl"; $(RM) $(MINIPERL); exit 2; }
1N/A
1N/Aminiperlmain.o: miniperlmain.c $(PERL_CONFIG_H)
1N/A
1N/A#
1N/A# opmini.o is a version of op.o compiled with -DPERL_EXTERNAL_GLOB. Perl has
1N/A# an internal implementation of glob, but it isn't available at this point.
1N/A#
1N/Aopmini.o: op.c $(PERL_CONFIG_H)
1N/A $(COMPILE.c) -o $@ op.c -DPERL_EXTERNAL_GLOB
1N/A $(POST_PROCESS_O)
1N/A
1N/A.PARALLEL: miniperlmain.o opmini.o libperl.so
1N/A
1N/A#
1N/A# Prepare for building perl modules by:
1N/A# * Building miniperl.
1N/A# * Copying re.pm from ext/re into lib.
1N/A# * Creating lib.pm from lib_pm.PL.
1N/A# * Creating Config.pm from config.sh.
1N/A# * Autosplitting any ./lib modules that require it.
1N/A# * Creating a fake cflags file. ExtUtils::MM_Unix (used to build extensions)
1N/A# checks to see if there is a non-zero sized file called 'cflags' in this
1N/A# directory, so we fool it by creating one.
1N/A#
1N/A
1N/Apreplibrary: $(MINIPERL) $(PERL_CONFIG_PM) lib/lib.pm \
1N/A lib/ExtUtils/Miniperl.pm cflags $(AUTOSPLIT)
1N/A
1N/A$(PERL_CONFIG_PM): configpm $(PERL_CONFIG_H) myconfig.SH $(MINIPERL) lib/re.pm
1N/A $(RUN_MINIPERL) configpm $@
1N/A
1N/Alib/re.pm : ext/re/re.pm
1N/A $(CP) -f ext/re/re.pm $@
1N/A
1N/Alib/lib.pm: lib/lib_pm.PL $(PERL_CONFIGDEP) $(MINIPERL)
1N/A $(RUN_MINIPERL) lib/lib_pm.PL
1N/A
1N/Alib/ExtUtils/Miniperl.pm: $(PERL_CONFIGDEP) $(MINIPERL) \
1N/A miniperlmain.c minimod.pl
1N/A $(RUN_MINIPERL) minimod.pl > minimod.tmp
1N/A $(MV) minimod.tmp $@
1N/A
1N/A# Note: cflags needs to be non-zero sized, so $(TOUCH) won't do.
1N/Acflags:
1N/A $(ECHO) > cflags
1N/A
1N/A.PARALLEL: $(PERL_CONFIGDEP) lib/re.pm lib/lib.pm lib/ExtUtils/Miniperl.pm \
1N/A cflags $(AUTOSPLIT)
1N/A
1N/A# Because autosplit generates a lot of files, we create a dummy timestamp file
1N/A$(AUTOSPLIT): $(PERL_CONFIGDEP)
1N/A @ $(MKDIR) -p lib/auto
1N/A $(RUN_MINIPERL) -Ilib -MAutoSplit -e 'autosplit_lib_modules(@ARGV)' \
1N/A `find lib -name SCCS -prune -o -name '*.pm' -print`
1N/A @ $(TOUCH) $(AUTOSPLIT)
1N/A
1N/A#
1N/A# Make DynaLoader. DynaLoader is statically linked into the perl executable
1N/A# because it is used to load in all the other dynamically loaded modules.
1N/A# Note: VERSION is used by ON as a environment variable and by perl module
1N/A# makefiles as a make macro, so we need to unset it before building any modules.
1N/A#
1N/A
1N/Aext/DynaLoader/Makefile: ext/DynaLoader/Makefile.PL $(PERL_CONFIGDEP) cflags
1N/A @ cd ext/DynaLoader; pwd; $(PERL_MM_ENV); \
1N/A $(RUN_MINIPERL) Makefile.PL INSTALLDIRS=perl \
1N/A LIBPERL_A=libperl.so $(PERL_MM_ARGS)
1N/A
1N/A$(DYNALOADER): ext/DynaLoader/Makefile $(PERL_CONFIGDEP) cflags FRC
1N/A @ cd ext/DynaLoader; pwd; $(PERL_MM_ENV); \
1N/A $(MAKE) LINKTYPE=static CCCDLFLAGS=
1N/A
1N/A#
1N/A# Create the perl executable.
1N/A#
1N/A
1N/Aperl: libperl.so $(DYNALOADER) $(PERL_STATIC_TGT) perlmain.o
1N/A $(LINK.c) $(ZIGNORE) -R$(PERL_REAL_CORE_DIR) \
1N/A -o $@ perlmain.o $(DYNALOADER) -L. -lperl $(LDLIBS)
1N/A $(POST_PROCESS)
1N/A
1N/Aperlmain.o: perlmain.c $(PERL_CONFIG_H)
1N/A $(COMPILE.c) -o $@ $<
1N/A $(POST_PROCESS_O)
1N/A
1N/A.PARALLEL: perlmain.o
1N/A
1N/A#
1N/A# Build all the extensions. The rules for this are in the generated
1N/A# ext/Makefile file.
1N/A#
1N/A
1N/Aextensions: preplibrary FRC
1N/A @ cd ext; pwd; $(MAKE) $(TARGET)
1N/A
1N/A#
1N/A# Build utilities and pod pages.
1N/A#
1N/A
1N/Autilities: perl FRC
1N/A @ cd x2p; pwd; $(MAKE) $(TARGET)
1N/A @ cd pod; pwd; $(MAKE) $(TARGET)
1N/A @ cd utils; pwd; $(MAKE) $(TARGET)
1N/A
1N/A#
1N/A# Install targets. The bin, lib and pod symlinks are created here. The man
1N/A# link is created by the SUNWpl5m package. In order to prevent a symlink cycle
1N/A# we need to remove libperl.so before we start, so it will always be reinstalled
1N/A# on each 'make install'. We also overwrite the Config.pm we used to build our
1N/A# modules with one sanitized of the /ws/on*-tools dependency. As a result,
1N/A# Config.pm will also be overwritten on each 'make install'. Note also that
1N/A# perl, pstruct and psed are all hard links, so they too are reinstalled on each
1N/A# 'make install'.
1N/A#
1N/Ainstall_files:
1N/A $(RM) $(PERL_CORE_DIR)/libperl.so
1N/A @ $(PERL_LD_ENV); $(PERL_LIB_ENV); \
1N/A $(PERL_DISTRIB)/perl ./installperl -destdir=$(ROOT)
1N/A @ $(MAKE) -f Makefile.lib install_lib
1N/A
1N/A umask 022; $(MKDIR) -p $(PERL_VENDOR_DIR)
1N/A
1N/A $(RM) $(PERL_ARCHLIB_DIR)/Config.pm
1N/A $(SED) $(SED_UN_CC) $(SED_UN_CC_E) $(PERL_CONFIG_PM) \
1N/A > $(PERL_ARCHLIB_DIR)/Config.pm
1N/A $(CHMOD) 444 $(PERL_ARCHLIB_DIR)/Config.pm
1N/A
1N/Ainstall: all .WAIT install_files
1N/A
1N/A#
1N/A# Perl test suite target.
1N/A# Note: the perl test suite breaks under parallel make. Bah.
1N/A#
1N/A
1N/A# @ (PERL_MM_ENV); $(PERL_LD_ENV);
1N/Atest: all
1N/A $(PERL_LD_ENV); \
1N/A PATH=$$PATH; export PATH; \
1N/A MAKE=/usr/bin/make; export MAKE; \
1N/A PERL_CORE=1; export PERL_CORE; \
1N/A cd t; pwd; \
1N/A $(CP) ../perl .; \
1N/A $(CHMOD) 755 TEST; \
1N/A if tty -s; then \
1N/A ./TEST < /dev/tty; \
1N/A else \
1N/A ./TEST < /dev/null; \
1N/A fi
1N/A
1N/A#
1N/A# Cleaning targets.
1N/A#
1N/A
1N/Aclean_pod:
1N/A @ cd pod; pwd; $(MAKE) clean
1N/A
1N/Aclean_utilities:
1N/A @ cd utils; pwd; $(MAKE) clean
1N/A
1N/Aclean_x2p:
1N/A @ cd x2p; pwd; $(MAKE) clean
1N/A
1N/Aclean_extensions:
1N/A -@ unset VERSION; \
1N/A cd ext; pwd; \
1N/A ( \
1N/A cd DynaLoader; \
1N/A [ -f Makefile.old ] && mf=Makefile.old; \
1N/A [ -f Makefile ] && mf=Makefile; \
1N/A [ ! -z "$$mf" ] && $(MAKE) -f $$mf clean; \
1N/A ); \
1N/A $(MAKE) clean
1N/A
1N/Aclean_lib:
1N/A $(MAKE) -f Makefile.lib clean
1N/A
1N/Aclean: clean_pod clean_utilities clean_x2p clean_extensions clean_lib
1N/A $(RM) $(CLEANFILES)
1N/A
1N/A#
1N/A# Clobber targets
1N/A#
1N/A
1N/Aclobber_extensions:
1N/A -@ unset VERSION; \
1N/A cd ext; pwd; \
1N/A $(RM) -r Sys/Syslog/lib; \
1N/A ( \
1N/A cd DynaLoader; \
1N/A [ -f Makefile.old ] && mf=Makefile.old; \
1N/A [ -f Makefile ] && mf=Makefile; \
1N/A [ ! -z "$$mf" ] && $(MAKE) -f $$mf realclean; \
1N/A ); \
1N/A $(MAKE) clobber
1N/A
1N/Aclobber_lib:
1N/A $(MAKE) -f Makefile.lib $(TARGET)
1N/A $(RM) -r lib/auto lib/Config.pod
1N/A $(RM) `find ./lib -name .exists`
1N/A
1N/Aclobber_pod:
1N/A @ cd pod; pwd; $(MAKE) $(TARGET)
1N/A
1N/Aclobber_utilities:
1N/A @ cd utils; pwd; $(MAKE) $(TARGET)
1N/A
1N/Aclobber_x2p:
1N/A @ cd x2p; pwd; $(MAKE) $(TARGET)
1N/A
1N/Aclobber_contrib_bin:
1N/A @ $(RM) -r contrib_bin
1N/A
1N/Aclobber: clobber_extensions clobber_lib clobber_pod clobber_utilities \
1N/A clobber_x2p clobber_contrib_bin
1N/A
1N/Ainclude ../../../Makefile.targ
1N/A
1N/AFRC: