xref: /onnv-gate/usr/src/cmd/perl/5.8.4/contrib/Makefile (revision 13124:8f28cf08bb11)
10Sstevel@tonic-gate#
20Sstevel@tonic-gate# CDDL HEADER START
30Sstevel@tonic-gate#
40Sstevel@tonic-gate# The contents of this file are subject to the terms of the
51341Sstevel# Common Development and Distribution License (the "License").
61341Sstevel# You may not use this file except in compliance with the License.
70Sstevel@tonic-gate#
80Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate# See the License for the specific language governing permissions
110Sstevel@tonic-gate# and limitations under the License.
120Sstevel@tonic-gate#
130Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate#
190Sstevel@tonic-gate# CDDL HEADER END
200Sstevel@tonic-gate#
21*13124SAlexander.Kolbasov@Sun.COM
220Sstevel@tonic-gate#
23*13124SAlexander.Kolbasov@Sun.COM# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
240Sstevel@tonic-gate#
250Sstevel@tonic-gate
260Sstevel@tonic-gateinclude ../../../Makefile.cmd
270Sstevel@tonic-gateinclude ../Makefile.perlcfg
280Sstevel@tonic-gate
290Sstevel@tonic-gate#
300Sstevel@tonic-gate# Extra arguments needed to fool MakeMaker into building in the distrib tree.
310Sstevel@tonic-gate# Note we fake up an extra directory for contrib scripts under distrib - the
320Sstevel@tonic-gate# modified installperl knows how to handle the contents.
330Sstevel@tonic-gate#
340Sstevel@tonic-gatePERL_MM_ARGS += INST_ARCHLIB=$(PERL_DISTRIB)/lib INST_LIB=$(PERL_DISTRIB)/lib \
350Sstevel@tonic-gate    INST_SCRIPT=$(PERL_DISTRIB)/contrib_bin \
360Sstevel@tonic-gate    INST_BIN=$(PERL_DISTRIB)/contrib_bin  PERL_SRC=$(PERL_DISTRIB)
370Sstevel@tonic-gate
380Sstevel@tonic-gate# All SMI perl libraries should be prefixed with this.
390Sstevel@tonic-gateSUN_SOLARIS = Sun/Solaris
400Sstevel@tonic-gate
410Sstevel@tonic-gate# Add any XS extensions here.
420Sstevel@tonic-gatePERL_DYNAMIC_EXT = \
430Sstevel@tonic-gate    $(SUN_SOLARIS)/Utils \
44172Sesolom    $(SUN_SOLARIS)/Intrs \
451341Sstevel    $(SUN_SOLARIS)/Kstat \
460Sstevel@tonic-gate    $(SUN_SOLARIS)/Project \
470Sstevel@tonic-gate    $(SUN_SOLARIS)/Task \
480Sstevel@tonic-gate    $(SUN_SOLARIS)/Exacct \
490Sstevel@tonic-gate    $(SUN_SOLARIS)/Privilege \
502685Sakolb    $(SUN_SOLARIS)/Lgrp \
510Sstevel@tonic-gate    $(SUN_SOLARIS)/Ucred
520Sstevel@tonic-gate
530Sstevel@tonic-gate# Add any pure-perl extensions here.
540Sstevel@tonic-gatePERL_NONXS_EXT = \
550Sstevel@tonic-gate    $(SUN_SOLARIS)/BSM \
56*13124SAlexander.Kolbasov@Sun.COM    $(SUN_SOLARIS)/PerlGcc \
57*13124SAlexander.Kolbasov@Sun.COM    $(SUN_SOLARIS)/Pg
58*13124SAlexander.Kolbasov@Sun.COM
590Sstevel@tonic-gate
600Sstevel@tonic-gatePERL_EXT = $(PERL_DYNAMIC_EXT) $(PERL_NONXS_EXT)
610Sstevel@tonic-gatePERL_EXT_MAKEFILES = $(PERL_EXT:%=%/Makefile)
620Sstevel@tonic-gate
631341Sstevelall: copy_contrib $(PERL_EXT_MAKEFILES) $(PERL_EXT)
640Sstevel@tonic-gate
651341Sstevel.PARALLEL: $(PERL_EXT_MAKEFILES) $(PERL_EXT)
660Sstevel@tonic-gate
670Sstevel@tonic-gate#
680Sstevel@tonic-gate# Note: this is a dummy install target; during 'make all' this Makefile
690Sstevel@tonic-gate# populates ../distrib/lib with the modules that it is responsible for building,
700Sstevel@tonic-gate# and the install target of ../distrib/Makefile subsequently copies the modules
710Sstevel@tonic-gate# into the proto area.
720Sstevel@tonic-gate#
730Sstevel@tonic-gateinstall: all
740Sstevel@tonic-gate
750Sstevel@tonic-gate#
760Sstevel@tonic-gate# copy_contrib copies the clearfiles from ../../contrib to here.
770Sstevel@tonic-gate#
780Sstevel@tonic-gatecopy_contrib:   ../../contrib/copy_contrib
790Sstevel@tonic-gate	@ ../../contrib/copy_contrib ../../contrib . $(PERL_EXT)
800Sstevel@tonic-gate
810Sstevel@tonic-gateclean:
820Sstevel@tonic-gate	-@ $(PERL_MM_ENV); \
831341Sstevel	for ext in $(PERL_EXT); do \
840Sstevel@tonic-gate		if [ -d $$ext ]; then \
850Sstevel@tonic-gate			( \
860Sstevel@tonic-gate			cd $$ext; pwd; \
870Sstevel@tonic-gate			[ -f Makefile.old ] && mf=Makefile.old; \
880Sstevel@tonic-gate			[ -f Makefile ] && mf=Makefile; \
890Sstevel@tonic-gate			[ ! -z "$$mf" ] && $(MAKE) -f $$mf clean; \
900Sstevel@tonic-gate			) \
910Sstevel@tonic-gate		fi \
920Sstevel@tonic-gate	done
930Sstevel@tonic-gate
940Sstevel@tonic-gateclobber:
950Sstevel@tonic-gate	-@ $(PERL_MM_ENV); \
961341Sstevel	for ext in $(PERL_EXT); do \
970Sstevel@tonic-gate		if [ -d $$ext ]; then \
980Sstevel@tonic-gate			( \
990Sstevel@tonic-gate			cd $$ext; pwd; \
1000Sstevel@tonic-gate			[ -f Makefile.old ] && mf=Makefile.old; \
1010Sstevel@tonic-gate			[ -f Makefile ] && mf=Makefile; \
1020Sstevel@tonic-gate			[ ! -z "$$mf" ] && $(MAKE) -f $$mf realclean; \
1030Sstevel@tonic-gate			); \
1040Sstevel@tonic-gate			$(RM) -r $$ext; \
1050Sstevel@tonic-gate		fi \
1060Sstevel@tonic-gate	done
1070Sstevel@tonic-gate
1080Sstevel@tonic-gatetest: all
1090Sstevel@tonic-gate	@ $(PERL_MM_ENV); $(PERL_LD_ENV); \
1101341Sstevel	for ext in $(PERL_EXT); do \
1110Sstevel@tonic-gate		( \
1120Sstevel@tonic-gate		cd $$ext; pwd; \
1130Sstevel@tonic-gate		[ -f Makefile.old ] && mf=Makefile.old; \
1140Sstevel@tonic-gate		[ -f Makefile ] && mf=Makefile; \
1150Sstevel@tonic-gate		[ ! -z "$$mf" ] && $(MAKE) -f $$mf test; \
1160Sstevel@tonic-gate		) \
1170Sstevel@tonic-gate	done
1180Sstevel@tonic-gate
1190Sstevel@tonic-gate# Pattern-matching rule for Makefiles.
1200Sstevel@tonic-gate%/Makefile: %/Makefile.PL $(PERL_CONFIGDEP)
1210Sstevel@tonic-gate	@ cd $(@D); pwd; $(RUN_MINIPERL) $(<F) $(PERL_MM_ARGS) > /dev/null
1220Sstevel@tonic-gate
1230Sstevel@tonic-gate# Pattern-matching rule for extensions.
1240Sstevel@tonic-gate$(SUN_SOLARIS)/%: $(SUN_SOLARIS)/%/Makefile FRC
1250Sstevel@tonic-gate	@ cd $@; pwd; $(PERL_MM_ENV); $(MAKE) all
1260Sstevel@tonic-gate
1270Sstevel@tonic-gate#
1280Sstevel@tonic-gate# Additional rule to make sure changes to the ::Exacct sub-module Makefile.PL
1290Sstevel@tonic-gate# files results in the parent Makefile.PL being rerun.
1300Sstevel@tonic-gate#
1310Sstevel@tonic-gate$(SUN_SOLARIS)/Exacct/Makefile: $(SUN_SOLARIS)/Exacct/Makefile.PL \
1320Sstevel@tonic-gate    $(SUN_SOLARIS)/Exacct/Catalog/Makefile.PL \
1330Sstevel@tonic-gate    $(SUN_SOLARIS)/Exacct/File/Makefile.PL \
1340Sstevel@tonic-gate    $(SUN_SOLARIS)/Exacct/Object/Makefile.PL \
1350Sstevel@tonic-gate    $(PERL_CONFIGDEP)
1360Sstevel@tonic-gate	@ cd $(SUN_SOLARIS)/Exacct; pwd; \
1370Sstevel@tonic-gate	$(RUN_MINIPERL) Makefile.PL $(PERL_MM_ARGS) > /dev/null
1380Sstevel@tonic-gate
1390Sstevel@tonic-gateFRC:
140