Add makefile to build module inline lineage-18.1 lineage-19.1 lineage-20 lineage-21 lineage-22.0
authorAaron Kling <webgeek1234@gmail.com>
Thu, 24 Jun 2021 20:25:18 +0000 (15:25 -0500)
committerNolen Johnson <johnsonnolen@gmail.com>
Fri, 30 Jul 2021 22:55:30 +0000 (18:55 -0400)
Android.mk [new file with mode: 0644]

diff --git a/Android.mk b/Android.mk
new file mode 100644 (file)
index 0000000..6157196
--- /dev/null
@@ -0,0 +1,41 @@
+#
+# 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),)
+RTL8822BS_PATH    := $(abspath $(call my-dir))
+RTL8822BS_CONFIGS := CONFIG_RTL8822BS=m
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE        := 8822bs
+LOCAL_MODULE_SUFFIX := .ko
+LOCAL_MODULE_CLASS  := ETC
+LOCAL_MODULE_PATH   := $(TARGET_OUT_VENDOR)/lib/modules
+
+_rtl8822bs_intermediates := $(call intermediates-dir-for,$(LOCAL_MODULE_CLASS),$(LOCAL_MODULE))
+_rtl8822bs_ko := $(_rtl8822bs_intermediates)/$(LOCAL_MODULE)$(LOCAL_MODULE_SUFFIX)
+KERNEL_OUT := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ
+
+$(_rtl8822bs_ko): $(KERNEL_OUT)/arch/$(KERNEL_ARCH)/boot/$(BOARD_KERNEL_IMAGE_NAME)
+       @mkdir -p $(dir $@)
+       @cp -R $(RTL8822BS_PATH)/* $(_rtl8822bs_intermediates)/
+       $(hide) +$(KERNEL_MAKE_CMD) $(PATH_OVERRIDE) $(KERNEL_MAKE_FLAGS) -C $(KERNEL_OUT) M=$(abspath $(_rtl8822bs_intermediates)) ARCH=$(TARGET_KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) $(RTL8822BS_CONFIGS) modules
+       $(KERNEL_TOOLCHAIN_PATH)strip --strip-unneeded $@;
+
+include $(BUILD_SYSTEM)/base_rules.mk
+endif