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