blob: db6a7741b2b831b88e4b879ed0aa0f4e70568e8b [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 make file tzcode, executables required for
# the implementation of standard local time for many
# representative locations around the globe.
#
BuildConfigSpecialized := No
BuildProductSpecialized := No
include pre.mak
# Override the build directory so that the three make files that make
# up this collective package all build in the same directory.
BuildDirectory := $(call GenerateConditionalBuildQualifiedDirectory,$(BuildBaseDirectory))
PackageName := tzcode
PackageExtension := tar.gz
PackageSeparator :=
PackagePatchArgs := -p1
PackageArchive := $(PackageName).$(PackageExtension)
PackageSourceDir := $(PackageName)$(PackageSeparator)$(PackageVersion)
PackageBuildMakefile := $(call GenerateBuildPaths,Makefile)
PackageLicenseInputs := $(PackageSourceDir)/tzfile.h
CleanPaths += $(PackageLicenseFile)
all: $(PackageDefaultGoal)
# Generate the package license contents.
$(PackageLicenseInputs): source
$(PackageLicenseFile): $(PackageLicenseInputs)
$(Verbose)$(SED) -n -e '/^\/\*/,/\*\/$$/{;p;/\*\/$$/q;}' < $< > $@
# Extract the source from the archive and apply patches, if any.
#
# Unlike most third-party software packages, the tzcode archive does not
# contain a directory that encloses its sources. So, we have to create one
# manually to avoid cluttering up our "glue" directory with its sources.
$(PackageSourceDir): $(PackageArchive) $(PackagePatchPaths)
$(create-directory)
$(call expand-archive,$(PackageArchive),$(@))
$(Verbose)touch $(@)
$(call patch-directory,$(@),$(PackagePatchArgs),$(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)
$(call create-links,$(CURDIR)/$(PackageSourceDir),$(BuildDirectory))
# Configure the source for building.
.PHONY: configure
configure: source $(PackageBuildMakefile)
# Build the source (there's nothing to do here).
.PHONY: build
build: configure
# Stage the build to a temporary installation area (there's nothing to
# do here).
.PHONY: stage
stage: build
clean:
$(Verbose)$(RM) $(RMFLAGS) -r $(PackageSourceDir)
$(Verbose)$(RM) $(RMFLAGS) -r $(BuildDirectory)
include post.mak