Makefile revision 02e56f3f1bfc8d9977bafb8cb5202f576dcded27
0N/A#
2362N/A# CDDL HEADER START
0N/A#
0N/A# The contents of this file are subject to the terms of the
0N/A# Common Development and Distribution License (the "License").
0N/A# You may not use this file except in compliance with the License.
2362N/A#
0N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2362N/A# or http://www.opensolaris.org/os/licensing.
0N/A# See the License for the specific language governing permissions
0N/A# and limitations under the License.
0N/A#
0N/A# When distributing Covered Code, include this CDDL HEADER in each
0N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
0N/A# If applicable, add the following below this CDDL HEADER, with the
0N/A# fields enclosed by brackets "[]" replaced with your own identifying
0N/A# information: Portions Copyright [yyyy] [name of copyright owner]
0N/A#
0N/A# CDDL HEADER END
0N/A#
2362N/A
2362N/A#
2362N/A# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
0N/A# Use is subject to license terms.
0N/A#
0N/A# ident "%Z%%M% %I% %E% SMI"
0N/A#
0N/A
0N/A#
0N/A# The perl5 installation for Solaris differs from that generated by the
0N/A# Perl Configure procedure. The configuration appropriate for the current
0N/A# build is automatically generated from pre-existing configuration files
0N/A# for the build platform.
0N/A#
0N/A
0N/APROG = perl
0N/A
0N/A#
0N/A# Some of the Makefile.master and Makefile.cmd flags are overridden by
0N/A# ../Makefile.perlcfg which is in turn generated from config.sh by
0N/A# ../extract_config.sh - check there first before overriding anything in this
0N/A# Makefile.
0N/A#
0N/Ainclude ../../../Makefile.cmd
0N/Ainclude ../Makefile.perlcfg
0N/A
0N/A# DynaLoader is a special extension as it has to be built statically.
0N/ADYNALOADER=lib/auto/DynaLoader/DynaLoader.a
0N/A
0N/A# Because autosplit generates a lot of files, we create a dummy timestamp file
0N/A# so that dependency checking can be performed.
0N/AAUTOSPLIT = lib/auto/.tstamp
0N/A
0N/ACLEANFILES = miniperlmain.o perlmain.o opmini.o perlmain.c writemain cflags \
0N/A ext.libs
0N/A
0N/ACLOBBERFILES = $(MINIPERL) $(PROG) $(PERL_CONFIGDEP) libperl.so lib/re.pm \
0N/A lib/ExtUtils/Miniperl.pm t/perl
0N/Aclobber := CLOBBERFILES += CLEANFILES
0N/A
0N/A# Add in the perl-specific flags (including largefile flags).
0N/ACPPFLAGS += $(PERL_COREFLAGS) $(PERL_LFFLAGS)
0N/A
0N/A# Add in the libraries perl needs to be linked against.
0N/ALDLIBS += $(PERL_LDLIBS)
0N/A
0N/A# Compiler replacement rules
0N/ASED_UN_CC = -e "s!'$(CC)!'cc!"
0N/ASED_UN_CC_E = -e "s!'$(REAL_CC)!'cc!"
0N/A
0N/Aall := TARGET = all
0N/Ainstall := TARGET = install
0N/Aclobber := TARGET = clobber
0N/Aclean := TARGET = clean
0N/Atest := TARGET = test
0N/A
0N/Aall: perl extensions utilities
0N/A
0N/A#
0N/A# Expand template files that depend on config.sh.
0N/A#
0N/A
0N/A$(PERL_CONFIG_H): config_h.SH config.sh
0N/A $(CHMOD) 0555 config_h.SH
0N/A ./config_h.SH
0N/A
0N/Aperlmain.c: writemain $(PERL_CONFIG_H)
0N/A ./writemain $(DYNALOADER) > perlmain.c
0N/A
0N/Awritemain: writemain.SH $(PERL_CONFIG_H)
0N/A $(CHMOD) 0555 writemain.SH
0N/A ./writemain.SH
0N/A
0N/A#
0N/A# Build the libperl.so and libperl.so.1 shared objects using Makefile.lib,
0N/A# which uses the correct library build environment.
0N/A#
0N/A
0N/Alibperl.so: $(PERL_CONFIG_H) FRC
0N/A @ $(ECHO) "Building libperl.so"; $(MAKE) -f Makefile.lib $(TARGET)
0N/A
0N/A#
0N/A# Build miniperl, the bootstrap perl executable, and check it executes OK.
0N/A#
0N/A$(MINIPERL): miniperlmain.o opmini.o libperl.so
0N/A $(LINK.c) -o $@ miniperlmain.o opmini.o \
0N/A -R \$$ORIGIN -L. -lperl $(LDLIBS)
0N/A @ $(MINIPERL) -w -Ilib -MExporter -e 'exit(0);' || \
0N/A { $(ECHO) "error building miniperl"; $(RM) $(MINIPERL); exit 2; }
0N/A
0N/Aminiperlmain.o: miniperlmain.c $(PERL_CONFIG_H)
#
# opmini.o is a version of op.o compiled with -DPERL_EXTERNAL_GLOB. Perl has
# an internal implementation of glob, but it isn't available at this point.
#
opmini.o: op.c $(PERL_CONFIG_H)
$(COMPILE.c) -o $@ op.c -DPERL_EXTERNAL_GLOB
$(POST_PROCESS_O)
.PARALLEL: miniperlmain.o opmini.o libperl.so
#
# Prepare for building perl modules by:
# * Building miniperl.
# * Copying re.pm from ext/re into lib.
# * Creating Config.pm from config.sh.
# * Autosplitting any ./lib modules that require it.
# * Creating a fake cflags file. ExtUtils::MM_Unix (used to build extensions)
# checks to see if there is a non-zero sized file called 'cflags' in this
# directory, so we fool it by creating one.
#
preplibrary: $(MINIPERL) $(PERL_CONFIG_PM) lib/ExtUtils/Miniperl.pm cflags \
$(AUTOSPLIT)
$(PERL_CONFIG_PM): configpm $(PERL_CONFIG_H) myconfig.SH $(MINIPERL) lib/re.pm
$(MINIPERL) configpm $@
lib/re.pm : ext/re/re.pm
$(CP) -f ext/re/re.pm $@
lib/ExtUtils/Miniperl.pm: $(PERL_CONFIGDEP) $(MINIPERL) \
miniperlmain.c minimod.pl
$(MINIPERL) minimod.pl > minimod.tmp
$(MV) minimod.tmp $@
# Note: cflags needs to be non-zero sized, so $(TOUCH) won't do.
cflags:
$(ECHO) > cflags
.PARALLEL: $(PERL_CONFIGDEP) lib/re.pm lib/ExtUtils/Miniperl.pm \
cflags $(AUTOSPLIT)
# Because autosplit generates a lot of files, we create a dummy timestamp file
$(AUTOSPLIT): $(PERL_CONFIGDEP)
@ $(MKDIR) -p lib/auto
$(MINIPERL) -Ilib -MAutoSplit -e 'autosplit_lib_modules(@ARGV)' \
`find lib -name SCCS -prune -o -name '*.pm' -print`
@ $(TOUCH) $(AUTOSPLIT)
#
# Make DynaLoader. DynaLoader is statically linked into the perl executable
# because it is used to load in all the other dynamically loaded modules.
# Note: VERSION is used by ON as a environment variable and by perl module
# makefiles as a make macro, so we need to unset it before building any modules.
#
ext/DynaLoader/Makefile: ext/DynaLoader/Makefile.PL $(PERL_CONFIGDEP) cflags
@ cd ext/DynaLoader; pwd; $(PERL_MM_ENV); \
$(MINIPERL) Makefile.PL INSTALLDIRS=perl \
LIBPERL_A=libperl.so $(PERL_MM_ARGS)
$(DYNALOADER): ext/DynaLoader/Makefile $(PERL_CONFIGDEP) cflags FRC
@ cd ext/DynaLoader; pwd; $(PERL_MM_ENV); \
$(MAKE) LINKTYPE=static CCCDLFLAGS=
#
# Create the perl executable.
#
perl: libperl.so $(DYNALOADER) $(PERL_STATIC_TGT) perlmain.o
$(LINK.c) -R$(PERL_REAL_CORE_DIR) -o $@ perlmain.o $(DYNALOADER) \
-L. -lperl $(LDLIBS)
$(POST_PROCESS)
perlmain.o: perlmain.c $(PERL_CONFIG_H)
$(COMPILE.c) -o $@ $<
$(POST_PROCESS_O)
.PARALLEL: perlmain.o
#
# Build all the extensions. The rules for this are in the generated
# ext/Makefile file.
#
extensions: preplibrary FRC
@ cd ext; pwd; $(MAKE) $(TARGET)
#
# Build utilities and pod pages.
#
utilities: perl FRC
@ cd x2p; pwd; $(MAKE) $(TARGET)
@ cd pod; pwd; $(MAKE) $(TARGET)
@ cd utils; pwd; $(MAKE) $(TARGET)
#
# Install targets. The bin, lib and pod symlinks are created here. The man
# link is created by the SUNWpl5m package. Also we overwrite the Config.pm we
# used to build our modules with one sanitized of the /ws/on*-tools dependency.
#
install_files:
$(RM) $(PERL_CORE_DIR)/libperl.so
@ LD_LIBRARY_PATH=$(PERL_DISTRIB) $(PERL_DISTRIB)/perl ./installperl
@ $(MAKE) -f Makefile.lib install_lib
umask 022; $(MKDIR) -p $(PERL_VENDOR_DIR)
$(RM) $(PERL_ARCHLIB_DIR)/Config.pm
$(SED) $(SED_UN_CC) $(SED_UN_CC_E) $(PERL_CONFIG_PM) \
> $(PERL_ARCHLIB_DIR)/Config.pm
$(CHMOD) 444 $(PERL_ARCHLIB_DIR)/Config.pm
@ $(CHOWN) -R $(OWNER):$(GROUP) $(PERL_ROOT_STEM)
install: all .WAIT install_files
#
# Perl test suite target.
#
test: all
@ unset VERSION; \
LD_LIBRARY_PATH=$(PERL_DISTRIB) export LD_LIBRARY_PATH; \
PERL5LIB=../lib; export PERL5LIB; \
cd t; pwd; \
$(CP) ../perl .; \
$(CHMOD) 755 TEST; \
./TEST
#
# Cleaning targets.
#
clean_pod:
@ cd pod; pwd; $(MAKE) clean
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
$(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: