forked from EmbeddedAndroid/hardware-ti-sgx
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.KM.Android
executable file
·176 lines (157 loc) · 7.82 KB
/
Makefile.KM.Android
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
include Rules.make
OMAPES:=INVALIDVAL
.PHONY: all_km buildkernel
.PHONY: clean_km cleankernelmodule
.PHONY: help_km
all_km: buildkernel builddevmem2
buildkernel:
ifeq ($(OMAPES),3.x)
@echo "building the sgx kernel modules..."
@export KERNELDIR=$(KERNEL_INSTALL_DIR) && \
export PATH=$(CSTOOL_PATH):$(PATH) && \
export CROSS_COMPILE=$(CSTOOL_PREFIX) && \
export EURASIAROOT=$(EURASIAROOT) && \
export ANDROID_ROOT=$(ANDROID_ROOT) && \
export ARCH=arm && \
make -C $(GFX_KERNMOD_SRCPATH)/eurasiacon/build/linux2/omap4430_android KERNELDIR=$(KERNEL_INSTALL_DIR) TARGET_PRODUCT=$(TARGET_PRODUCT) SGXCORE=530 SGXCOREREV=121 BUILD=release
@echo "copying the sgx kernel modules to $(GFX_REL_ES3_LIB_SRCPATH_ANDROID)"
@cp -rf $(GFX_KERNMOD_SRCPATH)/eurasiacon/binary2_omap4430_android_release/target/pvrsrvkm.ko $(GFX_REL_ES3_LIB_SRCPATH_ANDROID)/.
@cp -rf $(GFX_KERNMOD_SRCPATH)/eurasiacon/binary2_omap4430_android_release/target/omaplfb.ko $(GFX_REL_ES3_LIB_SRCPATH_ANDROID)/.
else ifeq ($(OMAPES),4.x)
@echo "building the sgx kernel modules..."
@export KERNELDIR=$(KERNEL_INSTALL_DIR) && \
export PATH=$(CSTOOL_PATH):$(PATH) && \
export CROSS_COMPILE=$(CSTOOL_PREFIX) && \
export EURASIAROOT=$(EURASIAROOT) && \
export ANDROID_ROOT=$(ANDROID_ROOT) && \
export ARCH=arm && \
make -C $(GFX_KERNMOD_SRCPATH)/eurasiacon/build/linux2/omap4430_android KERNELDIR=$(KERNEL_INSTALL_DIR) TARGET_PRODUCT=$(TARGET_PRODUCT) SGXCORE=530 SGXCOREREV=125 BUILD=release
@echo "copying the sgx kernel modules to $(GFX_REL_ES4_LIB_SRCPATH_ANDROID)"
@cp -rf $(GFX_KERNMOD_SRCPATH)/eurasiacon/binary2_omap4430_android_release/target/pvrsrvkm.ko $(GFX_REL_ES4_LIB_SRCPATH_ANDROID)/.
@cp -rf $(GFX_KERNMOD_SRCPATH)/eurasiacon/binary2_omap4430_android_release/target/omaplfb.ko $(GFX_REL_ES4_LIB_SRCPATH_ANDROID)/.
else ifeq ($(OMAPES),5.x)
@echo "building the sgx kernel modules..."
@export KERNELDIR=$(KERNEL_INSTALL_DIR) && \
export PATH=$(CSTOOL_PATH):$(PATH) && \
export CROSS_COMPILE=$(CSTOOL_PREFIX) && \
export EURASIAROOT=$(EURASIAROOT) && \
export ANDROID_ROOT=$(ANDROID_ROOT) && \
export ARCH=arm && \
make -C $(GFX_KERNMOD_SRCPATH)/eurasiacon/build/linux2/omap4430_android KERNELDIR=$(KERNEL_INSTALL_DIR) TARGET_PRODUCT=$(TARGET_PRODUCT) SGXCORE=530 SGXCOREREV=125 BUILD=release
@echo "copying the sgx kernel modules to $(GFX_REL_ES5_LIB_SRCPATH_ANDROID)"
@cp -rf $(GFX_KERNMOD_SRCPATH)/eurasiacon/binary2_omap4430_android_release/target/pvrsrvkm.ko $(GFX_REL_ES5_LIB_SRCPATH_ANDROID)/.
@cp -rf $(GFX_KERNMOD_SRCPATH)/eurasiacon/binary2_omap4430_android_release/target/omaplfb.ko $(GFX_REL_ES5_LIB_SRCPATH_ANDROID)/.
else ifeq ($(OMAPES),6.x)
@echo "building the sgx kernel modules..."
@export KERNELDIR=$(KERNEL_INSTALL_DIR) && \
export PATH=$(CSTOOL_PATH):$(PATH) && \
export CROSS_COMPILE=$(CSTOOL_PREFIX) && \
export EURASIAROOT=$(EURASIAROOT) && \
export ANDROID_ROOT=$(ANDROID_ROOT) && \
export ARCH=arm && \
make -C $(GFX_KERNMOD_SRCPATH)/eurasiacon/build/linux2/omap4430_android KERNELDIR=$(KERNEL_INSTALL_DIR) TARGET_PRODUCT=$(TARGET_PRODUCT) SGXCORE=530 SGXCOREREV=125
@echo "copying the sgx kernel modules to $(GFX_REL_ES6_LIB_SRCPATH_ANDROID)"
@cp -rf $(GFX_KERNMOD_SRCPATH)/eurasiacon/binary2_omap4430_android_release/target/pvrsrvkm.ko $(GFX_REL_ES6_LIB_SRCPATH_ANDROID)/.
@cp -rf $(GFX_KERNMOD_SRCPATH)/eurasiacon/binary2_omap4430_android_release/target/omaplfb.ko $(GFX_REL_ES6_LIB_SRCPATH_ANDROID)/.
else ifeq ($(OMAPES),7.x)
@echo "building the sgx kernel modules..."
@export KERNELDIR=$(KERNEL_INSTALL_DIR) && \
export PATH=$(CSTOOL_PATH):$(PATH) && \
export CROSS_COMPILE=$(CSTOOL_PREFIX) && \
export EURASIAROOT=$(EURASIAROOT) && \
export ANDROID_ROOT=$(ANDROID_ROOT) && \
export ARCH=arm && \
make -C $(GFX_KERNMOD_SRCPATH)/eurasiacon/build/linux2/omap4430_android KERNELDIR=$(KERNEL_INSTALL_DIR) TARGET_PRODUCT=$(TARGET_PRODUCT) SGXCORE=540 SGXCOREREV=120
@echo "copying the sgx kernel modules to $(GFX_REL_ES7_LIB_SRCPATH_ANDROID)"
@cp -rf $(GFX_KERNMOD_SRCPATH)/eurasiacon/binary2_omap4430_android_release/target/pvrsrvkm.ko $(GFX_REL_ES7_LIB_SRCPATH_ANDROID)/.
@cp -rf $(GFX_KERNMOD_SRCPATH)/eurasiacon/binary2_omap4430_android_release/target/omaplfb.ko $(GFX_REL_ES7_LIB_SRCPATH_ANDROID)/.
else
@echo "OMAPES value not specified (Mandatory value)"
exit 1
endif
############################### CLEAN ##################################
clean_km: cleankernelmodule cleandevmem2
builddevmem2:
@echo "building devmem2..."
make -C $(GFX_DEVMEM2_SRCPATH) && make -C $(GFX_DEVMEM2_SRCPATH) install
cleandevmem2:
make -C $(GFX_DEVMEM2_SRCPATH) clean
cleankernelmodule:
ifeq ($(OMAPES),7.x)
@echo "cleaning the sgx kernel modules..."
export KERNELDIR=$(KERNEL_INSTALL_DIR) && \
export PATH=$(CSTOOL_PATH):$(PATH) && \
export CROSS_COMPILE=$(CSTOOL_PREFIX) && \
export EURASIAROOT=$(EURASIAROOT) && \
export DISCIMAGE=$(ANDROID_DISCIMAGE) && \
export ANDROID_ROOT=$(ANDROID_ROOT) && \
make -C $(GFX_KERNMOD_SRCPATH)/eurasiacon/build/linux2/omap4430_android KERNELDIR=$(KERNEL_INSTALL_DIR) TARGET_PRODUCT=$(TARGET_PRODUCT) SGXCORE=540 SGXCOREREV=120 clean
else ifeq ($(OMAPES),3.x)
@echo "cleaning the sgx kernel modules..."
export KERNELDIR=$(KERNEL_INSTALL_DIR) && \
export PATH=$(CSTOOL_PATH):$(PATH) && \
export CROSS_COMPILE=$(CSTOOL_PREFIX) && \
export EURASIAROOT=$(EURASIAROOT) && \
export DISCIMAGE=$(ANDROID_DISCIMAGE) && \
export ANDROID_ROOT=$(ANDROID_ROOT) && \
make -C $(GFX_KERNMOD_SRCPATH)/eurasiacon/build/linux2/omap4430_android KERNELDIR=$(KERNEL_INSTALL_DIR) TARGET_PRODUCT=$(TARGET_PRODUCT) SGXCORE=530 SGXCOREREV=121 clean
else
@echo "cleaning the sgx kernel modules..."
export KERNELDIR=$(KERNEL_INSTALL_DIR) && \
export PATH=$(CSTOOL_PATH):$(PATH) && \
export CROSS_COMPILE=$(CSTOOL_PREFIX) && \
export EURASIAROOT=$(EURASIAROOT) && \
export DISCIMAGE=$(ANDROID_DISCIMAGE) && \
export ANDROID_ROOT=$(ANDROID_ROOT) && \
make -C $(GFX_KERNMOD_SRCPATH)/eurasiacon/build/linux2/omap4430_android KERNELDIR=$(KERNEL_INSTALL_DIR) TARGET_PRODUCT=$(TARGET_PRODUCT) SGXCORE=530 SGXCOREREV=125 clean
endif
############################# INSTALL ##################################
install_km:
ifeq ($(OMAPES),INVALIDVAL)
@echo "OMAPES value not specified (Mandatory value)..Exiting..."
exit 1
endif
# @patch -p0 -d $(ANDROID_DISCIMAGE) < initrc.patch
ifeq ($(OMAPES),3.x)
@cd $(GFX_REL_ES3_LIB_SRCPATH_ANDROID) && \
export DISCIMAGE=$(ANDROID_DISCIMAGE) && \
export ANDROID_ROOT=$(ANDROID_ROOT) && \
export ANDROID_PRODUCT=$(TARGET_PRODUCT) && \
./install.sh --no-x --no-bcdevice
endif
ifeq ($(OMAPES),4.x)
@cd $(GFX_REL_ES4_LIB_SRCPATH_ANDROID) && \
export DISCIMAGE=$(ANDROID_DISCIMAGE) && \
export ANDROID_ROOT=$(ANDROID_ROOT) && \
export ANDROID_PRODUCT=$(TARGET_PRODUCT) && \
./install.sh --no-x --no-bcdevice
endif
ifeq ($(OMAPES),5.x)
@cd $(GFX_REL_ES5_LIB_SRCPATH_ANDROID) && \
export DISCIMAGE=$(ANDROID_DISCIMAGE) && \
export ANDROID_ROOT=$(ANDROID_ROOT) && \
export ANDROID_PRODUCT=$(TARGET_PRODUCT) && \
./install.sh --no-x --no-bcdevice
endif
ifeq ($(OMAPES),6.x)
@cd $(GFX_REL_ES6_LIB_SRCPATH_ANDROID) && \
export DISCIMAGE=$(ANDROID_DISCIMAGE) && \
export ANDROID_ROOT=$(ANDROID_ROOT) && \
export ANDROID_PRODUCT=$(TARGET_PRODUCT) && \
./install.sh --no-x --no-bcdevice
endif
ifeq ($(OMAPES),7.x)
@cd $(GFX_REL_ES7_LIB_SRCPATH_ANDROID) && \
export DISCIMAGE=$(ANDROID_DISCIMAGE) && \
export ANDROID_ROOT=$(ANDROID_ROOT) && \
export ANDROID_PRODUCT=$(TARGET_PRODUCT) && \
./install.sh --no-x --no-bcdevice
endif
############################# HELP ##################################
help_km:
@echo ""
@echo "Usage (for build): make"
@echo "Usage (for install): make install OMAPES={5.x | 6.x}"
@echo "See online Graphics Getting Started Guide for further details."
@echo ""
###########################################################################