xref: /wlan-dirver/qcacld-3.0/Makefile (revision e2e3e0326e53aba9c21f89243fc46e9b48f4d74c)
17090c5fdSPrakash DhavaliKERNEL_SRC ?= /lib/modules/$(shell uname -r)/build
27090c5fdSPrakash Dhavali
3b4f780f7SSrinivas Girigowda# The Make variable $(M) must point to the directory that contains the module
4b4f780f7SSrinivas Girigowda# source code (which includes this Makefile). It can either be an absolute or a
5b4f780f7SSrinivas Girigowda# relative path. If it is a relative path, then it must be relative to the
6b4f780f7SSrinivas Girigowda# kernel source directory (KERNEL_SRC). An absolute path can be obtained very
7b4f780f7SSrinivas Girigowda# easily through $(shell pwd). Generating a path relative to KERNEL_SRC is
8b4f780f7SSrinivas Girigowda# difficult and we accept some outside help by letting the caller override the
9b4f780f7SSrinivas Girigowda# variable $(M). Allowing a relative path for $(M) enables us to have the build
10b4f780f7SSrinivas Girigowda# system put output/object files (.o, .ko.) into a directory different from the
11b4f780f7SSrinivas Girigowda# module source directory.
12b4f780f7SSrinivas GirigowdaM ?= $(shell pwd)
13b4f780f7SSrinivas Girigowda
1422505718SJeff Johnsonifeq ($(WLAN_ROOT),)
15b4f780f7SSrinivas Girigowda# WLAN_ROOT must contain an absolute path (i.e. not a relative path)
16b4f780f7SSrinivas GirigowdaKBUILD_OPTIONS := WLAN_ROOT=$(shell cd $(KERNEL_SRC); readlink -e $(M))
1753dc3b7cSSrikanth Marepalli
18*e2e3e032SSrikanth Marepalli# MODNAME should be qca_cld3_wlan for helium based wear target
19*e2e3e032SSrikanth Marepalliifeq (qca_cld3, $(WLAN_WEAR_CHIPSET))
20*e2e3e032SSrikanth MarepalliKBUILD_OPTIONS += MODNAME?=$(WLAN_WEAR_CHIPSET)_wlan
2153dc3b7cSSrikanth Marepallielse
222935d25dSMahesh Kumar Kalikot VeetilKBUILD_OPTIONS += MODNAME?=wlan
2353dc3b7cSSrikanth Marepalliendif
247090c5fdSPrakash Dhavali
257090c5fdSPrakash Dhavali#By default build for CLD
267090c5fdSPrakash DhavaliWLAN_SELECT := CONFIG_QCA_CLD_WLAN=m
277090c5fdSPrakash DhavaliKBUILD_OPTIONS += CONFIG_QCA_WIFI_ISOC=0
287090c5fdSPrakash DhavaliKBUILD_OPTIONS += CONFIG_QCA_WIFI_2_0=1
297090c5fdSPrakash DhavaliKBUILD_OPTIONS += $(WLAN_SELECT)
307090c5fdSPrakash DhavaliKBUILD_OPTIONS += $(KBUILD_EXTRA) # Extra config if any
3122505718SJeff Johnsonendif
327090c5fdSPrakash Dhavali
337090c5fdSPrakash Dhavaliall:
34b4f780f7SSrinivas Girigowda	$(MAKE) -C $(KERNEL_SRC) M=$(M) modules $(KBUILD_OPTIONS)
357090c5fdSPrakash Dhavali
367090c5fdSPrakash Dhavalimodules_install:
37b4f780f7SSrinivas Girigowda	$(MAKE) INSTALL_MOD_STRIP=1 M=$(M) -C $(KERNEL_SRC) modules_install
387090c5fdSPrakash Dhavali
397090c5fdSPrakash Dhavaliclean:
4099f4994cSNirav Shah	$(MAKE) -C $(KERNEL_SRC) M=$(M) clean $(KBUILD_OPTIONS)
41