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 5580Swesolows# Common Development and Distribution License (the "License"). 6580Swesolows# 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# 21580Swesolows 220Sstevel@tonic-gate# 23*1717Swesolows# Copyright 2006 Sun Microsystems, Inc. All rights reserved. 240Sstevel@tonic-gate# Use is subject to license terms. 250Sstevel@tonic-gate# 26580Swesolows# ident "%Z%%M% %I% %E% SMI" 270Sstevel@tonic-gate# 280Sstevel@tonic-gate 290Sstevel@tonic-gate# 300Sstevel@tonic-gate# Note: Hidden command and dependency checking plays havoc with perl module 310Sstevel@tonic-gate# makefiles, so we make sure to always unset the KEEP_STATE and 320Sstevel@tonic-gate# SUNPRO_DEPENDENCIES environment variables before calling any subsidiary makes. 330Sstevel@tonic-gate# 340Sstevel@tonic-gate 350Sstevel@tonic-gate.KEEP_STATE: 360Sstevel@tonic-gate 370Sstevel@tonic-gateinclude ../../Makefile.cmd 380Sstevel@tonic-gate 390Sstevel@tonic-gate# To turn KEEP_STATE off the following two environment variables must be unset. 400Sstevel@tonic-gateKEEP_STATE_OFF = unset KEEP_STATE SUNPRO_DEPENDENCIES 410Sstevel@tonic-gate 420Sstevel@tonic-gate# Configuration files needed from the architecture-specific subdirectories. 430Sstevel@tonic-gateMACH_CONFIG_FILES = config.sh 440Sstevel@tonic-gate 450Sstevel@tonic-gate# Where the configuration files need to be copied to. 460Sstevel@tonic-gateDISTRIB_CONFIG_FILES = $(MACH_CONFIG_FILES:%=distrib/%) 470Sstevel@tonic-gate 480Sstevel@tonic-gate# Generated Makefiles, derived from config.sh. 490Sstevel@tonic-gateGEN_MAKEFILES = Makefile.perlcfg distrib/ext/Makefile 500Sstevel@tonic-gate 510Sstevel@tonic-gateall := TARGET = all 520Sstevel@tonic-gateinstall := TARGET = install 530Sstevel@tonic-gateclobber := TARGET = clobber 540Sstevel@tonic-gateclean := TARGET = clean 550Sstevel@tonic-gatetest := TARGET = test 560Sstevel@tonic-gate 57580Swesolows# Compiler replacement rules 58*1717SwesolowsSED_CC = -e "s!'cc'!'$(CC) -_gcc=-w'!" 59580SwesolowsSED_CC_E = -e "s!'cc -E'!'$(REAL_CC) -E'!" 60580Swesolows 610Sstevel@tonic-gate# distrib holds the perl source, contrib holds the SMI modules. 620Sstevel@tonic-gateall clean test: configure FRC 630Sstevel@tonic-gate @ cd distrib; pwd; $(KEEP_STATE_OFF); $(MAKE) $(TARGET) 640Sstevel@tonic-gate @ cd contrib; pwd; $(KEEP_STATE_OFF); $(MAKE) $(TARGET) 650Sstevel@tonic-gate 660Sstevel@tonic-gate# distrib/Makefile copies both distrib and contrib to the proto area. 670Sstevel@tonic-gateinstall: all 680Sstevel@tonic-gate @ cd distrib; pwd; $(KEEP_STATE_OFF); $(MAKE) install_files 690Sstevel@tonic-gate 700Sstevel@tonic-gateconfigure: $(DISTRIB_CONFIG_FILES) $(GEN_MAKEFILES) get_no_keywords 710Sstevel@tonic-gate 720Sstevel@tonic-gate# Modify config.sh to refer to the compiler used for the build. 730Sstevel@tonic-gatedistrib/config.sh: $(MACH)/config.sh 74580Swesolows $(SED) $(SED_CC) $(SED_CC_E) $(MACH)/config.sh > $@ 750Sstevel@tonic-gate 760Sstevel@tonic-gateMakefile.perlcfg: extract_config $(MACH)/config.sh 770Sstevel@tonic-gate ./extract_config $(MACH)/config.sh > Makefile.perlcfg 780Sstevel@tonic-gate 790Sstevel@tonic-gatedistrib/ext/Makefile: extract_makeext $(MACH)/config.sh 800Sstevel@tonic-gate ./extract_makeext $(MACH)/config.sh > distrib/ext/Makefile 810Sstevel@tonic-gate 820Sstevel@tonic-gate.PARALLEL: extract_config extract_makeext distrib/config.sh Makefile.perlcfg \ 830Sstevel@tonic-gate distrib/ext/Makefile get_no_keywords 840Sstevel@tonic-gate 850Sstevel@tonic-gate# 860Sstevel@tonic-gate# Subsidiary makefiles include the generated Makefiles, 870Sstevel@tonic-gate# so make sure they exist first and then delete them afterwards. 880Sstevel@tonic-gate# 890Sstevel@tonic-gateclobber: $(GEN_MAKEFILES) FRC 900Sstevel@tonic-gate @ cd distrib; pwd; $(KEEP_STATE_OFF); $(MAKE) $(TARGET) 910Sstevel@tonic-gate @ cd contrib; pwd; $(KEEP_STATE_OFF); $(MAKE) $(TARGET) 920Sstevel@tonic-gate - $(RM) $(DISTRIB_CONFIG_FILES) $(GEN_MAKEFILES) \ 930Sstevel@tonic-gate extract_config extract_makeext get_no_keywords 940Sstevel@tonic-gate 950Sstevel@tonic-gateFRC: 96