blob: eeed072644aab8e49379cc139df0f348d8f4a8d4 [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 the Ext2 File System utilities
# libraries, an important one of which is the Universally Unique
# Identifier (UUID) library.
#
include pre.mak
LinkAgainstCPlusPlus := Yes
PackageName := grpc
PackageExtension := tar.gz
PackageSeparator := -
PackagePatchArgs := -p1
PackageArchive := $(PackageName).$(PackageExtension)
PackageSourceDir := $(PackageName)$(PackageSeparator)$(PackageVersion)
PackageBuildMakefile = $(call GenerateBuildPaths,Makefile)
PackageResultPath = $(call GenerateResultPaths,,usr)
CleanPaths += $(PackageLicenseFile)
SOURCEDIRS = $(PackageSourceDir)
$(PackageSourceDir)_RULE_TARGET = $(BuildDirectory)/configure
all: $(PackageDefaultGoal)
# Generate the package license contents.
$(PackageLicensePaths): $(BuildDirectory)/source
$(PackageSourceDir)/COPYING: $(BuildDirectory)/source
$(PackageLicenseFile): $(PackageSourceDir)/COPYING
$(copy-result)
# Extract the source from the archive and apply patches, if any.
$(PackageSourceDir): $(PackageArchive) $(PackagePatchPaths)
$(expand-and-patch-package)
# Prepare the sources.
.PHONY: source
source: $(BuildDirectory)/source
$(BuildDirectory)/source: | $(PackageSourceDir) $(BuildDirectory)
$(Verbose)touch $@
# Patch the sources, if necessary.
.PHONY: patch
patch: $(BuildDirectory)/patch
$(BuildDirectory)/patch: $(BuildDirectory)/source | $(BuildDirectory)
$(Verbose)touch $@
$(PackageBuildMakefile): | $(PackageSourceDir) $(BuildDirectory)
$(Verbose)$(call create-links,$(CURDIR)/$(PackageSourceDir),$(BuildDirectory))
# Configure the source for building.
.PHONY: configure
configure: $(BuildDirectory)/configure
$(BuildDirectory)/configure: $(BuildDirectory)/source $(PackageBuildMakefile) | $(BuildDirectory)
$(Verbose)touch $@
# Build the source.
#
# We have to unset MAKEFLAGS since they confuse the package build otherwise.
ProtobufSrcBuildDir = $(subst PackageBuildSrcDir=,,$(filter PackageBuildSrcDir=%,$(shell $(MAKE) BuildProduct=$(BuildProduct) BuildConfig=$(BuildConfig) -f $(ProtobufHostMakefile) print-PackageBuildSrcDir)))
GrpcPluginHostResultPath = $(subst GrpcBinaryPath=,,$(filter GrpcBinaryPath=%,$(shell $(MAKE) BuildProduct=$(BuildProduct) BuildConfig=$(BuildConfig) -f $(GrpcHostMakefile) print-GrpcBinaryPath)))
.PHONY: build
build: $(BuildDirectory)/build
$(BuildDirectory)/build: $(BuildDirectory)/configure | $(BuildDirectory)
$(Verbose)unset MAKEFLAGS && \
export PKG_CONFIG_PATH="$(ZlibPkgConfigPath):$(ProtobufPkgConfigPath):$(OpenSSLPkgConfigPath)" && \
export $(LoaderSearchPath)=$(ProtocLibraryHostResultPath) && \
export PATH="$(ProtocExecutableHostResultPath):$(PATH)" && \
export CPPFLAGS="$(call ToolGenerateIncludeArgument,$(LinuxIncludePath))" && \
$(MAKE) $(JOBSFLAG) -C $(BuildDirectory) \
CC="$(CC) $(CPPOPTFLAGS)" CXX="$(CXX) $(CPPOPTFLAGS)" LD="$(LD)" LDXX="$(LD)" AR="$(AR) $(ARFLAGS)" RANLIB="$(RANLIB)" STRIP="$(STRIP)" V=1 \
prefix=$(PackageResultPath) \
PROTOBUF_SRC_DIR="$(ProtobufSrcBuildDir)" \
PROTOC_PLUGINS_DIR="$(GrpcPluginHostResultPath)" \
all
$(Verbose)touch $@
# Stage the build to a temporary installation area.
.PHONY: stage
stage: $(BuildDirectory)/stage
$(BuildDirectory)/stage: $(BuildDirectory)/build | $(ResultDirectory) $(BuildDirectory)
$(Verbose)unset MAKEFLAGS && \
export PKG_CONFIG_PATH="$(ZlibPkgConfigPath):$(ProtobufPkgConfigPath):$(OpenSSLPkgConfigPath)" && \
$(MAKE) $(JOBSFLAG) -C $(BuildDirectory) \
CC="$(CC) $(CPPOPTFLAGS)" CXX="$(CXX) $(CPPOPTFLAGS)" LD="$(LD)" LDXX="$(LD)" AR="$(AR) $(ARFLAGS)" RANLIB="$(RANLIB)" STRIP="$(STRIP)" V=1 \
INSTALL="$(INSTALL) $(INSTALLFLAGS)" \
prefix=$(PackageResultPath) \
PROTOBUF_SRC_DIR="$(ProtobufSrcBuildDir)" \
PROTOC_PLUGINS_DIR="$(GrpcPluginHostResultPath)" \
install
$(Verbose)touch $@
clean:
$(Verbose)$(RM) $(RMFLAGS) -r $(PackageSourceDir)
$(Verbose)$(RM) $(RMFLAGS) -r $(BuildDirectory)
$(Verbose)$(RM) $(RMFLAGS) -r $(ResultDirectory)
include post.mak