blob: a64c13130be60f73cbbdea4d2a27b07bd78b4155
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 | |
24 | ######################################################################################################## |
25 | CAMHAL_GIT_VERSION="$(shell cd $(LOCAL_PATH);git log | grep commit -m 1 | cut -d' ' -f 2)" |
26 | CAMHAL_GIT_UNCOMMIT_FILE_NUM=$(shell cd $(LOCAL_PATH);git diff | grep +++ -c) |
27 | CAMHAL_LAST_CHANGED="$(shell cd $(LOCAL_PATH);git log | grep Date -m 1)" |
28 | CAMHAL_BUILD_TIME=" $(shell date)" |
29 | CAMHAL_BUILD_NAME=" $(shell echo ${LOGNAME})" |
30 | CAMHAL_BRANCH_NAME="$(shell cd $(LOCAL_PATH);git branch -a | sed -n '/'*'/p')" |
31 | CAMHAL_BUILD_MODE=$(shell echo ${TARGET_BUILD_VARIANT}) |
32 | CAMHAL_HOSTNAME="$(shell hostname)" |
33 | CAMHAL_IP="$(shell ifconfig eth0|grep -oE '([0-9]{1,3}\.?){4}'|head -n 1)" |
34 | CAMHAL_PATH="$(shell pwd)/$(LOCAL_PATH)" |
35 | |
36 | LOCAL_CFLAGS+=-DHAVE_VERSION_INFO |
37 | LOCAL_CFLAGS+=-DCAMHAL_GIT_VERSION=\"${CAMHAL_GIT_VERSION}${CAMHAL_GIT_DIRTY}\" |
38 | LOCAL_CFLAGS+=-DCAMHAL_BRANCH_NAME=\"${CAMHAL_BRANCH_NAME}\" |
39 | LOCAL_CFLAGS+=-DCAMHAL_LAST_CHANGED=\"${CAMHAL_LAST_CHANGED}\" |
40 | LOCAL_CFLAGS+=-DCAMHAL_BUILD_TIME=\"${CAMHAL_BUILD_TIME}\" |
41 | LOCAL_CFLAGS+=-DCAMHAL_BUILD_NAME=\"${CAMHAL_BUILD_NAME}\" |
42 | LOCAL_CFLAGS+=-DCAMHAL_GIT_UNCOMMIT_FILE_NUM=${CAMHAL_GIT_UNCOMMIT_FILE_NUM} |
43 | LOCAL_CFLAGS+=-DCAMHAL_HOSTNAME=\"${CAMHAL_HOSTNAME}\" |
44 | LOCAL_CFLAGS+=-DCAMHAL_IP=\"${CAMHAL_IP}\" |
45 | LOCAL_CFLAGS+=-DCAMHAL_PATH=\"${CAMHAL_PATH}\" |
46 | ######################################################################################################## |
47 | |
48 | LOCAL_SHARED_LIBRARIES:= \ |
49 | libbinder \ |
50 | liblog \ |
51 | libutils \ |
52 | libcutils \ |
53 | libcamera_client \ |
54 | libion \ |
55 | libui \ |
56 | libdl \ |
57 | libjpeg \ |
58 | libjhead \ |
59 | libexpat |
60 | |
61 | # JPEG conversion libraries and includes. |
62 | LOCAL_SHARED_LIBRARIES += \ |
63 | libjpeg \ |
64 | libcamera_metadata |
65 | |
66 | LOCAL_STATIC_LIBRARIES := \ |
67 | libyuv_static \ |
68 | |
69 | ifeq ($(GPU_TYPE),t83x) |
70 | LOCAL_CFLAGS += -DMALI_AFBC_GRALLOC=1 |
71 | else |
72 | LOCAL_CFLAGS += -DMALI_AFBC_GRALLOC=0 |
73 | endif |
74 | |
75 | MESON_GRALLOC_DIR ?= hardware/amlogic/gralloc |
76 | |
77 | LOCAL_C_INCLUDES += external/jpeg \ |
78 | external/jhead/ \ |
79 | frameworks/native/include/media/hardware \ |
80 | external/libyuv/files/include/ \ |
81 | $(TOP)/system/core/libion/include \ |
82 | $(TOP)/system/core/libion/kernel-headers \ |
83 | $(TOP)/$(MESON_GRALLOC_DIR) \ |
84 | $(LOCAL_PATH)/inc \ |
85 | $(call include-path-for, camera) \ |
86 | $(TOP)/external/expat/lib \ |
87 | |
88 | LOCAL_SRC_FILES := \ |
89 | EmulatedCameraHal.cpp \ |
90 | EmulatedCameraFactory.cpp \ |
91 | EmulatedCameraHotplugThread.cpp \ |
92 | EmulatedBaseCamera.cpp \ |
93 | EmulatedCamera.cpp \ |
94 | EmulatedCameraDevice.cpp \ |
95 | EmulatedQemuCamera.cpp \ |
96 | EmulatedQemuCameraDevice.cpp \ |
97 | EmulatedFakeCamera.cpp \ |
98 | EmulatedFakeCameraDevice.cpp \ |
99 | Converters.cpp \ |
100 | PreviewWindow.cpp \ |
101 | CallbackNotifier.cpp \ |
102 | QemuClient.cpp \ |
103 | JpegCompressor.cpp \ |
104 | fake-pipeline2/Scene.cpp \ |
105 | fake-pipeline2/Sensor.cpp \ |
106 | fake-pipeline2/ge2d_stream.cpp \ |
107 | fake-pipeline2/JpegCompressor.cpp \ |
108 | fake-pipeline2/NV12_resize.c \ |
109 | fake-pipeline2/util.c \ |
110 | EmulatedCamera3.cpp \ |
111 | EmulatedFakeCamera3.cpp \ |
112 | EmulatedFakeCamera3Info.cpp \ |
113 | fake-pipeline2/camera_hw.cpp \ |
114 | VendorTags.cpp \ |
115 | LoadXml.cpp \ |
116 | |
117 | ifeq ($(TARGET_PRODUCT),vbox_x86) |
118 | LOCAL_MODULE := camera.vbox_x86 |
119 | else |
120 | LOCAL_MODULE:= camera.amlogic |
121 | endif |
122 | |
123 | include $(BUILD_SHARED_LIBRARY) |
124 | |
125 | include $(call all-makefiles-under,$(LOCAL_PATH)) |
126 | |
127 | $(info ************************************************************) |
128 | |
129 | $(info pdk or not: $(TARGET_BUILD_PDK)) |
130 | $(info target board: $(TARGET_BOARD_PLATFORM)) |
131 | $(info git version: $(CAMHAL_GIT_VERSION)) |
132 | $(info uncomment: $(CAMHAL_GIT_UNCOMMIT_FILE_NUM) files) |
133 | $(info last changed: $(CAMHAL_LAST_CHANGED)) |
134 | $(info build time: $(CAMHAL_BUILD_TIME)) |
135 | $(info builder name: $(CAMHAL_BUILD_NAME)) |
136 | $(info branch name: $(CAMHAL_BRANCH_NAME)) |
137 | $(info build mode: $(CAMHAL_BUILD_MODE)) |
138 | $(info host name: $(CAMHAL_HOSTNAME)) |
139 | $(info host IP: $(CAMHAL_IP)) |
140 | $(info path: $(CAMHAL_PATH)) |
141 | $(info ************************************************************) |
142 | $(shell sleep 1) |
143 | |
144 | ################################################################# |
145 | ifneq (true,true) |
146 | |
147 | include $(CLEAR_VARS) |
148 | |
149 | LOCAL_MODULE_RELATIVE_PATH := hw |
150 | LOCAL_CFLAGS += -fno-short-enums -DQEMU_HARDWARE |
151 | LOCAL_CFLAGS += -Wno-unused-parameter |
152 | LOCAL_SHARED_LIBRARIES:= \ |
153 | libcutils \ |
154 | liblog \ |
155 | libskia \ |
156 | libandroid_runtime |
157 | |
158 | LOCAL_C_INCLUDES += external/jpeg \ |
159 | external/skia/include/core/ \ |
160 | frameworks/base/core/jni/android/graphics \ |
161 | frameworks/native/include |
162 | |
163 | LOCAL_SRC_FILES := JpegStub.cpp |
164 | |
165 | LOCAL_MODULE := camera.goldfish.jpeg |
166 | |
167 | include $(BUILD_SHARED_LIBRARY) |
168 | |
169 | endif # !PDK |
170 |