blob: 499b41896a91507b036bde45dca0f62a70bd3e64 [file] [log] [blame]
# Copyright (c) 2010-2012 Nest Labs, 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 host make file for the International
# Components for Unicode (ICU) library.
# To cross-compile, ICU needs to be bootstrapped for whatever the
# native build host is. In our environment, that's the simulator. At
# some point in the future, we should tease apart truly building for
# the simulator and just building host-native stuff to support a build
# target.
#TODO QUESTION what is this? diamondsim // diamond3sim?
override BuildProduct := diamondsim
SaveBuildMode := $(BuildMode)
override BuildMode := snapshot
include pre.mak
include ./Makefile.common
PackageName := icu
PackageExtension := tar.gz
PackageSeparator := -
PackagePatchArgs := -p1
PackageArchive := $(PackageName).$(PackageExtension)
PackageSourceDir := $(PackageName)
PackageBuildMakefile = $(call GenerateBuildPaths,Makefile)
CleanPaths += $(PackageLicenseFile)
all: $(PackageDefaultGoal)
# Generate the package license contents.
$(PackageSourceDir)/license.html: source
$(PackageLicenseFile): $(PackageSourceDir)/license.html
# 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.
$(PackageBuildMakefile): | $(PackageSourceDir) $(BuildDirectory) $(ResultDirectory)
$(Verbose)cd $(BuildDirectory) && \
$(CURDIR)/$(PackageSourceDir)/source/configure \
--prefix=/usr \
--sysconfdir=/etc \
# Configure the source for building.
$(ICUDataConfMaybeBuildPaths): | $(BuildDirectory)
.PHONY: configure
configure: source $(ICUDataConfMaybeBuildPaths) $(PackageBuildMakefile)
# Build the source.
# We have to unset MAKEFLAGS since they confuse the package build otherwise.
.PHONY: build
build: configure
$(Verbose)unset MAKEFLAGS && \
$(MAKE) $(JOBSFLAG) -C $(BuildDirectory) all
# Stage the build to a temporary installation area.
# We have to unset MAKEFLAGS since they confuse the package build otherwise.
.PHONY: stage
stage: build | $(ResultDirectory)
$(Verbose)unset MAKEFLAGS && \
$(MAKE) $(JOBSFLAG) -C $(BuildDirectory) DESTDIR=$(ResultDirectory) install
$(Verbose)$(RM) $(RMFLAGS) -r $(PackageSourceDir)
$(Verbose)$(RM) $(RMFLAGS) -r $(BuildDirectory)
$(Verbose)$(RM) $(RMFLAGS) -r $(ResultDirectory)
include post.mak
override BuildMode := $(SaveBuildMode)