blob: fe7270e8563396ce254d2ae06db44ed953579f38 [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.
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)
SOURCEDIRS = $(PackageSourceDir)
$(PackageSourceDir)_RULE_TARGET = $(BuildDirectory)/configure
all: $(PackageDefaultGoal)
# Generate the package license contents.
$(PackageLicenseInputs): $(BuildDirectory)/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)
$(call expand-archive,$(PackageArchive),$(@))
$(Verbose)touch $(@)
$(call patch-directory,$(@),$(PackagePatchArgs),$(PackagePatchPaths))
# Prepare the sources.
$(BuildDirectory)/source: | $(PackageSourceDir)
$(Verbose)touch $@
# Patch the sources, if necessary.
$(BuildDirectory)/patch: $(BuildDirectory)/source
$(Verbose)touch $@
# Generate the package build makefile.
$(PackageBuildMakefile): | $(PackageSourceDir) $(BuildDirectory)
$(call create-links,$(CURDIR)/$(PackageSourceDir),$(BuildDirectory))
# Configure the source for building.
$(BuildDirectory)/configure: $(BuildDirectory)/source $(PackageBuildMakefile)
$(Verbose)touch $@
# Build the source (there's nothing to do here).
$(BuildDirectory)/build: $(BuildDirectory)/configure
$(Verbose)touch $@
# Stage the build to a temporary installation area (there's nothing to
# do here).
$(BuildDirectory)/stage: $(BuildDirectory)/build
$(Verbose)touch $@
.PHONY: stage
stage: $(BuildDirectory)/stage
$(Verbose)$(RM) $(RMFLAGS) -r $(PackageSourceDir)
$(Verbose)$(RM) $(RMFLAGS) -r $(BuildDirectory)
include post.mak