android_kernel_modules_leno.../intel_media/graphics/gburst/Kbuild

85 lines
3.0 KiB
Makefile

# Kbuild - the "makefile" used to build the gburst software.
#
# Invocations
# 1. usual: as a part of a full kernel build if CONFIG_GPU_BURST is
# defined as "y" or "m". This file ("Kbuild") is selected by the kernel
# build system because "Kbuild" has priority over "Makefile".
#
# In which case, either:
# -- (CONFIG_GPU_BURST=y) the gburst software is built-in to the kernel.
# or
# -- (CONFIG_GPU_BURST=m) the gburst software is built as a module into
# gburst.ko . HOWEVER, some portions of gburst (e.g., hooks into the
# graphics device driver) are still built into the kernel.
#
# 2. Alternate invocation: The module may be built separately from the rest of
# the kernel (typically to reduce debug cycle time during development):
# File "Makefile" in this directory is invoked from the command line,
# defines GBURST_EXT_MOD_BUILD as "y", and then causes Kbuild to be invoked.
# The kernel against which the module will be loaded should have been created
# in the usual way with CONFIG_GPU_BURST=m.
# Requires one of the following have been done:
# -- "make modules_prepare" (ok, but does not set up Module.symvers)
# -- "make" or "make bzImage" -- regular kernel build to establish build
# environment.
# To add verbosity during build:
# make KBUILD_VERBOSE=1
ifeq ($(GBURST_EXT_MOD_BUILD),y)
CONFIG_GPU_BURST := m
endif
# MY_DEBUG - 1 to force compilation to include "-g".
MY_DEBUG := 1
# This makefile written for dir: drivers/staging/intel_media/graphics/gburst
# TOP_REL_* - directory spec relative to top directory.
# Used for makefile include references.
# Used for -I header file inclusion.
TOP_REL_DRIVERS_STAGING := drivers/staging
ifneq ($(MY_DEBUG),)
ifneq ($(MY_DEBUG),0)
# Causes build errors: ## ccflags-y += -O0 -fno-inline
ifndef CONFIG_DEBUG_INFO
# If CONFIG_DEBUG_INFO, then "-g" is already present by default.
ccflags-y += -g
endif
endif
endif
obj-$(CONFIG_GPU_BURST) += gburst.o
gburst-y :=
gburst-y += gburstm.o
gburst-y += gburst_stats.o
gburst-y += utilf.o
gburst_warning_flags :=
gburst_warning_flags += -Wall -fmessage-length=0 -Wunused-parameter
gburst_warning_flags += -Wextra -Wno-sign-compare -Wformat-nonliteral -Wformat-security -fdiagnostics-show-option -Wdeclaration-after-statement -Wmissing-format-attribute -Wpointer-arith -Wshadow -Wlogical-op -Wbad-function-cast -Wmissing-prototypes -Wwrite-strings
# Turn off things that too many kernel headers cause.
gburst_warning_flags += -Wno-unused-parameter -Wno-pointer-arith -Wno-bad-function-cast
## gburst_warning_flags += -Wundef -Wc++-compat
ccflags-y += $(gburst_warning_flags)
# To request an assembly listing:
## ccflags-y += -Wa,-alh=$(PWD)/q.lst
# Variable c_flags is the embodiment of the kbuild compilation options.
TOP_REL_DEV_SGX := $(TOP_REL_DRIVERS_STAGING)/mrst/pvr/services4/srvkm/devices/sgx
CFLAGS_gburst_stats.o += -I$(TOP_REL_DEV_SGX)
TOP_REL_SYSCONFIG := $(TOP_REL_DRIVERS_STAGING)/mrst/pvr/services4/system/intel_drm
CFLAGS_gburstm.o += -I$(TOP_REL_SYSCONFIG)