Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | KERNEL_SRC ?= /lib/modules/$(shell uname -r)/build |
| 2 | |
Srinivas Girigowda | b4f780f | 2018-01-31 18:39:11 -0800 | [diff] [blame] | 3 | # The Make variable $(M) must point to the directory that contains the module |
| 4 | # source code (which includes this Makefile). It can either be an absolute or a |
| 5 | # relative path. If it is a relative path, then it must be relative to the |
| 6 | # kernel source directory (KERNEL_SRC). An absolute path can be obtained very |
| 7 | # easily through $(shell pwd). Generating a path relative to KERNEL_SRC is |
| 8 | # difficult and we accept some outside help by letting the caller override the |
| 9 | # variable $(M). Allowing a relative path for $(M) enables us to have the build |
| 10 | # system put output/object files (.o, .ko.) into a directory different from the |
| 11 | # module source directory. |
| 12 | M ?= $(shell pwd) |
| 13 | |
| 14 | # WLAN_ROOT must contain an absolute path (i.e. not a relative path) |
| 15 | KBUILD_OPTIONS := WLAN_ROOT=$(shell cd $(KERNEL_SRC); readlink -e $(M)) |
Mahesh Kumar Kalikot Veetil | 2935d25 | 2016-05-06 10:05:05 -0700 | [diff] [blame] | 16 | KBUILD_OPTIONS += MODNAME?=wlan |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 17 | |
| 18 | #By default build for CLD |
| 19 | WLAN_SELECT := CONFIG_QCA_CLD_WLAN=m |
| 20 | KBUILD_OPTIONS += CONFIG_QCA_WIFI_ISOC=0 |
| 21 | KBUILD_OPTIONS += CONFIG_QCA_WIFI_2_0=1 |
| 22 | KBUILD_OPTIONS += $(WLAN_SELECT) |
| 23 | KBUILD_OPTIONS += $(KBUILD_EXTRA) # Extra config if any |
| 24 | |
| 25 | all: |
Srinivas Girigowda | b4f780f | 2018-01-31 18:39:11 -0800 | [diff] [blame] | 26 | $(MAKE) -C $(KERNEL_SRC) M=$(M) modules $(KBUILD_OPTIONS) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 27 | |
| 28 | modules_install: |
Srinivas Girigowda | b4f780f | 2018-01-31 18:39:11 -0800 | [diff] [blame] | 29 | $(MAKE) INSTALL_MOD_STRIP=1 M=$(M) -C $(KERNEL_SRC) modules_install |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 30 | |
| 31 | clean: |
Srinivas Girigowda | b4f780f | 2018-01-31 18:39:11 -0800 | [diff] [blame] | 32 | $(MAKE) -C $(KERNEL_SRC) M=$(M) clean |