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