830N/A#
830N/A# CDDL HEADER START
830N/A#
830N/A# The contents of this file are subject to the terms of the
830N/A# Common Development and Distribution License (the "License").
830N/A# You may not use this file except in compliance with the License.
830N/A#
830N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
830N/A# or http://www.opensolaris.org/os/licensing.
830N/A# See the License for the specific language governing permissions
830N/A# and limitations under the License.
830N/A#
830N/A# When distributing Covered Code, include this CDDL HEADER in each
830N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
830N/A# If applicable, add the following below this CDDL HEADER, with the
830N/A# fields enclosed by brackets "[]" replaced with your own identifying
830N/A# information: Portions Copyright [yyyy] [name of copyright owner]
830N/A#
830N/A# CDDL HEADER END
830N/A#
6072N/A# Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
830N/A#
830N/A#
830N/A# Rules and Macros for building opens source software that uses AT&T's package
830N/A# tool.
830N/A#
3996N/A# To use these rules, include $(WS_MAKE_RULES)/attpackagemake.mk in your Makefile
830N/A# and define "build", "install" targets appropriate to building your component.
830N/A# Ex:
830N/A#
830N/A# build: $(BUILD_32) \
830N/A# $(BUILD_64)
830N/A#
830N/A# install: $(INSTALL_32) \
830N/A# $(INSTALL_64)
830N/A#
830N/A# Any additional pre/post configure, build, or install actions can be specified
830N/A# in your Makefile by setting them in on of the following macros:
830N/A# COMPONENT_PRE_BUILD_ACTION, COMPONENT_POST_BUILD_ACTION
830N/A# COMPONENT_PRE_INSTALL_ACTION, COMPONENT_POST_INSTALL_ACTION
830N/A#
830N/A# If component specific make targets need to be used for build or install, they
830N/A# can be specified in
830N/A# COMPONENT_BUILD_TARGETS, COMPONENT_INSTALL_TARGETS
830N/A#
830N/A
830N/A# Environment variables and arguments passed into the build and install
830N/A# environment(s). These are the initial settings.
830N/ACOMPONENT_BUILD_ENV += \
902N/A CC_EXPLICIT="$(CC)" \
902N/A PATH=$(shell dirname $(CC)):$(PATH) \
902N/A CC=$(shell basename $(CC))
902N/A NPROC="$(NPROC)"
830N/A
902N/A# This explicitly exports the build type for 32/64 bit distinction
902N/ACOMPONENT_BUILD_ARGS = \
902N/A HOSTTYPE="$(HOSTTYPE$(BITS))" \
902N/A CCFLAGS="$(CFLAGS)" \
902N/A LDFLAGS="$(CXXFLAGS)"
902N/A
902N/A# The install and test process needs the same environment as the build
902N/ACOMPONENT_INSTALL_ENV = $(COMPONENT_BUILD_ENV)
902N/ACOMPONENT_TEST_ENV = $(COMPONENT_BUILD_ENV)
902N/ACOMPONENT_INSTALL_ARGS = HOSTTYPE="$(HOSTTYPE$(BITS))"
6072N/ACOMPONENT_TEST_ARGS = $(COMPONENT_BUILD_ARGS)
830N/A
830N/A# build the configured source
830N/A$(BUILD_DIR)/%/.built: $(SOURCE_DIR)/.prep
830N/A $(RM) -r $(@D) ; $(MKDIR) $(@D)
830N/A $(CLONEY) $(SOURCE_DIR) $(@D)
830N/A $(COMPONENT_PRE_BUILD_ACTION)
830N/A cd $(@D); $(ENV) $(COMPONENT_BUILD_ENV) \
830N/A bin/package make $(COMPONENT_BUILD_TARGETS) $(COMPONENT_BUILD_ARGS)
830N/A $(COMPONENT_POST_BUILD_ACTION)
2238N/Aifeq ($(strip $(PARFAIT_BUILD)),yes)
2238N/A -$(PARFAIT) $(@D)
2238N/Aendif
830N/A $(TOUCH) $@
830N/A
830N/A# install the built source into a prototype area
830N/A$(BUILD_DIR)/%/.installed: $(BUILD_DIR)/%/.built
830N/A $(COMPONENT_PRE_INSTALL_ACTION)
830N/A $(RM) -r $(PROTO_DIR)/$(MACH$(BITS)); $(MKDIR) $(PROTO_DIR)/$(MACH$(BITS));
902N/A cd $(@D); $(ENV) $(COMPONENT_INSTALL_ENV) \
830N/A bin/package flat $(COMPONENT_INSTALL_TARGETS) \
902N/A $(COMPONENT_INSTALL_ARGS) \
830N/A $(PROTO_DIR)/$(MACH$(BITS)) $(COMPONENT_INSTALL_PACKAGES)
830N/A $(COMPONENT_POST_INSTALL_ACTION)
830N/A $(TOUCH) $@
830N/A
830N/A# test the built source
3996N/A$(BUILD_DIR)/%/.tested: $(BUILD_DIR)/%/.built
830N/A $(COMPONENT_PRE_TEST_ACTION)
902N/A cd $(@D); $(ENV) $(COMPONENT_TEST_ENV) \
902N/A bin/package test $(COMPONENT_TEST_TARGETS) \
902N/A $(COMPONENT_TEST_ARGS)
830N/A $(COMPONENT_POST_TEST_ACTION)
830N/A $(TOUCH) $@
830N/A
2238N/Aifeq ($(strip $(PARFAIT_BUILD)),yes)
2238N/Aparfait: build
2238N/Aelse
2238N/Aparfait:
2238N/A $(MAKE) PARFAIT_BUILD=yes parfait
2238N/Aendif
2238N/A
830N/Aclean::
830N/A $(RM) -r $(BUILD_DIR) $(PROTO_DIR)