458N/A# The contents of this file are subject to the terms of the
458N/A# Common Development and Distribution License (the "License").
458N/A# You may not use this file except in compliance with the License.
458N/A# See the License for the specific language governing permissions
458N/A# and limitations under the License.
458N/A# When distributing Covered Code, include this CDDL HEADER in each
458N/A# If applicable, add the following below this CDDL HEADER, with the
458N/A# fields enclosed by brackets "[]" replaced with your own identifying
458N/A# information: Portions Copyright [yyyy] [name of copyright owner]
3793N/A# Copyright (c) 2010, Oracle
and/or it's affiliates. All rights reserved.
458N/A# Rules and Macros for building opens source software that uses configure /
458N/A# GNU auto* tools to configure their build for the system they are on. This
458N/A# uses GNU Make to build the components to take advantage of the viewpath
458N/A# support and build multiple version (32/64 bit) from a shared source.
458N/A# and define "build", "install" targets appropriate to building your component.
3565N/A# build: $(COMPONENT_SRC)/build-32/.built \
618N/A# $(COMPONENT_SRC)/build-64/.built
1273N/A# install: $(COMPONENT_SRC)/build-32/.installed \
458N/A# $(COMPONENT_SRC)/build-64/.installed
3272N/A# Any additional
pre/post configure, build, or install actions can be specified
458N/A# in your make file by setting them in on of the following macros:
458N/A# COMPONENT_PRE_CONFIGURE_ACTION, COMPONENT_POST_CONFIGURE_ACTION
458N/A# COMPONENT_PRE_BUILD_ACTION, COMPONENT_POST_BUILD_ACTION
581N/A# COMPONENT_PRE_INSTALL_ACTION, COMPONENT_POST_INSTALL_ACTION
3272N/A# If component specific make targets need to be used for build or install, they
3272N/A# COMPONENT_BUILD_TARGETS, COMPONENT_INSTALL_TARGETS
458N/ACONFIGURE_OPTIONS += --prefix=/usr
458N/ACONFIGURE_OPTIONS += CC="$(CC.$(BITS))"
969N/ACONFIGURE_OPTIONS += CXX="$(CCC.$(BITS))"
969N/A$(COMPONENT_SRC)/build-32/.configured: BITS=32
458N/A$(COMPONENT_SRC)/build-64/.configured: BITS=64
969N/ACONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(BITS))
458N/A# set the default target for installation of the component
458N/ACOMPONENT_INSTALL_TARGETS = install
458N/A# configure the unpacked source for building 32 and 64 bit version
458N/A$(COMPONENT_SRC)/build-%/.configured: $(COMPONENT_SRC)/.prep
458N/A ($(RM) -rf $(@D) ; $(MKDIR) $(@D))
458N/A $(COMPONENT_PRE_CONFIGURE_ACTION)
458N/A (cd $(@D) ; env - $(CONFIGURE_ENV) $(CONFIG_SHELL) \
458N/A ../configure $(CONFIGURE_OPTIONS) $(CONFIGURE_OPTIONS.$(BITS)))
458N/A $(COMPONENT_POST_CONFIGURE_ACTION)
646N/A# build the configured source
646N/A$(COMPONENT_SRC)/build-%/.built: $(COMPONENT_SRC)/build-%/.configured
646N/A $(COMPONENT_PRE_BUILD_ACTION)
646N/A (cd $(@D) ; $(GMAKE) $(COMPONENT_BUILD_TARGETS))
646N/A $(COMPONENT_POST_BUILD_ACTION)
646N/A# install the built source into a prototype area
646N/A$(COMPONENT_SRC)/build-%/.installed: $(COMPONENT_SRC)/build-%/.built
646N/A $(COMPONENT_PRE_INSTALL_ACTION)
581N/A (cd $(@D) ; $(GMAKE) DESTDIR=$(PROTO_DIR) $(COMPONENT_INSTALL_TARGETS))
581N/A $(COMPONENT_POST_INSTALL_ACTION)