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