Makefile 1.5 KB

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