• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#===============================================================================
2# export variables
3#===============================================================================
4ifeq ($(CFG_HI_EXPORT_FLAG),)
5    ifneq ($(srctree),)
6    KERNEL_DIR := $(srctree)
7
8    SDK_DIR := $(shell cd $(KERNEL_DIR)/../../.. && /bin/pwd)
9    else
10    SDK_DIR := $(shell cd $(CURDIR)/../../../.. && /bin/pwd)
11    endif
12    include $(SDK_DIR)/base.mak
13endif
14
15#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16#   variable
17#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
18objects :=
19
20ifeq ($(CFG_HI_BT_DEVICE_REALTEK),y)
21objects += rtkbt/driver
22endif
23
24ifeq ($(CFG_HI_BT_DEVICE_MT7668U),y)
25objects += mt7668u/driver
26endif
27
28ifneq ($(objects),)
29obj-y += $(addsuffix /,$(objects))
30else
31$(error "If bluetooth support, you must choose one bluetooth device at least!!")
32endif
33
34objects_clean:=$(addsuffix _clean,$(objects))
35objects_install:=$(addsuffix _install,$(objects))
36objects_uninstall:=$(addsuffix _uninstall,$(objects))
37
38#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
39#   rules
40#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
41
42#==================================================================
43#                          all
44#==================================================================
45.PHONY: all clean install uninstall
46all: $(objects)
47
48clean: $(objects_clean)
49
50install: $(objects_install)
51
52uninstall: $(objects_uninstall)
53
54#==================================================================
55#                          modules
56#==================================================================
57.PHONY: $(objects) $(objects_clean) $(objects_install) $(objects_uninstall)
58
59$(objects):
60	make -C $@ all
61
62$(objects_clean):
63	make -C $(patsubst %_clean,%,$@) clean
64
65$(objects_install):
66	make -C $(patsubst %_install,%,$@) install
67
68$(objects_uninstall):
69	make -C $(patsubst %_uninstall,%,$@) uninstall
70