-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathAndroid.mk
62 lines (47 loc) · 2.09 KB
/
Android.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#
# Copyright (C) 2008 Broadcom Corporation
#
# $Id: Android.mk,v 2.6 2009-05-07 18:25:15 Exp $
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
ifeq ($(BOARD_WLAN_BROADCOM),true)
LOCAL_PATH:= $(call my-dir)
ifneq ($(TARGET_BOARD_PLATFORM),)
#Build BCM4330 Driver
include $(call all-subdir-makefiles)
include $(CLEAR_VARS)
SRC_MAIN := dhd/linux
SAVED_LOCAL_PATH := $(LOCAL_PATH)
LOCAL_PATH_ABS := $(shell cd $(SAVED_LOCAL_PATH) && pwd)
BUILD_ROOT := $(ANDROID_PRODUCT_OUT)/obj/BCM4330_DRV
BCM_MODULE := $(BUILD_ROOT)/$(SRC_MAIN)/dhd-android/bcm4330.ko
BUILD_SUBDIRS := $(shell cd $(SAVED_LOCAL_PATH) && find . -type d)
BUILD_SRC := $(shell cd $(SAVED_LOCAL_PATH) && find . -name \*[ch])
BUILD_MK := $(shell cd $(SAVED_LOCAL_PATH) && find . -name \*[Mm]akefile\*)
BUILD_MK += $(shell cd $(SAVED_LOCAL_PATH) && find . -name [Mm]akerules\*)
REL_SUBDIRS := $(addprefix $(SAVED_LOCAL_PATH)/, $(BUILD_SUBDIRS))
REL_SRC := $(addprefix $(SAVED_LOCAL_PATH)/, $(BUILD_SRC))
REL_MK := $(addprefix $(SAVED_LOCAL_PATH)/, $(BUILD_MK))
$(BCM_MODULE): $(PRODUCT_OUT)/kernel prep
@(cd $(BUILD_ROOT)/$(SRC_MAIN); $(MAKE) -f Makefile; mv $(BCM_MODULE) $(KERNEL_MODULES_OUT))
prep: subdirs src mk
subdirs: $(REL_SUBDIRS)
@(for i in $(BUILD_SUBDIRS); do mkdir -p $(BUILD_ROOT)/$$i; done)
src: $(REL_SRC) subdirs
@(for i in $(BUILD_SRC); do test -e $(BUILD_ROOT)/$$i || ln -sf $(LOCAL_PATH_ABS)/$$i $(BUILD_ROOT)/$$i; done)
mk: $(REL_MK) subdirs
@(for i in $(BUILD_MK); do test -e $(BUILD_ROOT)/$$i || ln -sf $(LOCAL_PATH_ABS)/$$i $(BUILD_ROOT)/$$i; done)
TARGET_KERNEL_MODULES := $(BCM_MODULE)
endif # ifneq ($(TARGET_BOARD_PLATFORM),)
endif