61N/A#
61N/A# CDDL HEADER START
61N/A#
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#
61N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
61N/A# or http://www.opensolaris.org/os/licensing.
61N/A# See the License for the specific language governing permissions
61N/A# and limitations under the License.
61N/A#
61N/A# When distributing Covered Code, include this CDDL HEADER in each
61N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
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]
61N/A#
61N/A# CDDL HEADER END
61N/A#
5680N/A
5680N/A#
6606N/A# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
61N/A#
61N/A#
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#
3817N/A# To use these rules, include $(WS_MAKE_RULES)/justmake.mk in your Makefile
61N/A# and define "build", "install" targets appropriate to building your component.
61N/A# Ex:
61N/A#
61N/A# build: $(BUILD_32) \
61N/A# $(BUILD_64)
61N/A#
61N/A# install: $(INSTALL_32) \
61N/A# $(INSTALL_64)
61N/A#
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#
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
61N/A#
61N/A
278N/ACOMPONENT_INSTALL_ARGS += DESTDIR=$(PROTO_DIR)
5123N/ACOMPONENT_INSTALL_ARGS += $(COMPONENT_INSTALL_ARGS.$(BITS))
278N/A
5329N/ACOMPONENT_BUILD_ACTION ?= \
5329N/A cd $(@D); $(ENV) $(COMPONENT_BUILD_ENV) \
5329N/A $(GMAKE) $(COMPONENT_BUILD_ARGS) $(COMPONENT_BUILD_TARGETS)
5329N/A
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)
1780N/A -$(PARFAIT) $(@D)
814N/Aendif
61N/A $(TOUCH) $@
61N/A
5329N/ACOMPONENT_INSTALL_ACTION ?= \
5329N/A cd $(@D) ; $(ENV) $(COMPONENT_INSTALL_ENV) \
5329N/A $(GMAKE) $(COMPONENT_INSTALL_ARGS) $(COMPONENT_INSTALL_TARGETS)
5329N/A
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)
61N/A $(TOUCH) $@
61N/A
6606N/A# Test the built source. If the output file shows up in the environment or
6606N/A# arguments, don't redirect stdout/stderr to it.
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) \
3205N/A $(COMPONENT_TEST_CMD) \
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 $(COMPONENT_TEST_COMPARE)
3558N/A $(COMPONENT_TEST_CLEANUP)
3558N/A $(TOUCH) $@
3558N/A
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_CMD) \
3558N/A $(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS))
3558N/A $(COMPONENT_POST_TEST_ACTION)
3558N/A $(COMPONENT_TEST_CLEANUP)
181N/A $(TOUCH) $@
181N/A
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
6606N/A# stdout/stderr to it.
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_TEST_COMPARE)
4089N/A $(COMPONENT_SYSTEM_TEST_CLEANUP)
4089N/A $(TOUCH) $@
4089N/A
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)
4089N/A $(TOUCH) $@
4089N/A
814N/Aifeq ($(strip $(PARFAIT_BUILD)),yes)
1780N/Aparfait: build
814N/Aelse
814N/Aparfait:
814N/A $(MAKE) PARFAIT_BUILD=yes parfait
814N/Aendif