| # | |
| # 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 BlueZ, the official Linux | |
| # Bluetooth protocol stack. | |
| # | |
| include pre.mak | |
| PackageName := bluez | |
| PackageSourceDir := repo | |
| PackageBuildMakefile = $(call GenerateBuildPaths,Makefile) | |
| CleanPaths += $(PackageLicenseFile) | |
| SOURCEDIRS = $(PackageSourceDir) | |
| $(PackageSourceDir)_RULE_TARGET = $(BuildDirectory)/configure | |
| all: $(PackageDefaultGoal) | |
| # Generate the package license contents. | |
| $(PackageSourceDir)/LICENSE: $(BuildDirectory)/source | |
| $(PackageLicenseFile): $(PackageSourceDir)/LICENSE | |
| $(copy-result) | |
| # Prepare the sources. | |
| .PHONY: source | |
| source: $(BuildDirectory)/source | |
| $(BuildDirectory)/source: | $(PackageSourceDir) $(BuildDirectory) | |
| $(Verbose)$(call create-links,$(CURDIR)/$(PackageSourceDir),$(BuildDirectory)) | |
| $(Verbose)touch $@ | |
| # Generate the package's build makefile | |
| # Configure the source for building. | |
| .PHONY: configure | |
| configure: $(BuildDirectory)/configure | |
| $(BuildDirectory)/configure: $(BuildDirectory)/source | $(PackageSourceDir) $(BuildDirectory) | |
| $(Verbose)cd $(BuildDirectory) && ./bootstrap | |
| $(Verbose)cd $(BuildDirectory) && ./configure \ | |
| CC="$(CC) $(CPPOPTFLAGS)" CXX="$(CXX) $(CPPOPTFLAGS)" AR=$(AR) NM=$(NM) RANLIB=$(RANLIB) STRIP=$(STRIP) INSTALL="$(INSTALL) $(INSTALLFLAGS)" \ | |
| CPPFLAGS="$(call ToolGenerateDefineArgument,FIRMWARE_DIR=\\\"/lib/firmware/\\\") \ | |
| $(call ToolGenerateIncludeArgument,$(LinuxIncludePath))" \ | |
| DBUS_CFLAGS="$(call ToolGenerateIncludeArgument,$(DbusIncludePaths))" \ | |
| GLIB_CFLAGS="$(call ToolGenerateIncludeArgument,$(GlibIncludePaths))" \ | |
| UDEV_CFLAGS="$(call ToolGenerateIncludeArgument,$(UdevIncludePaths))" \ | |
| DBUS_LIBS="$(call GenerateLibraryArgument,$(DbusLibraryPath))" \ | |
| GLIB_LIBS="$(call GenerateLibraryArgument,$(GlibLibraryPath))" \ | |
| UDEV_LIBS="$(call GenerateLibraryArgument,$(UdevLibraryPath))" \ | |
| PKG_CONFIG_PATH="$(GlibPkgConfigPath):$(DbusPkgConfigPath):$(UdevPkgConfigPath)" \ | |
| --build=$(HostTuple) \ | |
| --host=$(TargetTuple) \ | |
| --prefix=/usr \ | |
| --sysconfdir=/etc \ | |
| --localstatedir=/var \ | |
| --disable-cups \ | |
| --disable-monitor \ | |
| --disable-client \ | |
| --disable-systemd \ | |
| --disable-obex \ | |
| $(if $(BUILD_FEATURE_BLUEZ_LIB), --enable-library) \ | |
| $(NULL) | |
| $(Verbose)touch $@ | |
| # Build the source. | |
| # | |
| # We have to unset MAKEFLAGS since they confuse the package build otherwise. | |
| .PHONY: build | |
| build: $(BuildDirectory)/build | |
| $(BuildDirectory)/build: $(BuildDirectory)/configure | |
| $(Verbose)unset MAKEFLAGS && \ | |
| $(MAKE) $(JOBSFLAG) -C $(BuildDirectory) \ | |
| all | |
| $(Verbose)touch $@ | |
| # 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) $(JOBSFLAG) -C $(BuildDirectory) \ | |
| DESTDIR=$(ResultDirectory) \ | |
| install | |
| $(Verbose)touch $@ | |
| stage: $(BuildDirectory)/stage | |
| clean: | |
| $(Verbose)$(RM) $(RMFLAGS) -r $(BuildDirectory) | |
| $(Verbose)$(RM) $(RMFLAGS) -r $(ResultDirectory) | |
| include post.mak |