xref: /onnv-gate/usr/src/cmd/perl/5.8.4/Makefile (revision 1717:ef845d4a1074)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21
22#
23# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28
29#
30# Note:  Hidden command and dependency checking plays havoc with perl module
31# makefiles, so we make sure to always unset the KEEP_STATE and
32# SUNPRO_DEPENDENCIES environment variables before calling any subsidiary makes.
33#
34
35.KEEP_STATE:
36
37include ../../Makefile.cmd
38
39# To turn KEEP_STATE off the following two environment variables must be unset.
40KEEP_STATE_OFF = unset KEEP_STATE SUNPRO_DEPENDENCIES
41
42# Configuration files needed from the architecture-specific subdirectories.
43MACH_CONFIG_FILES = config.sh
44
45# Where the configuration files need to be copied to.
46DISTRIB_CONFIG_FILES = $(MACH_CONFIG_FILES:%=distrib/%)
47
48# Generated Makefiles, derived from config.sh.
49GEN_MAKEFILES = Makefile.perlcfg distrib/ext/Makefile
50
51all	:= TARGET = all
52install	:= TARGET = install
53clobber := TARGET = clobber
54clean	:= TARGET = clean
55test	:= TARGET = test
56
57# Compiler replacement rules
58SED_CC		= -e "s!'cc'!'$(CC) -_gcc=-w'!"
59SED_CC_E	= -e "s!'cc -E'!'$(REAL_CC) -E'!"
60
61# distrib holds the perl source, contrib holds the SMI modules.
62all clean test: configure FRC
63	@ cd distrib; pwd; $(KEEP_STATE_OFF); $(MAKE) $(TARGET)
64	@ cd contrib; pwd; $(KEEP_STATE_OFF); $(MAKE) $(TARGET)
65
66# distrib/Makefile copies both distrib and contrib to the proto area.
67install: all
68	@ cd distrib; pwd; $(KEEP_STATE_OFF); $(MAKE) install_files
69
70configure: $(DISTRIB_CONFIG_FILES) $(GEN_MAKEFILES) get_no_keywords
71
72# Modify config.sh to refer to the compiler used for the build.
73distrib/config.sh: $(MACH)/config.sh
74	$(SED)	$(SED_CC) $(SED_CC_E) $(MACH)/config.sh > $@
75
76Makefile.perlcfg: extract_config $(MACH)/config.sh
77	./extract_config $(MACH)/config.sh > Makefile.perlcfg
78
79distrib/ext/Makefile: extract_makeext $(MACH)/config.sh
80	./extract_makeext $(MACH)/config.sh > distrib/ext/Makefile
81
82.PARALLEL: extract_config extract_makeext distrib/config.sh Makefile.perlcfg \
83    distrib/ext/Makefile get_no_keywords
84
85#
86# Subsidiary makefiles include the generated Makefiles,
87# so make sure they exist first and then delete them afterwards.
88#
89clobber: $(GEN_MAKEFILES) FRC
90	@ cd distrib; pwd; $(KEEP_STATE_OFF); $(MAKE) $(TARGET)
91	@ cd contrib; pwd; $(KEEP_STATE_OFF); $(MAKE) $(TARGET)
92	- $(RM) $(DISTRIB_CONFIG_FILES) $(GEN_MAKEFILES) \
93	extract_config extract_makeext get_no_keywords
94
95FRC:
96