| # |
| # 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. |
| # |
| |
| |
| 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) |
| |
| WpaDbusConfSourcePath := $(PackageSourceDir)/wpa_supplicant/dbus/dbus-wpa_supplicant.conf |
| WpaDbusConfResultPath := $(call GenerateResultPaths,,$(notdir $(WpaDbusConfSourcePath))) |
| |
| SOURCEDIRS = hostap configs |
| hostap_RULE_TARGET = $(BuildDirectory)/configure |
| configs_RULE_TARGET = $(BuildDirectory)/configure |
| |
| all: $(PackageDefaultGoal) |
| |
| # Generate the package license contents. |
| |
| $(LicenseSourceFile): $(BuildDirectory)/source |
| |
| $(PackageLicenseFile): $(LicenseSourceFile) |
| $(copy-result) |
| |
| # Prepare the sources. |
| |
| $(BuildDirectory)/source: | $(PackageSourceDir) $(BuildDirectory) |
| $(Verbose)touch $@ |
| |
| # Patch the sources, if necessary. |
| |
| $(BuildDirectory)/patch: $(BuildDirectory)/source |
| $(Verbose)touch $@ |
| |
| $(PackageDefaultConfig) $(PackageBuildMakefile) $(PackageBuildSubdir): | $(PackageSourceDir) $(BuildDirectory) |
| $(call create-links,$(CURDIR)/$(PackageSourceDir),$(BuildDirectory)) |
| |
| $(PackageBuildConfig): $(PackageSourceConfig) | $(PackageBuildSubdir) |
| $(copy-result) |
| |
| # Configure the source for building. |
| |
| $(BuildDirectory)/configure: $(BuildDirectory)/source $(PackageBuildConfig) |
| $(Verbose)touch $@ |
| |
| # Build the source. |
| # |
| # We have to unset MAKEFLAGS since they confuse the package build otherwise. |
| |
| $(BuildDirectory)/build: $(BuildDirectory)/configure |
| $(Verbose)unset MAKEFLAGS && \ |
| $(MAKE) $(JOBSFLAG) -C $(PackageBuildSubdir) \ |
| INSTALL="$(INSTALL) $(INSTALLFLAGS)" \ |
| CC="$(CC) $(CPPOPTFLAGS)" CXX="$(CXX) $(CPPOPTFLAGS)" AR=$(AR) NM=$(NM) RANLIB=$(RANLIB) STRIP=$(STRIP) \ |
| DBUSCFLAGS="$(call ToolGenerateIncludeArgument,$(DbusIncludePaths))" \ |
| DBUSLDFLAGS="$(call GenerateLibraryArgument,$(DbusLibraryPath))" \ |
| DBUSVERSION=$(shell cat $(DbusSourcesPath)/dbus.version) \ |
| LINUXCFLAGS="$(call ToolGenerateIncludeArgument,$(LinuxIncludePath))" \ |
| NETLINKCFLAGS="$(call ToolGenerateIncludeArgument,$(LibNlIncludePath))" \ |
| NETLINKLDFLAGS="$(call GenerateLibraryArgument,$(LibNlLibraryPath))" \ |
| OPENSSLCFLAGS="$(call ToolGenerateIncludeArgument,$(OpenSSLIncludePath))" \ |
| OPENSSLLDFLAGS="$(call GenerateLibraryPathArgument,$(OpenSSLLibraryPaths)) $(call GenerateLibraryArgument,$(ZlibLibraryPath))" \ |
| EXTRA_PLATFORM_CFLAGS="$(EXTRA_PLATFORM_CFLAGS)" \ |
| all |
| $(Verbose)touch $@ |
| |
| # Stage the build to a temporary installation area. |
| # |
| # We have to unset MAKEFLAGS since they confuse the package build otherwise. |
| |
| .PHONY: stage |
| stage: $(BuildDirectory)/stage-default $(BuildDirectory)/stage-other |
| |
| $(BuildDirectory)/stage-default: $(BuildDirectory)/build | $(ResultDirectory) |
| $(Verbose)unset MAKEFLAGS && \ |
| $(MAKE) $(JOBSFLAG) -C $(PackageBuildSubdir) \ |
| INSTALL="$(INSTALL) $(INSTALLFLAGS)" \ |
| DBUSCFLAGS="$(call ToolGenerateIncludeArgument,$(DbusIncludePaths))" \ |
| DBUSLDFLAGS="$(call GenerateLibraryArgument,$(DbusLibraryPath))" \ |
| DBUSVERSION=$(shell cat $(DbusSourcesPath)/dbus.version) \ |
| LINUXCFLAGS="$(call ToolGenerateIncludeArgument,$(LinuxIncludePath))" \ |
| NETLINKCFLAGS="$(call ToolGenerateIncludeArgument,$(LibNlIncludePath))" \ |
| NETLINKLDFLAGS="$(call GenerateLibraryPathArgument,$(LibNlLibraryPath))" \ |
| OPENSSLCFLAGS="$(call ToolGenerateIncludeArgument,$(OpenSSLIncludePath))" \ |
| OPENSSLLDFLAGS="$(call GenerateLibraryPathArgument,$(OpenSSLLibraryPaths)) $(call GenerateLibraryArgument,$(ZlibLibraryPath))" \ |
| BINDIR=/usr/sbin \ |
| LIBDIR=/usr/lib \ |
| DESTDIR=$(ResultDirectory) \ |
| install |
| $(Verbose)touch $@ |
| |
| $(BuildDirectory)/stage-other: $(WpaDbusConfResultPath) |
| $(Verbose)touch $@ |
| |
| $(WpaDbusConfSourcePath): $(PackageSourceDir) |
| |
| $(WpaDbusConfResultPath): $(WpaDbusConfSourcePath) | $(ResultDirectory) |
| $(copy-result) |
| |
| clean: |
| $(Verbose)$(RM) $(RMFLAGS) -r $(BuildDirectory) |
| $(Verbose)$(RM) $(RMFLAGS) -r $(ResultDirectory) |
| |
| include post.mak |