| # |
| # 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 for wpa_supplicant, a free software |
| # implementation of an IEEE 802.11i security supplicant for |
| # Linux, FreeBSD, NetBSD and Microsoft Windows. |
| # |
| |
| BuildConfigSpecialized := No |
| BuildProductSpecialized := No |
| |
| include pre.mak |
| |
| PackageRoot := . |
| |
| PackageName := hostap |
| |
| PackageSeparator := |
| |
| PackageSourceDir := $(PackageRoot)/$(PackageName) |
| |
| PackageBuildSubdir := $(BuildDirectory)/wpa_supplicant |
| |
| PackageConfigDir := configs |
| PackageProductConfig := $(PackageConfigDir)/$(BuildProduct)/defconfig |
| PackageSiteConfig := $(PackageConfigDir)/defconfig |
| PackageDefaultConfig := $(PackageBuildSubdir)/defconfig |
| |
| PackageSiteConfig := $(if $(wildcard $(PackageProductConfig)),$(PackageProductConfig),$(wildcard $(PackageSiteConfig))) |
| |
| PackageSourceConfig := $(if $(PackageSiteConfig),$(PackageSiteConfig),$(PackageDefaultConfig)) |
| PackageBuildConfig := $(PackageBuildSubdir)/.config |
| |
| PackageBuildMakefile = $(call GenerateBuildPaths,Makefile) |
| |
| LicenseSourceFile := $(PackageSourceDir)/COPYING |
| |
| CleanPaths += $(PackageLicenseFile) |
| |
| DbusDir := sw/tps/dbus |
| DbusIncDirs := $(call GenerateResultPaths,$(DbusDir),usr/include/dbus-1.0 usr/lib/dbus-1.0/include) |
| DbusLibDir := $(call GenerateResultPaths,$(DbusDir),usr/lib) |
| |
| LinuxDir := sw/tps/linux |
| LinuxIncDir := $(call GenerateResultPaths,$(LinuxDir),include) |
| |
| NetlinkDir := sw/tps/libnl |
| NetlinkIncDir := $(call GenerateResultPaths,$(NetlinkDir),usr/include) |
| NetlinkLibDir := $(call GenerateResultPaths,$(NetlinkDir),usr/lib) |
| |
| OpenSSLDir := sw/tps/openssl |
| OpenSSLIncDir := $(call GenerateResultPaths,$(OpenSSLDir),usr/include) |
| OpenSSLLibDir := $(call GenerateResultPaths,$(OpenSSLDir),usr/lib) |
| |
| ZlibDir := sw/tps/zlib |
| ZlibIncDir := $(call GenerateResultPaths,$(ZlibDir),usr/include) |
| ZlibLibDir := $(call GenerateResultPaths,$(ZlibDir),usr/lib) |
| |
| WpaDbusConfSourcePath := $(PackageSourceDir)/wpa_supplicant/dbus/dbus-wpa_supplicant.conf |
| WpaDbusConfResultPath := $(call GenerateResultPaths,,$(notdir $(WpaDbusConfSourcePath))) |
| |
| all: $(PackageDefaultGoal) |
| |
| # Generate the package license contents. |
| |
| $(LicenseSourceFile): source |
| |
| $(PackageLicenseFile): $(LicenseSourceFile) |
| $(copy-result) |
| |
| # We are building this package from version-controlled source, so |
| # there is nothing to do for this target goal. |
| |
| $(PackageSourceDir): |
| |
| # Prepare the sources. |
| |
| .PHONY: source |
| source: | $(PackageSourceDir) |
| |
| # Patch the sources, if necessary. |
| |
| .PHONY: patch |
| patch: source |
| |
| $(PackageDefaultConfig) $(PackageBuildMakefile) $(PackageBuildSubdir): | $(PackageSourceDir) $(BuildDirectory) |
| $(call create-links,$(CURDIR)/$(PackageSourceDir),$(BuildDirectory)) |
| |
| $(PackageBuildConfig): $(PackageSourceConfig) | $(PackageBuildSubdir) |
| $(copy-result) |
| |
| # Configure the source for building. |
| |
| .PHONY: configure |
| configure: source $(PackageBuildConfig) |
| |
| # Build the source. |
| # |
| # We have to unset MAKEFLAGS since they confuse the package build otherwise. |
| |
| .PHONY: build |
| build: configure |
| $(Verbose)unset MAKEFLAGS && \ |
| $(MAKE) -C $(PackageBuildSubdir) \ |
| CC=$(CC) CXX=$(CXX) AR=$(AR) NM=$(NM) RANLIB=$(RANLIB) STRIP=$(STRIP) \ |
| DBUSCFLAGS="$(call ToolGenerateIncludeArgument,$(DbusIncDirs))" \ |
| DBUSLDFLAGS="-L$(DbusLibDir) -ldbus-1" \ |
| DBUSVERSION=$(shell cat $(BuildRoot)/$(DbusDir)/dbus.version) \ |
| LINUXCFLAGS="$(call ToolGenerateIncludeArgument,$(LinuxIncDir))" \ |
| NETLINKCFLAGS="$(call ToolGenerateIncludeArgument,$(NetlinkIncDir))" \ |
| NETLINKLDFLAGS="-L$(NetlinkLibDir) -lnl -lnl-genl" \ |
| OPENSSLCFLAGS="-I$(OpenSSLIncDir)" \ |
| OPENSSLLDFLAGS="-L$(OpenSSLLibDir) -L$(ZlibLibDir) -lz" \ |
| all |
| |
| # Stage the build to a temporary installation area. |
| # |
| # We have to unset MAKEFLAGS since they confuse the package build otherwise. |
| |
| .PHONY: stage |
| stage: stage-default stage-other |
| |
| .PHONY: stage-default |
| stage-default: build | $(ResultDirectory) |
| $(Verbose)unset MAKEFLAGS && \ |
| $(MAKE) -C $(PackageBuildSubdir) \ |
| DBUSCFLAGS="$(call ToolGenerateIncludeArgument,$(DbusIncDirs))" \ |
| DBUSLDFLAGS="-L$(DbusLibDir) -ldbus-1" \ |
| DBUSVERSION=$(shell cat $(BuildRoot)/$(DbusDir)/dbus.version) \ |
| LINUXCFLAGS="$(call ToolGenerateIncludeArgument,$(LinuxIncDir))" \ |
| NETLINKCFLAGS="$(call ToolGenerateIncludeArgument,$(NetlinkIncDir))" \ |
| NETLINKLDFLAGS="-L$(NetlinkLibDir)" \ |
| OPENSSLCFLAGS="-I$(OpenSSLIncDir)" \ |
| OPENSSLLDFLAGS="-L$(OpenSSLLibDir) -L$(ZlibLibDir) -lz" \ |
| BINDIR=/usr/sbin \ |
| LIBDIR=/usr/lib \ |
| DESTDIR=$(ResultDirectory) \ |
| install |
| |
| .PHONY: stage-other |
| stage-other: $(WpaDbusConfResultPath) |
| |
| $(WpaDbusConfSourcePath): build |
| |
| $(WpaDbusConfResultPath): $(WpaDbusConfSourcePath) | $(ResultDirectory) |
| $(copy-result) |
| |
| clean: |
| $(Verbose)$(RM) $(RMFLAGS) -r $(BuildDirectory) |
| $(Verbose)$(RM) $(RMFLAGS) -r $(ResultDirectory) |
| |
| include post.mak |