Makefile revision 80ab886d233f514d54c2a6bdeb9fdfd951bd6881
199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soome# CDDL HEADER START
199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soome# The contents of this file are subject to the terms of the
199767f8919635c4928607450d9e0abb932109ceToomas Soome# Common Development and Distribution License (the "License").
199767f8919635c4928607450d9e0abb932109ceToomas Soome# You may not use this file except in compliance with the License.
199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soome# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
199767f8919635c4928607450d9e0abb932109ceToomas Soome# or http://www.opensolaris.org/os/licensing.
199767f8919635c4928607450d9e0abb932109ceToomas Soome# See the License for the specific language governing permissions
199767f8919635c4928607450d9e0abb932109ceToomas Soome# and limitations under the License.
199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soome# When distributing Covered Code, include this CDDL HEADER in each
199767f8919635c4928607450d9e0abb932109ceToomas Soome# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
199767f8919635c4928607450d9e0abb932109ceToomas Soome# If applicable, add the following below this CDDL HEADER, with the
199767f8919635c4928607450d9e0abb932109ceToomas Soome# fields enclosed by brackets "[]" replaced with your own identifying
199767f8919635c4928607450d9e0abb932109ceToomas Soome# information: Portions Copyright [yyyy] [name of copyright owner]
199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soome# CDDL HEADER END
199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soome# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
199767f8919635c4928607450d9e0abb932109ceToomas Soome# Use is subject to license terms.
199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soome# ident "%Z%%M% %I% %E% SMI"
199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soome# Note: Hidden command and dependency checking plays havoc with perl module
199767f8919635c4928607450d9e0abb932109ceToomas Soome# makefiles, so we make sure to always unset the KEEP_STATE and
199767f8919635c4928607450d9e0abb932109ceToomas Soome# SUNPRO_DEPENDENCIES environment variables before calling any subsidiary makes.
199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome.KEEP_STATE:
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soomeinclude ../../Makefile.cmd
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome# To turn KEEP_STATE off the following two environment variables must be unset.
199767f8919635c4928607450d9e0abb932109ceToomas SoomeKEEP_STATE_OFF = unset KEEP_STATE SUNPRO_DEPENDENCIES
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome# Configuration files needed from the architecture-specific subdirectories.
199767f8919635c4928607450d9e0abb932109ceToomas SoomeMACH_CONFIG_FILES = config.sh
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome# Where the configuration files need to be copied to.
199767f8919635c4928607450d9e0abb932109ceToomas SoomeDISTRIB_CONFIG_FILES = $(MACH_CONFIG_FILES:%=distrib/%)
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome# Generated Makefiles, derived from config.sh.
199767f8919635c4928607450d9e0abb932109ceToomas SoomeGEN_MAKEFILES = Makefile.perlcfg distrib/ext/Makefile
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soomeall := TARGET = all
199767f8919635c4928607450d9e0abb932109ceToomas Soomeinstall := TARGET = install
199767f8919635c4928607450d9e0abb932109ceToomas Soomeclobber := TARGET = clobber
199767f8919635c4928607450d9e0abb932109ceToomas Soomeclean := TARGET = clean
199767f8919635c4928607450d9e0abb932109ceToomas Soometest := TARGET = test
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome# Compiler replacement rules
199767f8919635c4928607450d9e0abb932109ceToomas SoomeSED_CC = -e "s!'cc'!'$(CC) -_gcc=-w'!"
199767f8919635c4928607450d9e0abb932109ceToomas SoomeSED_CC_E = -e "s!'cc -E'!'$(REAL_CC) -E'!"
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome# distrib holds the perl source, contrib holds the SMI modules.
199767f8919635c4928607450d9e0abb932109ceToomas Soomeall clean test: configure FRC
199767f8919635c4928607450d9e0abb932109ceToomas Soome @ cd distrib; pwd; $(KEEP_STATE_OFF); $(MAKE) $(TARGET)
199767f8919635c4928607450d9e0abb932109ceToomas Soome @ cd contrib; pwd; $(KEEP_STATE_OFF); $(MAKE) $(TARGET)
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome# distrib/Makefile copies both distrib and contrib to the proto area.
199767f8919635c4928607450d9e0abb932109ceToomas Soomeinstall: all
199767f8919635c4928607450d9e0abb932109ceToomas Soome @ cd distrib; pwd; $(KEEP_STATE_OFF); $(MAKE) install_files
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soomeconfigure: $(DISTRIB_CONFIG_FILES) $(GEN_MAKEFILES)
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome# Modify config.sh to refer to the compiler used for the build.
199767f8919635c4928607450d9e0abb932109ceToomas Soomedistrib/config.sh: $(MACH)/config.sh
199767f8919635c4928607450d9e0abb932109ceToomas Soome $(SED) $(SED_CC) $(SED_CC_E) $(MACH)/config.sh > $@
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas SoomeMakefile.perlcfg: extract_config $(MACH)/config.sh
199767f8919635c4928607450d9e0abb932109ceToomas Soome ./extract_config $(MACH)/config.sh > Makefile.perlcfg
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soomedistrib/ext/Makefile: extract_makeext $(MACH)/config.sh
199767f8919635c4928607450d9e0abb932109ceToomas Soome ./extract_makeext $(MACH)/config.sh > distrib/ext/Makefile
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome.PARALLEL: extract_config extract_makeext distrib/config.sh Makefile.perlcfg \
199767f8919635c4928607450d9e0abb932109ceToomas Soome distrib/ext/Makefile
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soome# Subsidiary makefiles include the generated Makefiles,
199767f8919635c4928607450d9e0abb932109ceToomas Soome# so make sure they exist first and then delete them afterwards.
199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soomeclobber: $(GEN_MAKEFILES) FRC
199767f8919635c4928607450d9e0abb932109ceToomas Soome @ cd distrib; pwd; $(KEEP_STATE_OFF); $(MAKE) $(TARGET)
199767f8919635c4928607450d9e0abb932109ceToomas Soome @ cd contrib; pwd; $(KEEP_STATE_OFF); $(MAKE) $(TARGET)
199767f8919635c4928607450d9e0abb932109ceToomas Soome - $(RM) $(DISTRIB_CONFIG_FILES) $(GEN_MAKEFILES) \
199767f8919635c4928607450d9e0abb932109ceToomas Soome extract_config extract_makeext
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas SoomeFRC:
199767f8919635c4928607450d9e0abb932109ceToomas Soome