|  | # | 
|  | #    Copyright (c) 2016 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 nl-unit-test. | 
|  | # | 
|  |  | 
|  | include pre.mak | 
|  |  | 
|  | PackageRoot               := . | 
|  |  | 
|  | PackageName               := nl-unit-test | 
|  |  | 
|  | PackageSeparator          := | 
|  |  | 
|  | PackageSourceDir          := $(PackageRoot)/$(PackageName) | 
|  |  | 
|  | PackageBuildMakefile       = $(call GenerateBuildPaths,Makefile) | 
|  |  | 
|  | SOURCEDIRS                      = $(PackageSourceDir) | 
|  | $(PackageSourceDir)_RULE_TARGET = $(BuildDirectory)/configure | 
|  |  | 
|  | SOURCEDIRS           = nl-unit-test | 
|  | $(PackageName)_RULE_TARGET = $(PackageBuildMakefile) | 
|  |  | 
|  |  | 
|  | #ResultDirectory := $(ResultDirectory)/nl-unit-test | 
|  |  | 
|  | all: $(PackageDefaultGoal) | 
|  |  | 
|  | # Generate the package license contents. | 
|  |  | 
|  | $(PackageSourceDir)/COPYING: $(BuildDirectory)/source | 
|  |  | 
|  | $(PackageLicenseFile): $(PackageSourceDir)/COPYING | 
|  | $(copy-result) | 
|  |  | 
|  |  | 
|  | # Prepare the sources. | 
|  |  | 
|  | $(BuildDirectory)/source: | $(PackageSourceDir) | 
|  | $(Verbose)touch $(BuildDirectory)/source | 
|  |  | 
|  | # Patch the sources, if necessary. | 
|  |  | 
|  | $(BuildDirectory)/patch: $(BuildDirectory)/source | 
|  | $(Verbose)touch $(BuildDirectory)/patch | 
|  |  | 
|  | # Generate the package build makefile. | 
|  |  | 
|  | $(PackageBuildMakefile): | $(PackageSourceDir) $(BuildDirectory) $(ResultDirectory) | 
|  | $(Verbose)cd $(BuildDirectory) && \ | 
|  | $(LOGCURDIR)/$(PackageSourceDir)/configure \ | 
|  | CC="$(CC) $(CPPOPTFLAGS)" CXX="$(CXX) $(CPPOPTFLAGS)" \ | 
|  | CPPFLAGS="$(call ToolGenerateIncludeArgument,$(LinuxIncludePath))" \ | 
|  | --build=$(HostTuple) 	\ | 
|  | --host=$(TargetTuple) 	\ | 
|  | --prefix='' | 
|  |  | 
|  | # Configure the source for building. | 
|  |  | 
|  | $(BuildDirectory)/configure: $(BuildDirectory)/source $(PackageBuildMakefile) | 
|  | $(Verbose)touch $(BuildDirectory)/configure | 
|  |  | 
|  | # Build the source. | 
|  | # | 
|  | # We have to unset MAKEFLAGS since they confuse the package build otherwise. | 
|  |  | 
|  | $(BuildDirectory)/build: $(BuildDirectory)/configure | 
|  | $(Verbose)unset MAKEFLAGS && \ | 
|  | $(MAKE) -C $(BuildDirectory) \ | 
|  | all | 
|  | $(Verbose)touch $(BuildDirectory)/build | 
|  |  | 
|  | # Stage the build to a temporary installation area. | 
|  | # | 
|  | # We have to unset MAKEFLAGS since they confuse the package build otherwise. | 
|  |  | 
|  | $(BuildDirectory)/stage: $(BuildDirectory)/build | $(ResultDirectory) | 
|  | $(Verbose)unset MAKEFLAGS && \ | 
|  | $(MAKE) -C $(BuildDirectory) \ | 
|  | DESTDIR=$(ResultDirectory) \ | 
|  | install | 
|  | $(Verbose)touch $(BuildDirectory)/stage | 
|  |  | 
|  | .PHONY: stage | 
|  | stage: $(BuildDirectory)/stage | 
|  |  | 
|  | clean: | 
|  | $(Verbose)$(RM) $(RMFLAGS) -r $(BuildDirectory) | 
|  | $(Verbose)$(RM) $(RMFLAGS) -r $(ResultDirectory) | 
|  |  | 
|  | include post.mak |