256N/A# The contents of this file are subject to the terms of the
256N/A# Common Development and Distribution License (the "License").
256N/A# You may not use this file except in compliance with the License.
256N/A# See the License for the specific language governing permissions
256N/A# and limitations under the License.
256N/A# When distributing Covered Code, include this CDDL HEADER in each
256N/A# If applicable, add the following below this CDDL HEADER, with the
256N/A# fields enclosed by brackets "[]" replaced with your own identifying
256N/A# information: Portions Copyright [yyyy] [name of copyright owner]
256N/A# Copyright (c) 2012, 2013, Oracle
and/or its affiliates. All rights reserved.
256N/A# Rules and Macros for building opens source software that uses AT&T's package
256N/A# and define "build", "install" targets appropriate to building your component.
256N/A# install: $(INSTALL_32) \
256N/A# Any additional
pre/post configure, build, or install actions can be specified
3661N/A# in your Makefile by setting them in on of the following macros:
3661N/A# COMPONENT_PRE_BUILD_ACTION, COMPONENT_POST_BUILD_ACTION
256N/A# COMPONENT_PRE_INSTALL_ACTION, COMPONENT_POST_INSTALL_ACTION
256N/A# If component specific make targets need to be used for build or install, they
256N/A# COMPONENT_BUILD_TARGETS, COMPONENT_INSTALL_TARGETS
256N/A# Environment variables and arguments passed into the build and install
256N/A# environment(s). These are the initial settings.
256N/ACOMPONENT_BUILD_ENV += \
2617N/A PATH=$(shell dirname $(CC)):$(PATH) \
256N/A# This explicitly exports the build type for 32/64 bit distinction
256N/ACOMPONENT_BUILD_ARGS = \
256N/A HOSTTYPE="$(HOSTTYPE$(BITS))" \
256N/A# The install and test process needs the same environment as the build
256N/ACOMPONENT_INSTALL_ENV = $(COMPONENT_BUILD_ENV)
COMPONENT_TEST_ENV = $(COMPONENT_BUILD_ENV)
COMPONENT_INSTALL_ARGS = HOSTTYPE="$(HOSTTYPE$(BITS))"
COMPONENT_TEST_ARGS = HOSTTYPE="$(HOSTTYPE$(BITS))"
# build the configured source
$(BUILD_DIR)/%/.built: $(SOURCE_DIR)/.prep
$(RM) -r $(@D) ; $(MKDIR) $(@D)
$(CLONEY) $(SOURCE_DIR) $(@D)
$(COMPONENT_PRE_BUILD_ACTION)
cd $(@D); $(ENV) $(COMPONENT_BUILD_ENV) \
bin/package make $(COMPONENT_BUILD_TARGETS) $(COMPONENT_BUILD_ARGS)
$(COMPONENT_POST_BUILD_ACTION)
ifeq ($(strip $(PARFAIT_BUILD)),yes)
# install the built source into a prototype area
$(BUILD_DIR)/%/.installed: $(BUILD_DIR)/%/.built
$(COMPONENT_PRE_INSTALL_ACTION)
$(RM) -r $(PROTO_DIR)/$(MACH$(BITS)); $(MKDIR) $(PROTO_DIR)/$(MACH$(BITS));
cd $(@D); $(ENV) $(COMPONENT_INSTALL_ENV) \
$(COMPONENT_INSTALL_ARGS) \
$(PROTO_DIR)/$(MACH$(BITS)) $(COMPONENT_INSTALL_PACKAGES)
$(COMPONENT_POST_INSTALL_ACTION)
$(BUILD_DIR)/%/.tested: $(BUILD_DIR)/%/.built
$(COMPONENT_PRE_TEST_ACTION)
cd $(@D); $(ENV) $(COMPONENT_TEST_ENV) \
$(COMPONENT_POST_TEST_ACTION)
ifeq ($(strip $(PARFAIT_BUILD)),yes)
$(MAKE) PARFAIT_BUILD=yes parfait
$(RM) -r $(BUILD_DIR) $(PROTO_DIR)