blob: 8ab90139484f276839cb516226203768183a19a6
1 | # Copyright (C) 2011 The Android Open Source Project |
2 | # |
3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
4 | # you may not use this file except in compliance with the License. |
5 | # You may obtain a copy of the License at |
6 | # |
7 | # http://www.apache.org/licenses/LICENSE-2.0 |
8 | # |
9 | # Unless required by applicable law or agreed to in writing, software |
10 | # distributed under the License is distributed on an "AS IS" BASIS, |
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | # See the License for the specific language governing permissions and |
13 | # limitations under the License. |
14 | |
15 | |
16 | LOCAL_PATH := $(call my-dir) |
17 | |
18 | include $(CLEAR_VARS) |
19 | |
20 | LOCAL_MODULE_RELATIVE_PATH := hw |
21 | LOCAL_CFLAGS += -fno-short-enums -DQEMU_HARDWARE |
22 | LOCAL_CFLAGS += -Wno-unused-parameter -Wno-missing-field-initializers |
23 | LOCAL_CFLAGS += -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION) |
24 | |
25 | ######################################################################################################## |
26 | CAMHAL_GIT_VERSION="$(shell cd $(LOCAL_PATH);git log | grep commit -m 1 | cut -d' ' -f 2)" |
27 | CAMHAL_GIT_UNCOMMIT_FILE_NUM=$(shell cd $(LOCAL_PATH);git diff | grep +++ -c) |
28 | CAMHAL_LAST_CHANGED="$(shell cd $(LOCAL_PATH);git log | grep Date -m 1)" |
29 | CAMHAL_BUILD_TIME=" $(shell date)" |
30 | CAMHAL_BUILD_NAME=" $(shell echo ${LOGNAME})" |
31 | CAMHAL_BRANCH_NAME="$(shell cd $(LOCAL_PATH);git branch -a | sed -n '/'*'/p')" |
32 | CAMHAL_BUILD_MODE=$(shell echo ${TARGET_BUILD_VARIANT}) |
33 | CAMHAL_HOSTNAME="$(shell hostname)" |
34 | CAMHAL_IP="$(shell ifconfig eth0|grep -oE '([0-9]{1,3}\.?){4}'|head -n 1)" |
35 | CAMHAL_PATH="$(shell pwd)/$(LOCAL_PATH)" |
36 | |
37 | LOCAL_CFLAGS+=-DHAVE_VERSION_INFO |
38 | LOCAL_CFLAGS+=-DCAMHAL_GIT_VERSION=\"${CAMHAL_GIT_VERSION}${CAMHAL_GIT_DIRTY}\" |
39 | LOCAL_CFLAGS+=-DCAMHAL_BRANCH_NAME=\"${CAMHAL_BRANCH_NAME}\" |
40 | LOCAL_CFLAGS+=-DCAMHAL_LAST_CHANGED=\"${CAMHAL_LAST_CHANGED}\" |
41 | LOCAL_CFLAGS+=-DCAMHAL_BUILD_TIME=\"${CAMHAL_BUILD_TIME}\" |
42 | LOCAL_CFLAGS+=-DCAMHAL_BUILD_NAME=\"${CAMHAL_BUILD_NAME}\" |
43 | LOCAL_CFLAGS+=-DCAMHAL_GIT_UNCOMMIT_FILE_NUM=${CAMHAL_GIT_UNCOMMIT_FILE_NUM} |
44 | LOCAL_CFLAGS+=-DCAMHAL_HOSTNAME=\"${CAMHAL_HOSTNAME}\" |
45 | LOCAL_CFLAGS+=-DCAMHAL_IP=\"${CAMHAL_IP}\" |
46 | LOCAL_CFLAGS+=-DCAMHAL_PATH=\"${CAMHAL_PATH}\" |
47 | ######################################################################################################## |
48 | |
49 | LOCAL_SHARED_LIBRARIES:= \ |
50 | libbinder \ |
51 | liblog \ |
52 | libutils \ |
53 | libcutils \ |
54 | libcamera_client \ |
55 | libion \ |
56 | libui \ |
57 | libdl \ |
58 | libjpeg \ |
59 | libjhead \ |
60 | libexpat |
61 | |
62 | # JPEG conversion libraries and includes. |
63 | LOCAL_SHARED_LIBRARIES += \ |
64 | libjpeg \ |
65 | libcamera_metadata |
66 | |
67 | LOCAL_STATIC_LIBRARIES := \ |
68 | libyuv_static \ |
69 | |
70 | LOCAL_CFLAGS += -DANDROID_PLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION) |
71 | |
72 | LOCAL_KK=0 |
73 | ifeq ($(GPU_TYPE),t83x) |
74 | LOCAL_KK:=1 |
75 | endif |
76 | ifeq ($(GPU_ARCH),midgard) |
77 | LOCAL_KK:=1 |
78 | endif |
79 | ifeq ($(LOCAL_KK),1) |
80 | LOCAL_CFLAGS += -DMALI_AFBC_GRALLOC=1 |
81 | else |
82 | LOCAL_CFLAGS += -DMALI_AFBC_GRALLOC=0 |
83 | endif |
84 | |
85 | MESON_GRALLOC_DIR ?= hardware/amlogic/gralloc |
86 | |
87 | LOCAL_C_INCLUDES += external/jpeg \ |
88 | external/jhead/ \ |
89 | frameworks/native/include/media/hardware \ |
90 | external/libyuv/files/include/ \ |
91 | $(TOP)/system/core/libion/include \ |
92 | $(TOP)/system/core/libion/kernel-headers \ |
93 | $(TOP)/$(MESON_GRALLOC_DIR) \ |
94 | $(LOCAL_PATH)/inc \ |
95 | $(call include-path-for, camera) \ |
96 | $(TOP)/external/expat/lib \ |
97 | $(LOCAL_PATH)/../inc/mjpeg/ \ |
98 | |
99 | LOCAL_SRC_FILES := \ |
100 | EmulatedCameraHal.cpp \ |
101 | EmulatedCameraFactory.cpp \ |
102 | EmulatedCameraHotplugThread.cpp \ |
103 | EmulatedBaseCamera.cpp \ |
104 | EmulatedCamera.cpp \ |
105 | EmulatedCameraDevice.cpp \ |
106 | EmulatedQemuCamera.cpp \ |
107 | EmulatedQemuCameraDevice.cpp \ |
108 | EmulatedFakeCamera.cpp \ |
109 | EmulatedFakeCameraDevice.cpp \ |
110 | Converters.cpp \ |
111 | PreviewWindow.cpp \ |
112 | CallbackNotifier.cpp \ |
113 | QemuClient.cpp \ |
114 | JpegCompressor.cpp \ |
115 | fake-pipeline2/Scene.cpp \ |
116 | fake-pipeline2/Sensor.cpp \ |
117 | fake-pipeline2/ge2d_stream.cpp \ |
118 | fake-pipeline2/JpegCompressor.cpp \ |
119 | fake-pipeline2/NV12_resize.c \ |
120 | fake-pipeline2/util.c \ |
121 | EmulatedCamera3.cpp \ |
122 | EmulatedFakeCamera3.cpp \ |
123 | EmulatedFakeCamera3Info.cpp \ |
124 | fake-pipeline2/camera_hw.cpp \ |
125 | VendorTags.cpp \ |
126 | LoadXml.cpp \ |
127 | ../mjpeg/jpegdec.c \ |
128 | ../mjpeg/colorspaces.c \ |
129 | |
130 | ifeq ($(TARGET_PRODUCT),vbox_x86) |
131 | LOCAL_MODULE := camera.vbox_x86 |
132 | else |
133 | LOCAL_MODULE:= camera.amlogic |
134 | endif |
135 | |
136 | include $(BUILD_SHARED_LIBRARY) |
137 | |
138 | include $(call all-makefiles-under,$(LOCAL_PATH)) |
139 | |
140 | $(info ************************************************************) |
141 | |
142 | $(info pdk or not: $(TARGET_BUILD_PDK)) |
143 | $(info target board: $(TARGET_BOARD_PLATFORM)) |
144 | $(info git version: $(CAMHAL_GIT_VERSION)) |
145 | $(info uncomment: $(CAMHAL_GIT_UNCOMMIT_FILE_NUM) files) |
146 | $(info last changed: $(CAMHAL_LAST_CHANGED)) |
147 | $(info build time: $(CAMHAL_BUILD_TIME)) |
148 | $(info builder name: $(CAMHAL_BUILD_NAME)) |
149 | $(info branch name: $(CAMHAL_BRANCH_NAME)) |
150 | $(info build mode: $(CAMHAL_BUILD_MODE)) |
151 | $(info host name: $(CAMHAL_HOSTNAME)) |
152 | $(info host IP: $(CAMHAL_IP)) |
153 | $(info path: $(CAMHAL_PATH)) |
154 | $(info ************************************************************) |
155 | $(shell sleep 1) |
156 | |
157 | ################################################################# |
158 | ifneq (true,true) |
159 | |
160 | include $(CLEAR_VARS) |
161 | |
162 | LOCAL_MODULE_RELATIVE_PATH := hw |
163 | LOCAL_CFLAGS += -fno-short-enums -DQEMU_HARDWARE |
164 | LOCAL_CFLAGS += -Wno-unused-parameter |
165 | LOCAL_SHARED_LIBRARIES:= \ |
166 | libcutils \ |
167 | liblog \ |
168 | libskia \ |
169 | libandroid_runtime |
170 | |
171 | LOCAL_C_INCLUDES += external/jpeg \ |
172 | external/skia/include/core/ \ |
173 | frameworks/base/core/jni/android/graphics \ |
174 | frameworks/native/include |
175 | |
176 | LOCAL_SRC_FILES := JpegStub.cpp |
177 | |
178 | LOCAL_MODULE := camera.goldfish.jpeg |
179 | |
180 | include $(BUILD_SHARED_LIBRARY) |
181 | |
182 | endif # !PDK |
183 |