1*5113495bSYour NameKERNEL_SRC ?= /lib/modules/$(shell uname -r)/build 2*5113495bSYour Name 3*5113495bSYour Name# The Make variable $(M) must point to the directory that contains the module 4*5113495bSYour Name# source code (which includes this Makefile). It can either be an absolute or a 5*5113495bSYour Name# relative path. If it is a relative path, then it must be relative to the 6*5113495bSYour Name# kernel source directory (KERNEL_SRC). An absolute path can be obtained very 7*5113495bSYour Name# easily through $(shell pwd). Generating a path relative to KERNEL_SRC is 8*5113495bSYour Name# difficult and we accept some outside help by letting the caller override the 9*5113495bSYour Name# variable $(M). Allowing a relative path for $(M) enables us to have the build 10*5113495bSYour Name# system put output/object files (.o, .ko.) into a directory different from the 11*5113495bSYour Name# module source directory. 12*5113495bSYour NameM ?= $(shell pwd) 13*5113495bSYour Name 14*5113495bSYour Nameifeq ($(WLAN_ROOT),) 15*5113495bSYour Name# WLAN_ROOT must contain an absolute path (i.e. not a relative path) 16*5113495bSYour NameKBUILD_OPTIONS := WLAN_ROOT=$(shell cd $(KERNEL_SRC); readlink -e $(M)) 17*5113495bSYour Name 18*5113495bSYour Name# MODNAME should be qca_cld3_wlan for helium based wear target 19*5113495bSYour Nameifeq (qca_cld3, $(WLAN_WEAR_CHIPSET)) 20*5113495bSYour NameKBUILD_OPTIONS += MODNAME?=$(WLAN_WEAR_CHIPSET)_wlan 21*5113495bSYour Nameelse 22*5113495bSYour NameKBUILD_OPTIONS += MODNAME?=wlan 23*5113495bSYour Nameendif 24*5113495bSYour Name 25*5113495bSYour Name#By default build for CLD 26*5113495bSYour NameWLAN_SELECT := CONFIG_QCA_CLD_WLAN=m 27*5113495bSYour NameKBUILD_OPTIONS += CONFIG_QCA_WIFI_ISOC=0 28*5113495bSYour NameKBUILD_OPTIONS += CONFIG_QCA_WIFI_2_0=1 29*5113495bSYour NameKBUILD_OPTIONS += $(WLAN_SELECT) 30*5113495bSYour NameKBUILD_OPTIONS += $(KBUILD_EXTRA) # Extra config if any 31*5113495bSYour Nameendif 32*5113495bSYour Name 33*5113495bSYour Nameall: 34*5113495bSYour Name $(MAKE) -C $(KERNEL_SRC) M=$(M) modules $(KBUILD_OPTIONS) 35*5113495bSYour Name 36*5113495bSYour Namemodules_install: 37*5113495bSYour Name $(MAKE) INSTALL_MOD_STRIP=1 M=$(M) -C $(KERNEL_SRC) modules_install 38*5113495bSYour Name 39*5113495bSYour Nameclean: 40*5113495bSYour Name $(MAKE) -C $(KERNEL_SRC) M=$(M) clean $(KBUILD_OPTIONS) 41