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