Makefile revision 80ab886d233f514d54c2a6bdeb9fdfd951bd6881
794b79e6bbc3f5db1ea6ae154d739b9f1ef1a375Tinderbox User# CDDL HEADER START
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# The contents of this file are subject to the terms of the
4a14ce5ba00ab7bc55c99ffdcf59c7a4ab902721Automatic Updater# Common Development and Distribution License (the "License").
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson# You may not use this file except in compliance with the License.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews# See the License for the specific language governing permissions
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# and limitations under the License.
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews# When distributing Covered Code, include this CDDL HEADER in each
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews# If applicable, add the following below this CDDL HEADER, with the
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson# fields enclosed by brackets "[]" replaced with your own identifying
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# information: Portions Copyright [yyyy] [name of copyright owner]
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# CDDL HEADER END
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User# Use is subject to license terms.
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User# ident "%Z%%M% %I% %E% SMI"
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User# Note: Hidden command and dependency checking plays havoc with perl module
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User# makefiles, so we make sure to always unset the KEEP_STATE and
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User# SUNPRO_DEPENDENCIES environment variables before calling any subsidiary makes.
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User# To turn KEEP_STATE off the following two environment variables must be unset.
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox UserKEEP_STATE_OFF = unset KEEP_STATE SUNPRO_DEPENDENCIES
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User# Configuration files needed from the architecture-specific subdirectories.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Where the configuration files need to be copied to.
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox UserDISTRIB_CONFIG_FILES = $(MACH_CONFIG_FILES:%=distrib/%)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Generated Makefiles, derived from config.sh.
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox UserGEN_MAKEFILES = Makefile.perlcfg distrib/ext/Makefile
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeintest := TARGET = test
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Compiler replacement rules
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# distrib holds the perl source, contrib holds the SMI modules.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein @ cd distrib; pwd; $(KEEP_STATE_OFF); $(MAKE) $(TARGET)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein @ cd contrib; pwd; $(KEEP_STATE_OFF); $(MAKE) $(TARGET)
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User# distrib/Makefile copies both distrib and contrib to the proto area.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein @ cd distrib; pwd; $(KEEP_STATE_OFF); $(MAKE) install_files
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox Userconfigure: $(DISTRIB_CONFIG_FILES) $(GEN_MAKEFILES) get_no_keywords
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Modify config.sh to refer to the compiler used for the build.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(SED) $(SED_CC) $(SED_CC_E) $(MACH)/config.sh > $@
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinMakefile.perlcfg: extract_config $(MACH)/config.sh
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein ./extract_config $(MACH)/config.sh > Makefile.perlcfg
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox Userdistrib/ext/Makefile: extract_makeext $(MACH)/config.sh
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein ./extract_makeext $(MACH)/config.sh > distrib/ext/Makefile
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein.PARALLEL: extract_config extract_makeext distrib/config.sh Makefile.perlcfg \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Subsidiary makefiles include the generated Makefiles,
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User# so make sure they exist first and then delete them afterwards.
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User @ cd distrib; pwd; $(KEEP_STATE_OFF); $(MAKE) $(TARGET)
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User @ cd contrib; pwd; $(KEEP_STATE_OFF); $(MAKE) $(TARGET)