xref: /OK3568_Linux_fs/kernel/drivers/gpu/arm/mali400/ump/Kbuild (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun#
2*4882a593Smuzhiyun# Copyright (C) 2010-2012 ARM Limited. All rights reserved.
3*4882a593Smuzhiyun#
4*4882a593Smuzhiyun# This program is free software and is provided to you under the terms of the GNU General Public License version 2
5*4882a593Smuzhiyun# as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
6*4882a593Smuzhiyun#
7*4882a593Smuzhiyun# A copy of the licence is included with the program, and can also be obtained from Free Software
8*4882a593Smuzhiyun# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
9*4882a593Smuzhiyun#
10*4882a593Smuzhiyun
11*4882a593Smuzhiyun# Set default configuration to use, if Makefile didn't provide one.
12*4882a593Smuzhiyun# Change this to use a different config.h
13*4882a593SmuzhiyunCONFIG ?= default
14*4882a593Smuzhiyun
15*4882a593Smuzhiyun# Link arch to the selected arch-config directory
16*4882a593Smuzhiyun$(shell [ -L $(src)/arch ] && rm $(src)/arch)
17*4882a593Smuzhiyun$(shell ln -sf arch-$(CONFIG) $(src)/arch)
18*4882a593Smuzhiyun$(shell touch $(src)/arch/config.h)
19*4882a593Smuzhiyun
20*4882a593SmuzhiyunUDD_FILE_PREFIX = ../mali/
21*4882a593Smuzhiyun
22*4882a593Smuzhiyun# Get subversion revision number, fall back to 0000 if no svn info is available
23*4882a593SmuzhiyunSVN_INFO = (cd $(src); svn info 2>/dev/null)
24*4882a593Smuzhiyun
25*4882a593Smuzhiyunifneq ($(shell $(SVN_INFO) 2>/dev/null),)
26*4882a593Smuzhiyun# SVN detected
27*4882a593SmuzhiyunSVN_REV := $(shell $(SVN_INFO) | grep '^Revision: '| sed -e 's/^Revision: //' 2>/dev/null)
28*4882a593SmuzhiyunDRIVER_REV := $(MALI_RELEASE_NAME)-r$(SVN_REV)
29*4882a593SmuzhiyunCHANGE_DATE := $(shell $(SVN_INFO) | grep '^Last Changed Date: ' | cut -d: -f2- | cut -b2-)
30*4882a593SmuzhiyunCHANGED_REVISION := $(shell $(SVN_INFO) | grep '^Last Changed Rev: ' | cut -d: -f2- | cut -b2-)
31*4882a593SmuzhiyunREPO_URL := $(shell $(SVN_INFO) | grep '^URL: ' | cut -d: -f2- | cut -b2-)
32*4882a593Smuzhiyun
33*4882a593Smuzhiyunelse # SVN
34*4882a593SmuzhiyunGIT_REV := $(shell cd $(src); git describe --always 2>/dev/null)
35*4882a593Smuzhiyunifneq ($(GIT_REV),)
36*4882a593Smuzhiyun# Git detected
37*4882a593SmuzhiyunDRIVER_REV := $(MALI_RELEASE_NAME)-$(GIT_REV)
38*4882a593SmuzhiyunCHANGE_DATE := $(shell cd $(src); git log -1 --format="%ci")
39*4882a593SmuzhiyunCHANGED_REVISION := $(GIT_REV)
40*4882a593SmuzhiyunREPO_URL := $(shell cd $(src); git describe --all --always 2>/dev/null)
41*4882a593Smuzhiyun
42*4882a593Smuzhiyunelse # Git
43*4882a593Smuzhiyun# No Git or SVN detected
44*4882a593SmuzhiyunDRIVER_REV := $(MALI_RELEASE_NAME)
45*4882a593SmuzhiyunCHANGE_DATE := $(MALI_RELEASE_NAME)
46*4882a593SmuzhiyunCHANGED_REVISION := $(MALI_RELEASE_NAME)
47*4882a593Smuzhiyunendif
48*4882a593Smuzhiyunendif
49*4882a593Smuzhiyun
50*4882a593Smuzhiyunccflags-y += -DSVN_REV=$(SVN_REV)
51*4882a593Smuzhiyunccflags-y += -DSVN_REV_STRING=\"$(DRIVER_REV)\"
52*4882a593Smuzhiyun
53*4882a593Smuzhiyunccflags-y += -I$(src) -I$(src)/common -I$(src)/linux -I$(src)/../mali/common -I$(src)/../mali/linux -I$(src)/include -I$(src)/../../ump/include/ump
54*4882a593Smuzhiyunccflags-y += -DMALI_STATE_TRACKING=0
55*4882a593Smuzhiyunccflags-y += -DMALI_ENABLE_CPU_CYCLES=0
56*4882a593Smuzhiyunccflags-$(CONFIG_UMP_DEBUG) += -DDEBUG
57*4882a593Smuzhiyun
58*4882a593Smuzhiyun# For customer releases the Linux Device Drivers will be provided as ARM proprietary and GPL releases:
59*4882a593Smuzhiyun# The ARM proprietary product will only include the license/proprietary directory
60*4882a593Smuzhiyun# The GPL product will only include the license/gpl directory
61*4882a593Smuzhiyun
62*4882a593Smuzhiyunifeq ($(wildcard $(src)/linux/license/gpl/*),)
63*4882a593Smuzhiyunccflags-y += -I$(src)/linux/license/proprietary -I$(src)/../mali/linux/license/proprietary
64*4882a593Smuzhiyunelse
65*4882a593Smuzhiyunccflags-y += -I$(src)/linux/license/gpl -I$(src)/../mali/linux/license/gpl
66*4882a593Smuzhiyunendif
67*4882a593Smuzhiyun
68*4882a593Smuzhiyunump-y = common/ump_kernel_common.o \
69*4882a593Smuzhiyun	common/ump_kernel_descriptor_mapping.o \
70*4882a593Smuzhiyun	common/ump_kernel_api.o \
71*4882a593Smuzhiyun	common/ump_kernel_ref_drv.o \
72*4882a593Smuzhiyun	linux/ump_kernel_linux.o \
73*4882a593Smuzhiyun	linux/ump_kernel_memory_backend_os.o \
74*4882a593Smuzhiyun	linux/ump_kernel_memory_backend_dedicated.o \
75*4882a593Smuzhiyun	linux/ump_memory_backend.o \
76*4882a593Smuzhiyun	linux/ump_ukk_wrappers.o \
77*4882a593Smuzhiyun	linux/ump_ukk_ref_wrappers.o \
78*4882a593Smuzhiyun	linux/ump_osk_atomics.o \
79*4882a593Smuzhiyun	linux/ump_osk_low_level_mem.o \
80*4882a593Smuzhiyun	linux/ump_osk_misc.o \
81*4882a593Smuzhiyun	linux/ump_kernel_random_mapping.o
82*4882a593Smuzhiyun
83*4882a593Smuzhiyunifneq ($(CONFIG_MALI400),y)
84*4882a593Smuzhiyunump-y += $(UDD_FILE_PREFIX)linux/mali_osk_atomics.o \
85*4882a593Smuzhiyun	 $(UDD_FILE_PREFIX)linux/mali_osk_locks.o \
86*4882a593Smuzhiyun	 $(UDD_FILE_PREFIX)linux/mali_osk_memory.o \
87*4882a593Smuzhiyun	 $(UDD_FILE_PREFIX)linux/mali_osk_math.o \
88*4882a593Smuzhiyun	 $(UDD_FILE_PREFIX)linux/mali_osk_misc.o
89*4882a593Smuzhiyunendif
90*4882a593Smuzhiyun
91*4882a593Smuzhiyunobj-$(CONFIG_UMP) := ump.o
92*4882a593Smuzhiyun
93