Makefile revision 80ab886d233f514d54c2a6bdeb9fdfd951bd6881
5fbced719b71e659322b4ce3e4a39c9b039674c7Bob Halley# CDDL HEADER START
5fbced719b71e659322b4ce3e4a39c9b039674c7Bob Halley# The contents of this file are subject to the terms of the
5fbced719b71e659322b4ce3e4a39c9b039674c7Bob Halley# Common Development and Distribution License (the "License").
5fbced719b71e659322b4ce3e4a39c9b039674c7Bob Halley# You may not use this file except in compliance with the License.
5fbced719b71e659322b4ce3e4a39c9b039674c7Bob Halley# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
5fbced719b71e659322b4ce3e4a39c9b039674c7Bob Halley# See the License for the specific language governing permissions
5fbced719b71e659322b4ce3e4a39c9b039674c7Bob Halley# and limitations under the License.
5fbced719b71e659322b4ce3e4a39c9b039674c7Bob Halley# When distributing Covered Code, include this CDDL HEADER in each
5fbced719b71e659322b4ce3e4a39c9b039674c7Bob Halley# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
5fbced719b71e659322b4ce3e4a39c9b039674c7Bob Halley# If applicable, add the following below this CDDL HEADER, with the
5fbced719b71e659322b4ce3e4a39c9b039674c7Bob Halley# fields enclosed by brackets "[]" replaced with your own identifying
b897c52f865b2fc4e220e2110b874e59c716456bBob Halley# information: Portions Copyright [yyyy] [name of copyright owner]
e85ffb301b294d70ddc1d90234788403666bb944David Lawrence# CDDL HEADER END
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson# Use is subject to license terms.
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson# ident "%Z%%M% %I% %E% SMI"
828a5beda384130d5e2913dadd862924c53405bfAndreas Gustafsson# The perl5 installation for Solaris differs from that generated by the
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson# Perl Configure procedure. The configuration appropriate for the current
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson# build is automatically generated from pre-existing configuration files
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson# for the build platform.
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson# Some of the Makefile.master and Makefile.cmd flags are overridden by
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson# ../Makefile.perlcfg which is in turn generated from config.sh by
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson# ../extract_config.sh - check there first before overriding anything in this
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson# DynaLoader is a special extension as it has to be built statically.
b897c52f865b2fc4e220e2110b874e59c716456bBob Halley# Because autosplit generates a lot of files, we create a dummy timestamp file
b897c52f865b2fc4e220e2110b874e59c716456bBob Halley# so that dependency checking can be performed.
81e92fbafaa07bd8ccbbeb4b5926d548b5c4560eDavid LawrenceCLEANFILES = miniperlmain.o perlmain.o opmini.o perlmain.c writemain cflags \
81e92fbafaa07bd8ccbbeb4b5926d548b5c4560eDavid LawrenceCLOBBERFILES = $(MINIPERL) $(PROG) $(PERL_CONFIGDEP) libperl.so lib/re.pm \
b897c52f865b2fc4e220e2110b874e59c716456bBob Halley# Add in the perl-specific flags (including largefile flags).
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson# Add in the libraries perl needs to be linked against.
178f6ad061e54bc5babfca3577f72058fa0797c1Bob Halley# Compiler replacement rules
178f6ad061e54bc5babfca3577f72058fa0797c1Bob Halleytest := TARGET = test
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence# Expand template files that depend on config.sh.
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence# Build the libperl.so and libperl.so.1 shared objects using Makefile.lib,
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence# which uses the correct library build environment.
b897c52f865b2fc4e220e2110b874e59c716456bBob Halley @ $(ECHO) "Building libperl.so"; $(MAKE) -f Makefile.lib $(TARGET)
b897c52f865b2fc4e220e2110b874e59c716456bBob Halley# Build miniperl, the bootstrap perl executable, and check it executes OK.
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence @ $(MINIPERL) -w -Ilib -MExporter -e 'exit(0);' || \
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence { $(ECHO) "error building miniperl"; $(RM) $(MINIPERL); exit 2; }
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrenceminiperlmain.o: miniperlmain.c $(PERL_CONFIG_H)
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence# opmini.o is a version of op.o compiled with -DPERL_EXTERNAL_GLOB. Perl has
178f6ad061e54bc5babfca3577f72058fa0797c1Bob Halley# an internal implementation of glob, but it isn't available at this point.
b897c52f865b2fc4e220e2110b874e59c716456bBob Halley# Prepare for building perl modules by:
b897c52f865b2fc4e220e2110b874e59c716456bBob Halley# * Building miniperl.
b897c52f865b2fc4e220e2110b874e59c716456bBob Halley# * Copying re.pm from ext/re into lib.
b897c52f865b2fc4e220e2110b874e59c716456bBob Halley# * Creating Config.pm from config.sh.
b897c52f865b2fc4e220e2110b874e59c716456bBob Halley# * Autosplitting any ./lib modules that require it.
178f6ad061e54bc5babfca3577f72058fa0797c1Bob Halley# * Creating a fake cflags file. ExtUtils::MM_Unix (used to build extensions)
178f6ad061e54bc5babfca3577f72058fa0797c1Bob Halley# checks to see if there is a non-zero sized file called 'cflags' in this
178f6ad061e54bc5babfca3577f72058fa0797c1Bob Halley# directory, so we fool it by creating one.
178f6ad061e54bc5babfca3577f72058fa0797c1Bob Halleypreplibrary: $(MINIPERL) $(PERL_CONFIG_PM) lib/ExtUtils/Miniperl.pm cflags \
178f6ad061e54bc5babfca3577f72058fa0797c1Bob Halley$(PERL_CONFIG_PM): configpm $(PERL_CONFIG_H) myconfig.SH $(MINIPERL) lib/re.pm
178f6ad061e54bc5babfca3577f72058fa0797c1Bob Halleylib/ExtUtils/Miniperl.pm: $(PERL_CONFIGDEP) $(MINIPERL) \
178f6ad061e54bc5babfca3577f72058fa0797c1Bob Halley# Note: cflags needs to be non-zero sized, so $(TOUCH) won't do.
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence.PARALLEL: $(PERL_CONFIGDEP) lib/re.pm lib/ExtUtils/Miniperl.pm \
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence# Because autosplit generates a lot of files, we create a dummy timestamp file
19ba7857f6bf38619eda1f1dae0eb05a6cdd2b77Bob Halley $(MINIPERL) -Ilib -MAutoSplit -e 'autosplit_lib_modules(@ARGV)' \
19ba7857f6bf38619eda1f1dae0eb05a6cdd2b77Bob Halley `find lib -name SCCS -prune -o -name '*.pm' -print`
19ba7857f6bf38619eda1f1dae0eb05a6cdd2b77Bob Halley# Make DynaLoader. DynaLoader is statically linked into the perl executable
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence# because it is used to load in all the other dynamically loaded modules.
19ba7857f6bf38619eda1f1dae0eb05a6cdd2b77Bob Halley# Note: VERSION is used by ON as a environment variable and by perl module
19ba7857f6bf38619eda1f1dae0eb05a6cdd2b77Bob Halley# makefiles as a make macro, so we need to unset it before building any modules.
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrenceext/DynaLoader/Makefile: ext/DynaLoader/Makefile.PL $(PERL_CONFIGDEP) cflags
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence$(DYNALOADER): ext/DynaLoader/Makefile $(PERL_CONFIGDEP) cflags FRC
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence# Create the perl executable.
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrenceperl: libperl.so $(DYNALOADER) $(PERL_STATIC_TGT) perlmain.o
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence $(LINK.c) -R$(PERL_REAL_CORE_DIR) -o $@ perlmain.o $(DYNALOADER) \
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence# Build all the extensions. The rules for this are in the generated
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence# Build utilities and pod pages.
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence# Install targets. The bin, lib and pod symlinks are created here. The man
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence# link is created by the SUNWpl5m package. Also we overwrite the Config.pm we
b897c52f865b2fc4e220e2110b874e59c716456bBob Halley# used to build our modules with one sanitized of the /ws/on*-tools dependency.
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence @ LD_LIBRARY_PATH=$(PERL_DISTRIB) $(PERL_DISTRIB)/perl ./installperl
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson umask 022; $(MKDIR) -p $(PERL_VENDOR_DIR)
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence $(SED) $(SED_UN_CC) $(SED_UN_CC_E) $(PERL_CONFIG_PM) \
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence @ $(CHOWN) -R $(OWNER):$(GROUP) $(PERL_ROOT_STEM)
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence# Perl test suite target.
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence LD_LIBRARY_PATH=$(PERL_DISTRIB) export LD_LIBRARY_PATH; \
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson# Cleaning targets.
541ed6feaf687e97990ad19748faeec744158559David Lawrenceclean: clean_pod clean_utilities clean_x2p clean_extensions clean_lib
541ed6feaf687e97990ad19748faeec744158559David Lawrence# Clobber targets
541ed6feaf687e97990ad19748faeec744158559David Lawrence [ ! -z "$$mf" ] && $(MAKE) -f $$mf realclean; \
FRC: