blob: 1944d1645e4bf2cd9679de4c7613f9fd8052ecfd [file] [log] [blame]
#
# 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)
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)))
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)
# We are building this package from version-controlled source, so
# there is nothing to do for this target goal.
$(PackageSourceDir):
# 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 $@
# Add in extra required feature based defines
ifeq ($(BUILD_FEATURE_WIFI_BCM),1)
EXTRA_PLATFORM_CFLAGS = -DCONFIG_ALWAYS_UP
endif
# 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)" 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" \
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,$(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
$(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