X-Git-Url: https://git.stricted.de/?p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git;a=blobdiff_plain;f=Makefile;h=a10c99a7fa646fbaa3145c02a3203ed4ad74e678;hp=9429aa5e89de45ba16ee73a640fe31b2262815c2;hb=6fa3eb70c07b7ce2061fd6602159ac2d45a7dc3d;hpb=a8d97b1bd0c91fbc1be54d068b5f051b4f70b4f7 diff --git a/Makefile b/Makefile index 9429aa5e89de..a10c99a7fa64 100644 --- a/Makefile +++ b/Makefile @@ -192,8 +192,15 @@ 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 ?= $(CONFIG_CROSS_COMPILE:"%"=%) +ifeq ($(TARGET_ARCH), arm) +ARCH ?= arm +CROSS_COMPILE ?= arm-eabi- +else +ARCH ?= arm64 +CROSS_COMPILE ?= aarch64-linux-android- +endif # Architecture as present in compile.h UTS_MACHINE := $(ARCH) @@ -373,7 +380,9 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ -fno-strict-aliasing -fno-common \ -Werror-implicit-function-declaration \ -Wno-format-security \ - -fno-delete-null-pointer-checks + -fno-delete-null-pointer-checks \ + -Werror=format -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast + KBUILD_AFLAGS_KERNEL := KBUILD_CFLAGS_KERNEL := KBUILD_AFLAGS := -D__ASSEMBLY__ @@ -381,6 +390,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 +605,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 @@ -851,7 +868,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 @@ -987,6 +1006,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: