Commit | Line | Data |
---|---|---|
6fa3eb70 S |
1 | # |
2 | # This confidential and proprietary software may be used only as | |
3 | # authorised by a licensing agreement from ARM Limited | |
4 | # (C) COPYRIGHT 2008-2012 ARM Limited | |
5 | # ALL RIGHTS RESERVED | |
6 | # The entire notice above must be reproduced on all authorised | |
7 | # copies and copies may only be made to the extent permitted | |
8 | # by a licensing agreement from ARM Limited. | |
9 | # | |
10 | ||
11 | # Set default configuration to use, if Makefile didn't provide one. | |
12 | # Change this to use a different config.h | |
bdc132d7 | 13 | CONFIG ?= default |
6fa3eb70 S |
14 | |
15 | # Validate selected config | |
16 | ifneq ($(shell [ -d $(src)/arch-$(CONFIG) ] && [ -f $(src)/arch-$(CONFIG)/config.h ] && echo "OK"), OK) | |
17 | $(warning Current directory is $(src)) | |
18 | $(error No configuration found for config $(CONFIG). Check that arch-$(CONFIG)/config.h exists) | |
19 | else | |
20 | # Link arch to the selected arch-config directory | |
21 | $(shell [ -L $(src)/arch ] && rm $(src)/arch) | |
22 | $(shell ln -sf arch-$(CONFIG) $(src)/arch) | |
23 | $(shell touch $(src)/arch/config.h) | |
24 | endif | |
25 | ||
26 | UDD_FILE_PREFIX = ../mali/ | |
27 | ||
28 | # Get subversion revision number, fall back to 0000 if no svn info is available | |
29 | SVN_INFO = (cd $(src); svn info 2>/dev/null) | |
30 | ||
31 | ifneq ($(shell $(SVN_INFO) 2>/dev/null),) | |
32 | # SVN detected | |
33 | SVN_REV := $(shell $(SVN_INFO) | grep '^Revision: '| sed -e 's/^Revision: //' 2>/dev/null) | |
34 | DRIVER_REV := $(MALI_RELEASE_NAME)-r$(SVN_REV) | |
35 | CHANGE_DATE := $(shell $(SVN_INFO) | grep '^Last Changed Date: ' | cut -d: -f2- | cut -b2-) | |
36 | CHANGED_REVISION := $(shell $(SVN_INFO) | grep '^Last Changed Rev: ' | cut -d: -f2- | cut -b2-) | |
37 | REPO_URL := $(shell $(SVN_INFO) | grep '^URL: ' | cut -d: -f2- | cut -b2-) | |
38 | ||
39 | else # SVN | |
40 | GIT_REV := $(shell cd $(src); git describe --always 2>/dev/null) | |
41 | ifneq ($(GIT_REV),) | |
42 | # Git detected | |
43 | DRIVER_REV := $(MALI_RELEASE_NAME)-$(GIT_REV) | |
44 | CHANGE_DATE := $(shell cd $(src); git log -1 --format="%ci") | |
45 | CHANGED_REVISION := $(GIT_REV) | |
46 | REPO_URL := $(shell cd $(src); git describe --all --always 2>/dev/null) | |
47 | ||
48 | else # Git | |
49 | # No Git or SVN detected | |
50 | DRIVER_REV := $(MALI_RELEASE_NAME) | |
51 | CHANGE_DATE := $(MALI_RELEASE_NAME) | |
52 | CHANGED_REVISION := $(MALI_RELEASE_NAME) | |
53 | endif | |
54 | endif | |
55 | ||
56 | ccflags-y += -DSVN_REV=$(SVN_REV) | |
57 | ccflags-y += -DSVN_REV_STRING=\"$(DRIVER_REV)\" | |
58 | ||
59 | ccflags-y += -I$(src) -I$(src)/common -I$(src)/linux -I$(src)/../mali/common -I$(src)/../mali/linux -I$(src)/../../ump/include/ump | |
60 | ccflags-y += -DMALI_STATE_TRACKING=0 | |
61 | ccflags-y += -DMALI_ENABLE_CPU_CYCLES=0 | |
62 | ccflags-$(CONFIG_UMP_DEBUG) += -DDEBUG | |
63 | ||
64 | # For customer releases the Linux Device Drivers will be provided as ARM proprietary and GPL releases: | |
65 | # The ARM proprietary product will only include the license/proprietary directory | |
66 | # The GPL product will only include the license/gpl directory | |
67 | ||
68 | ifeq ($(wildcard $(src)/linux/license/gpl/*),) | |
69 | ccflags-y += -I$(src)/linux/license/proprietary -I$(src)/../mali/linux/license/proprietary | |
70 | else | |
71 | ccflags-y += -I$(src)/linux/license/gpl -I$(src)/../mali/linux/license/gpl | |
72 | endif | |
73 | ||
74 | ump-y = common/ump_kernel_common.o \ | |
75 | common/ump_kernel_descriptor_mapping.o \ | |
76 | common/ump_kernel_api.o \ | |
77 | common/ump_kernel_ref_drv.o \ | |
78 | linux/ump_kernel_linux.o \ | |
79 | linux/ump_kernel_memory_backend_os.o \ | |
80 | linux/ump_kernel_memory_backend_dedicated.o \ | |
81 | linux/ump_memory_backend.o \ | |
82 | linux/ump_ukk_wrappers.o \ | |
83 | linux/ump_ukk_ref_wrappers.o \ | |
84 | linux/ump_osk_atomics.o \ | |
85 | linux/ump_osk_low_level_mem.o \ | |
86 | linux/ump_osk_misc.o \ | |
bdc132d7 | 87 | linux/ump_kernel_random_mapping.o \ |
6fa3eb70 S |
88 | $(UDD_FILE_PREFIX)linux/mali_osk_atomics.o \ |
89 | $(UDD_FILE_PREFIX)linux/mali_osk_locks.o \ | |
90 | $(UDD_FILE_PREFIX)linux/mali_osk_memory.o \ | |
91 | $(UDD_FILE_PREFIX)linux/mali_osk_math.o \ | |
92 | $(UDD_FILE_PREFIX)linux/mali_osk_misc.o | |
93 | ||
94 | obj-$(CONFIG_UMP) := ump.o | |
95 |