blob: 00e6854eba057a72f09a92357b076ffc5c662270 [file] [log] [blame]
# Copyright (c) 2010-2011 Nest, Inc.
# All rights reserved.
# This document is the property of Nest. It is considered
# confidential and proprietary information.
# This document may not be reproduced or transmitted in any form,
# in whole or in part, without the express written permission of
# Nest.
# Description:
# This file is the makefile for Boost, a collection of open
# source libraries that extend the functionality of the C++ standard
# library.
BuildConfigSpecialized := No
include pre.mak
PackageName := boost
PackageExtension := tar.bz2
PackageSeparator := _
PackagePatchArgs := -p1
PackageArchive := $(PackageName).$(PackageExtension)
PackageSourceDir := $(PackageName)$(PackageSeparator)$(PackageVersion)
CleanPaths += $(PackageLicenseFile)
# For the short-term, we are always building with GCC even though the
# actual tool chain may be some repackaged version of GCC. So, just
# specify that.
BoostToolset := gcc
# We do not want versioned headers and libraries, so specify the
# 'system' layout. Also, we do not want all the various combinations
# of shared/static, release/debug, stripped/unstripped and
# non-threaded/threaded libraries, so just specify 'minimal'.
BoostJamConfig += --layout=system --build-type=minimal
BoostLibraries = date_time \
filesystem \
regex \
system \
test \
BoostLibrariesList = $(subst $(Space),$(Comma),$(strip $(BoostLibraries)))
BoostConfigure = $(call GenerateBuildPaths,
BoostProjectConfig = $(call GenerateBuildPaths,project-config.jam)
all: $(PackageDefaultGoal)
# Generate the package license contents.
$(PackageSourceDir)/LICENSE_1_0.txt: source
$(PackageLicenseFile): $(PackageSourceDir)/LICENSE_1_0.txt
# Extract the source from the archive and apply patches, if any.
$(PackageSourceDir): $(PackageArchive) $(PackagePatchPaths)
# Prepare the sources.
.PHONY: source
source: | $(PackageSourceDir)
# Patch the sources, if necessary.
.PHONY: patch
patch: source
# Generate the package build makefile.
$(BoostConfigure): | $(PackageSourceDir) $(BuildDirectory)
$(call create-links,$(CURDIR)/$(PackageSourceDir),$(BuildDirectory))
# Generate the build-specific makefile and user configuration. We have
# to post-process the generated user configuration since Boost's
# adominable build system has no other way to override the actual C++
# compiler executable used (see
# cross-compiling-boost.html and boost/docs/html/bbv2/
# tasks.html#bbv2.tasks.crosscompile).
$(BoostProjectConfig): $(BoostConfigure)
$(Verbose)cd $(BuildDirectory) && \
./ \
--prefix=$(ResultDirectory) \
--with-toolset=$(BoostToolset) \
--without-icu \
$(Verbose)$(SED) -e "s#^\([[:space:]]*using\)[[:space:]]\{1,\}\($(BoostToolset)\)[[:space:]]\{1,\};#\1 \2 : $(TargetProcArch) : $(CXX) ;#g" \
< $(@) > $(@).N || $(RM) -f $(@)
$(Verbose)mv -f $(@) $(@).O
$(Verbose)mv -f $(@).N $(@)
# Configure the source for building.
.PHONY: configure
configure: source $(BoostProjectConfig)
# Build the source.
.PHONY: build
build: configure
$(Verbose)cd $(BuildDirectory) && \
./bjam $(BoostJamConfig)
# Stage the build to a temporary installation area.
.PHONY: stage
stage: build | $(ResultDirectory)
$(Verbose)cd $(BuildDirectory) && \
./bjam $(BoostJamConfig) \
install --prefix=$(ResultDirectory)
$(Verbose)$(RM) $(RMFLAGS) -r $(PackageSourceDir)
$(Verbose)$(RM) $(RMFLAGS) -r $(BuildDirectory)
$(Verbose)$(RM) $(RMFLAGS) -r $(ResultDirectory)
include post.mak