forked from linux-sunxi/sunxi-mali
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.config
94 lines (84 loc) · 2.81 KB
/
Makefile.config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#
# This Makefile tries to autodetect some things, but since i am not that
# knowledgable about make, it probably does rather unconventional things.
#
# It tries to detect the mali driver version from the kernel, but this can
# be overridden at the commandline with VERSION=
#
# Through gcc -dumpmachine, this Makefile tries to detect whether it needs
# the 'armel' or 'armhf' ABI. Override with ABI=
#
include Makefile.setup
# Try to detect whether to install armel or armhf libs.
ifeq ($(ABI),)
dumpmachine := $(shell gcc -dumpmachine)
ifeq ($(dumpmachine),arm-linux-gnueabi) # linaro
ABI = armel
else ifeq ($(dumpmachine),armv5tel-redhat-linux-gnueabi) # fedora
ABI = armel
else ifeq ($(dumpmachine),arm-linux-gnueabihf) # linaro HF
ABI = armhf
else ifeq ($(dumpmachine),armv7hl-redhat-linux-gnueabi) # fedora HF
ABI = armhf
else ifeq ($(dumpmachine),armv7a-hardfloat-linux-gnueabi) # gentoo HF
ABI = armhf
endif
$(info ABI="$(ABI)" (Detected))
else
$(info ABI="$(ABI)" (Provided))
endif
# Sanitize ABI, even when passed from the commandline.
ifeq ($(ABI),armel)
else ifeq ($(ABI),armhf)
else
$(warning Unknown/unhandled ABI "$(ABI)")
$(warning Use ABI=armel or ABI=armhf instead)
$(error Unknown/unhandled ABI "$(ABI)")
endif
# Detect mali driver version by talking to the mali kernel driver.
ifeq ($(VERSION),)
bleh := $(shell make -C version)
VERSION = $(shell version/version)
$(info VERSION="$(VERSION)" (Detected))
else
$(info VERSION="$(VERSION)" (Provided))
endif
# Sanitize mali driver version, even when passed from the commandline.
ifeq ($(VERSION),r2p4)
else ifeq ($(VERSION),r3p0)
else ifeq ($(VERSION),r3p1)
else ifeq ($(VERSION),r3p2-01rel1)
else
$(warning Unknown/unhandled Mali Version "$(VERSION)")
$(warning Use VERSION=(r2p4,r3p0,r3p1,r3p2-01rel1) instead)
$(error Unknown/unhandled Mali Version "$(VERSION)")
endif
# Try to find autodetect which EGL libs we need to install
ifeq ($(EGL_TYPE),)
ifneq ($(wildcard $(libdir)/libX11.so),)
EGL_TYPE = x11
else ifneq ($(wildcard $(libdir)/*/libX11.so),)
EGL_TYPE = x11
else
EGL_TYPE = framebuffer
endif
$(info EGL_TYPE="$(EGL_TYPE)" (Detected))
else
$(info EGL_TYPE="$(EGL_TYPE)" (Provided))
endif
# Sanitize egl type, even when passed from the commandline.
ifeq ($(EGL_TYPE),x11)
else ifeq ($(EGL_TYPE),framebuffer)
else
$(warning Unknown/unhandled EGL type "$(EGL_TYPE)")
$(warning Use EGL_TYPE=(framebuffer,x11) instead)
$(error Unknown/unhandled EGL type "$(EGL_TYPE)")
endif
# Check whether there is an actual libMali.so for us
ifeq ($(wildcard lib/mali/$(VERSION)/$(ABI)/$(EGL_TYPE)/Makefile),)
$(error No Mali libs exist for $(VERSION), $(ABI), $(EGL_TYPE))
endif
config.mk:
echo "MALI_VERSION ?= $(VERSION)" > $@
echo "MALI_LIBS_ABI ?= $(ABI)" >> $@
echo "MALI_EGL_TYPE ?= $(EGL_TYPE)" >> $@