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