Commit | Line | Data |
---|---|---|
ff95a8eb AK |
1 | # |
2 | # Copyright (C) 2021 The LineageOS Project | |
3 | # | |
4 | # Licensed under the Apache License, Version 2.0 (the "License"); | |
5 | # you may not use this file except in compliance with the License. | |
6 | # You may obtain a copy of the License at | |
7 | # | |
8 | # http://www.apache.org/licenses/LICENSE-2.0 | |
9 | # | |
10 | # Unless required by applicable law or agreed to in writing, software | |
11 | # distributed under the License is distributed on an "AS IS" BASIS, | |
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | # See the License for the specific language governing permissions and | |
14 | # limitations under the License. | |
15 | # | |
16 | ||
17 | LOCAL_PATH := $(call my-dir) | |
18 | ||
19 | ifeq ($(TARGET_PREBUILT_KERNEL),) | |
20 | RTL8822CS_PATH := $(abspath $(call my-dir))/rtl88x2CS | |
21 | RTL8822CS_CONFIGS := CONFIG_RTL8822CS=m | |
22 | ||
23 | include $(CLEAR_VARS) | |
24 | ||
25 | LOCAL_MODULE := 8822cs | |
26 | LOCAL_MODULE_SUFFIX := .ko | |
27 | LOCAL_MODULE_CLASS := ETC | |
28 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/lib/modules | |
29 | ||
30 | _rtl8822cs_intermediates := $(call intermediates-dir-for,$(LOCAL_MODULE_CLASS),$(LOCAL_MODULE)) | |
31 | _rtl8822cs_ko := $(_rtl8822cs_intermediates)/$(LOCAL_MODULE)$(LOCAL_MODULE_SUFFIX) | |
32 | KERNEL_OUT := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ | |
33 | ||
34 | $(_rtl8822cs_ko): $(KERNEL_OUT)/arch/$(KERNEL_ARCH)/boot/$(BOARD_KERNEL_IMAGE_NAME) | |
35 | @mkdir -p $(dir $@) | |
36 | @cp -R $(RTL8822CS_PATH)/* $(_rtl8822cs_intermediates)/ | |
37 | $(hide) +$(KERNEL_MAKE_CMD) $(PATH_OVERRIDE) $(KERNEL_MAKE_FLAGS) -C $(KERNEL_OUT) M=$(abspath $(_rtl8822cs_intermediates)) ARCH=$(TARGET_KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) $(RTL8822CS_CONFIGS) modules | |
38 | $(KERNEL_TOOLCHAIN_PATH)strip --strip-unneeded $@; | |
39 | ||
40 | include $(BUILD_SYSTEM)/base_rules.mk | |
41 | endif |