61N/A# The contents of this file are subject to the terms of the
61N/A# Common Development and Distribution License (the "License").
61N/A# You may not use this file except in compliance with the License.
61N/A# See the License for the specific language governing permissions
61N/A# and limitations under the License.
61N/A# When distributing Covered Code, include this CDDL HEADER in each
61N/A# If applicable, add the following below this CDDL HEADER, with the
61N/A# fields enclosed by brackets "[]" replaced with your own identifying
61N/A# information: Portions Copyright [yyyy] [name of copyright owner]
6606N/A# Copyright (c) 2011, 2016, Oracle
and/or its affiliates. All rights reserved.
61N/A# Rules and Macros for building opens source software that just uses their
61N/A# own make and no autoconf-style tools.
61N/A# and define "build", "install" targets appropriate to building your component.
61N/A# build: $(BUILD_32) \
61N/A# install: $(INSTALL_32) \
61N/A# Any additional
pre/post configure, build, or install actions can be specified
61N/A# in your Makefile by setting them in on of the following macros:
5329N/A# COMPONENT_PRE_BUILD_ACTION, COMPONENT_BUILD_ACTION,
5329N/A# COMPONENT_POST_BUILD_ACTION, COMPONENT_PRE_INSTALL_ACTION,
5329N/A# COMPONENT_INSTALL_ACTION, COMPONENT_POST_INSTALL_ACTION
61N/A# If component specific make targets need to be used for build or install, they
61N/A# can be specified in
61N/A# COMPONENT_BUILD_TARGETS, COMPONENT_INSTALL_TARGETS
278N/ACOMPONENT_INSTALL_ARGS += DESTDIR=$(PROTO_DIR)
5123N/ACOMPONENT_INSTALL_ARGS += $(COMPONENT_INSTALL_ARGS.$(BITS))
5329N/A cd $(@D); $(ENV) $(COMPONENT_BUILD_ENV) \
5329N/A $(GMAKE) $(COMPONENT_BUILD_ARGS) $(COMPONENT_BUILD_TARGETS)
61N/A# build the configured source
61N/A$(BUILD_DIR)/%/.built: $(SOURCE_DIR)/.prep
61N/A $(RM) -r $(@D) ; $(MKDIR) $(@D)
61N/A $(CLONEY) $(SOURCE_DIR) $(@D)
61N/A $(COMPONENT_PRE_BUILD_ACTION)
5329N/A ($(COMPONENT_BUILD_ACTION))
61N/A $(COMPONENT_POST_BUILD_ACTION)
814N/Aifeq ($(strip $(PARFAIT_BUILD)),yes)
5329N/ACOMPONENT_INSTALL_ACTION ?= \
5329N/A cd $(@D) ; $(ENV) $(COMPONENT_INSTALL_ENV) \
5329N/A $(GMAKE) $(COMPONENT_INSTALL_ARGS) $(COMPONENT_INSTALL_TARGETS)
61N/A# install the built source into a prototype area
61N/A$(BUILD_DIR)/%/.installed: $(BUILD_DIR)/%/.built
61N/A $(COMPONENT_PRE_INSTALL_ACTION)
5329N/A ($(COMPONENT_INSTALL_ACTION))
61N/A $(COMPONENT_POST_INSTALL_ACTION)
6606N/A# Test the built source. If the output file shows up in the environment or
3558N/A$(BUILD_DIR)/%/.tested-and-compared: $(BUILD_DIR)/%/.built
3864N/A $(RM) -rf $(COMPONENT_TEST_BUILD_DIR)
3864N/A $(MKDIR) $(COMPONENT_TEST_BUILD_DIR)
181N/A $(COMPONENT_PRE_TEST_ACTION)
3558N/A -(cd $(COMPONENT_TEST_DIR) ; \
3558N/A $(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
3558N/A $(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS)) \
6606N/A $(if $(findstring $(COMPONENT_TEST_OUTPUT),$(COMPONENT_TEST_ENV)$(COMPONENT_TEST_ARGS)),,&> $(COMPONENT_TEST_OUTPUT))
181N/A $(COMPONENT_POST_TEST_ACTION)
3558N/A $(COMPONENT_TEST_CREATE_TRANSFORMS)
3558N/A $(COMPONENT_TEST_PERFORM_TRANSFORM)
3558N/A$(BUILD_DIR)/%/.tested: $(BUILD_DIR)/%/.built
3558N/A $(COMPONENT_PRE_TEST_ACTION)
3558N/A (cd $(COMPONENT_TEST_DIR) ; \
3558N/A $(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
3558N/A $(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS))
3558N/A $(COMPONENT_POST_TEST_ACTION)
4391N/A# Test the installed packages. The targets above depend on .built which
4391N/A# means $(CLONEY) has already run. System-test needs cloning but not
4391N/A# building; thus ideally, we would want to depend on .cloned here and below,
6606N/A# but since we don't have that, we depend on .prep and run $(CLONEY) here. If
6606N/A# the output file shows up in the environment or arguments, don't redirect
4089N/A$(BUILD_DIR)/%/.system-tested-and-compared: $(SOURCE_DIR)/.prep
4089N/A $(RM) -rf $(COMPONENT_TEST_BUILD_DIR)
4089N/A $(MKDIR) $(COMPONENT_TEST_BUILD_DIR)
4391N/A $(CLONEY) $(SOURCE_DIR) $(@D)
4089N/A $(COMPONENT_PRE_SYSTEM_TEST_ACTION)
4089N/A -(cd $(COMPONENT_SYSTEM_TEST_DIR) ; \
4089N/A $(COMPONENT_SYSTEM_TEST_ENV_CMD) $(COMPONENT_SYSTEM_TEST_ENV) \
4089N/A $(COMPONENT_SYSTEM_TEST_CMD) \
4089N/A $(COMPONENT_SYSTEM_TEST_ARGS) $(COMPONENT_SYSTEM_TEST_TARGETS)) \
6606N/A $(if $(findstring $(COMPONENT_TEST_OUTPUT),$(COMPONENT_SYSTEM_TEST_ENV)$(COMPONENT_SYSTEM_TEST_ARGS)),,&> $(COMPONENT_TEST_OUTPUT))
4089N/A $(COMPONENT_POST_SYSTEM_TEST_ACTION)
4089N/A $(COMPONENT_TEST_CREATE_TRANSFORMS)
4089N/A $(COMPONENT_TEST_PERFORM_TRANSFORM)
4089N/A $(COMPONENT_SYSTEM_TEST_CLEANUP)
4089N/A$(BUILD_DIR)/%/.system-tested: $(SOURCE_DIR)/.prep
4391N/A $(CLONEY) $(SOURCE_DIR) $(@D)
4089N/A $(COMPONENT_PRE_SYSTEM_TEST_ACTION)
4089N/A (cd $(COMPONENT_SYSTEM_TEST_DIR) ; \
4089N/A $(COMPONENT_SYSTEM_TEST_ENV_CMD) $(COMPONENT_SYSTEM_TEST_ENV) \
4089N/A $(COMPONENT_SYSTEM_TEST_CMD) \
4089N/A $(COMPONENT_SYSTEM_TEST_ARGS) $(COMPONENT_SYSTEM_TEST_TARGETS))
4089N/A $(COMPONENT_POST_SYSTEM_TEST_ACTION)
4089N/A $(COMPONENT_SYSTEM_TEST_CLEANUP)
814N/Aifeq ($(strip $(PARFAIT_BUILD)),yes)
814N/A $(MAKE) PARFAIT_BUILD=yes parfait