From: Jan Altensen Date: Sat, 17 Jul 2021 10:58:56 +0000 (+0200) Subject: Add makefile to build module inline X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1d430d9b797c1394953aee63d4c414e279ac3b82;p=GitHub%2FLineageOS%2FG12%2Fandroid_hardware_amlogic_kernel-modules_rtk_btusb.git Add makefile to build module inline Change-Id: I6ef1c089c31d82d2f36bede6db73e6ad53209cb6 --- diff --git a/Android.mk b/Android.mk new file mode 100644 index 0000000..0d745ef --- /dev/null +++ b/Android.mk @@ -0,0 +1,42 @@ +# +# Copyright (C) 2021 The LineageOS Project +# +# 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. +# + +LOCAL_PATH := $(call my-dir) + +ifeq ($(TARGET_PREBUILT_KERNEL),) +RTKBTUSB_PATH := $(abspath $(call my-dir)) +RTKBTUSB_CONFIGS := CONFIG_BT_RTKBTUSB=m + +include $(CLEAR_VARS) + +LOCAL_MODULE := rtk_btusb +LOCAL_MODULE_SUFFIX := .ko +LOCAL_MODULE_CLASS := ETC +LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/lib/modules + +_rtkbtusb_intermediates := $(call intermediates-dir-for,$(LOCAL_MODULE_CLASS),$(LOCAL_MODULE)) +_rtkbtusb_ko := $(_rtkbtusb_intermediates)/$(LOCAL_MODULE)$(LOCAL_MODULE_SUFFIX) +KERNEL_OUT := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ +RTKBTUSB_ABSOLUTE := $(abspath $(_rtkbtusb_intermediates)) + +$(_rtkbtusb_ko): $(KERNEL_OUT)/arch/$(KERNEL_ARCH)/boot/$(BOARD_KERNEL_IMAGE_NAME) + @mkdir -p $(dir $@) + @cp -R $(RTKBTUSB_PATH)/* $(_rtkbtusb_intermediates)/ + $(hide) +$(KERNEL_MAKE_CMD) $(PATH_OVERRIDE) $(KERNEL_MAKE_FLAGS) -C $(KERNEL_OUT) M=$(abspath $(_rtkbtusb_intermediates)) ARCH=$(TARGET_KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) $(RTKBTUSB_CONFIGS) modules + $(KERNEL_TOOLCHAIN_PATH)strip --strip-unneeded $@; + +include $(BUILD_SYSTEM)/base_rules.mk +endif