Created
September 2, 2018 20:40
-
-
Save MartijnBraam/c45b4a3330c76ebbdcdeace97eb0f293 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Makefile b/Makefile | |
index f7e5680..9f07699 100644 | |
--- a/Makefile | |
+++ b/Makefile | |
@@ -192,8 +192,13 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \ | |
# "make" in the configured kernel build directory always uses that. | |
# Default value for CROSS_COMPILE is not to prefix executables | |
# Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile | |
-ARCH ?= $(SUBARCH) | |
-CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%) | |
+#ARCH ?= $(SUBARCH) | |
+CROSS_COMPILE ?= arm-linux-androideabi- | |
+ARCH ?= arm | |
+ifeq ($(MTK_K64_SUPPORT),yes) | |
+ ARCH := arm64 | |
+ CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%) | |
+endif | |
# Architecture as present in compile.h | |
UTS_MACHINE := $(ARCH) | |
@@ -381,6 +386,13 @@ KBUILD_AFLAGS_MODULE := -DMODULE | |
KBUILD_CFLAGS_MODULE := -DMODULE | |
KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds | |
+-include $(srctree)/$(MTK_PROJECT)_mtk_cust.mak | |
+#MTK_INC += -I$(MTK_ROOT_CUSTOM)/$(MTK_PROJECT)/common | |
+LINUXINCLUDE += $(MTK_INC) | |
+KBUILD_CFLAGS += $(MTK_CFLAGS) $(MTK_CDEFS) -fno-pic | |
+KBUILD_CPPFLAGS += $(MTK_CPPFLAGS) $(MTK_CPPDEFS) | |
+KBUILD_AFLAGS += $(MTK_AFLAGS) $(MTK_ADEFS) | |
+ | |
# Read KERNELRELEASE from include/config/kernel.release (if it exists) | |
KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) | |
KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION) | |
@@ -589,6 +601,7 @@ KBUILD_CFLAGS += $(call cc-option,-fno-reorder-blocks,) \ | |
endif | |
ifneq ($(CONFIG_FRAME_WARN),0) | |
+KBUILD_CFLAGS += $(call cc-option,-Werror=frame-larger-than=1) | |
KBUILD_CFLAGS += $(call cc-option,-Wframe-larger-than=${CONFIG_FRAME_WARN}) | |
endif | |
@@ -615,7 +628,7 @@ endif | |
endif | |
ifdef CONFIG_DEBUG_INFO | |
-KBUILD_CFLAGS += -g | |
+KBUILD_CFLAGS += -gdwarf-2 | |
KBUILD_AFLAGS += -gdwarf-2 | |
endif | |
@@ -638,6 +651,51 @@ ifdef CONFIG_DYNAMIC_FTRACE | |
endif | |
endif | |
+#[LY28] ==> CCI KLog, added by Jimmy@CCI | |
+ifdef CONFIG_CCI_KLOG | |
+ KBUILD_CFLAGS += -DCCI_KLOG=y | |
+ ifdef CONFIG_CCI_KLOG_START_ADDR_PHYSICAL | |
+ KBUILD_CFLAGS += -DCCI_KLOG_START_ADDR_PHYSICAL=$(CONFIG_CCI_KLOG_START_ADDR_PHYSICAL) | |
+ endif # ifdef CONFIG_CCI_KLOG_START_ADDR_PHYSICAL | |
+ ifdef CONFIG_CCI_KLOG_SIZE | |
+ KBUILD_CFLAGS += -DCCI_KLOG_SIZE=$(CONFIG_CCI_KLOG_SIZE) | |
+ endif # ifdef CONFIG_CCI_KLOG_SIZE | |
+ ifdef CONFIG_CCI_KLOG_HEADER_SIZE | |
+ KBUILD_CFLAGS += -DCCI_KLOG_HEADER_SIZE=$(CONFIG_CCI_KLOG_HEADER_SIZE) | |
+ endif # ifdef CONFIG_CCI_KLOG_HEADER_SIZE | |
+ ifdef CONFIG_CCI_KLOG_CRASH_SIZE | |
+ KBUILD_CFLAGS += -DCCI_KLOG_CRASH_SIZE=$(CONFIG_CCI_KLOG_CRASH_SIZE) | |
+ endif # ifdef CONFIG_CCI_KLOG_CRASH_SIZE | |
+ ifdef CONFIG_CCI_KLOG_APPSBL_SIZE | |
+ KBUILD_CFLAGS += -DCCI_KLOG_APPSBL_SIZE=$(CONFIG_CCI_KLOG_APPSBL_SIZE) | |
+ endif # ifdef CONFIG_CCI_KLOG_APPSBL_SIZE | |
+ ifdef CONFIG_CCI_KLOG_KERNEL_SIZE | |
+ KBUILD_CFLAGS += -DCCI_KLOG_KERNEL_SIZE=$(CONFIG_CCI_KLOG_KERNEL_SIZE) | |
+ endif # ifdef CONFIG_CCI_KLOG_KERNEL_SIZE | |
+ ifdef CONFIG_CCI_KLOG_ANDROID_MAIN_SIZE | |
+ KBUILD_CFLAGS += -DCCI_KLOG_ANDROID_MAIN_SIZE=$(CONFIG_CCI_KLOG_ANDROID_MAIN_SIZE) | |
+ endif # ifdef CONFIG_CCI_KLOG_ANDROID_MAIN_SIZE | |
+ ifdef CONFIG_CCI_KLOG_ANDROID_SYSTEM_SIZE | |
+ KBUILD_CFLAGS += -DCCI_KLOG_ANDROID_SYSTEM_SIZE=$(CONFIG_CCI_KLOG_ANDROID_SYSTEM_SIZE) | |
+ endif # ifdef CONFIG_CCI_KLOG_ANDROID_SYSTEM_SIZE | |
+ ifdef CONFIG_CCI_KLOG_ANDROID_RADIO_SIZE | |
+ KBUILD_CFLAGS += -DCCI_KLOG_ANDROID_RADIO_SIZE=$(CONFIG_CCI_KLOG_ANDROID_RADIO_SIZE) | |
+ endif # ifdef CONFIG_CCI_KLOG_ANDROID_RADIO_SIZE | |
+ ifdef CONFIG_CCI_KLOG_ANDROID_EVENTS_SIZE | |
+ KBUILD_CFLAGS += -DCCI_KLOG_ANDROID_EVENTS_SIZE=$(CONFIG_CCI_KLOG_ANDROID_EVENTS_SIZE) | |
+ endif # ifdef CONFIG_CCI_KLOG_ANDROID_EVENTS_SIZE | |
+ ifdef CONFIG_CCI_KLOG_SUPPORT_CCI_ENGMODE | |
+ KBUILD_CFLAGS += -DCCI_KLOG_SUPPORT_CCI_ENGMODE=y | |
+ endif # ifdef CONFIG_CCI_KLOG_SUPPORT_CCI_ENGMODE | |
+ ifdef CONFIG_CCI_KLOG_ALLOW_FORCE_PANIC | |
+ KBUILD_CFLAGS += -DCCI_KLOG_ALLOW_FORCE_PANIC=y | |
+ endif # ifdef CONFIG_CCI_KLOG_ALLOW_FORCE_PANIC | |
+ ifdef CONFIG_CCI_KLOG_SUPPORT_RESTORATION | |
+ KBUILD_CFLAGS += -DCCI_KLOG_SUPPORT_RESTORATION=y | |
+ endif # ifdef CONFIG_CCI_KLOG_SUPPORT_RESTORATION | |
+endif # ifdef CONFIG_CCI_KLOG | |
+#[LY28] <== CCI KLog, added by Jimmy@CCI | |
+ | |
# We trigger additional mismatches with less inlining | |
ifdef CONFIG_DEBUG_SECTION_MISMATCH | |
KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once) | |
@@ -826,6 +884,7 @@ endif | |
prepare2: prepare3 outputmakefile asm-generic | |
prepare1: prepare2 $(version_h) include/generated/utsrelease.h \ | |
+ include/generated/cciklog_common.h \ | |
include/config/auto.conf | |
$(cmd_crmodverdir) | |
@@ -849,7 +908,9 @@ define filechk_utsrelease.h | |
echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \ | |
exit 1; \ | |
fi; \ | |
- (echo \#define UTS_RELEASE \"$(KERNELRELEASE)\";) | |
+ (echo \#define UTS_RELEASE \"$(KERNELRELEASE)\"; \ | |
+ echo \#define BUILD_INFO \"$(MTK_BUILD_VERNO)\"; \ | |
+ echo \#define BUILD_FINGERPRINT \"$(TARGET_PRODUCT)\";) | |
endef | |
define filechk_version.h | |
@@ -858,6 +919,17 @@ define filechk_version.h | |
echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';) | |
endef | |
+#[LY28] ==> CCI KLog, added by Jimmy@CCI | |
+define filechk_cciklog_common.h | |
+ (cat $(srctree)/../vendor/cci/klogcat/cciklog_common.h) | |
+endef | |
+ | |
+include/generated/cciklog_common.h: $(srctree)/Makefile FORCE | |
+ifdef CONFIG_CCI_KLOG | |
+ $(call filechk,cciklog_common.h) | |
+endif # ifdef CONFIG_CCI_KLOG | |
+#[LY28] <== CCI KLog, added by Jimmy@CCI | |
+ | |
$(version_h): $(srctree)/Makefile FORCE | |
$(call filechk,version.h) | |
@@ -985,6 +1057,29 @@ _modinst_post: _modinst_ | |
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modinst | |
$(call cmd,depmod) | |
+# MTK { | |
+# Target to install android modules | |
+ | |
+AMODLIB = $(INSTALL_MOD_PATH)/lib/modules | |
+export AMODLIB | |
+AMODSYMLIB = $(INSTALL_MOD_PATH)/../symbols/system/lib/modules | |
+export AMODSYMLIB | |
+ | |
+PHONY += android_modules_install | |
+android_modules_install: _android_modinst_ | |
+ | |
+PHONY += _android_modinst_ | |
+_android_modinst_: | |
+ @if [ ! -d $(AMODLIB) ]; then \ | |
+ mkdir -p $(AMODLIB); \ | |
+ fi | |
+ @if [ ! -d $(AMODSYMLIB) ]; then \ | |
+ mkdir -p $(AMODSYMLIB); \ | |
+ fi | |
+ $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.android.modinst | |
+# MTK } | |
+ | |
+ | |
ifeq ($(CONFIG_MODULE_SIG), y) | |
PHONY += modules_sign | |
modules_sign: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment