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