aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/makefile/sub_makefiles/android/Makefile.in
blob: d9277ed60cb456208572ca1ad8df530648faef82 (plain)
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
#!/usr/bin/env bash
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# This sub Makefile compiles the TensorFlow Android Inference library. This is
# designed to be used as a sub Makefile with tensorflow/contrib/makefile/Makefile.
#
# You can build targets in this file by including this sub makefile like:
# $ make -f tensorflow/contrib/makefile/Makefile TARGET=ANDROID \
# SUB_MAKEFILES=\
# $(pwd)/tensorflow/contrib/makefile/sub_makefiles/android/Makefile.in \
# (optional: NDK_ROOT=<ndk_root>) libtensorflow_inference.so \
# libtensorflow_demo.so


# libtensorflow_inference.so:
# This library provides TensorFlow support on Android via the Java API and
# TensorFlowInferenceInterface.
# It should be packaged into the Android APK along with the Java counterparts
# under tensorflow/java and tensorflow/contrib/android/java.
INFERENCE_SRCS := \
tensorflow/c/tf_status_helper.cc \
tensorflow/c/checkpoint_reader.cc \
tensorflow/c/test_op.cc \
tensorflow/c/c_api.cc \
tensorflow/java/src/main/native/exception_jni.cc \
tensorflow/java/src/main/native/graph_jni.cc \
tensorflow/java/src/main/native/operation_builder_jni.cc \
tensorflow/java/src/main/native/operation_jni.cc \
tensorflow/java/src/main/native/session_jni.cc \
tensorflow/java/src/main/native/tensorflow_jni.cc \
tensorflow/java/src/main/native/tensor_jni.cc \
tensorflow/contrib/android/jni/run_stats_jni.cc

INFERENCE_OBJS := $(addprefix $(OBJDIR), $(INFERENCE_SRCS:.cc=.o))

INFERENCE_SO_NAME := libtensorflow_inference.so
INFERENCE_SO_PATH := $(LIBDIR)$(INFERENCE_SO_NAME)

$(INFERENCE_SO_PATH): $(LIB_OBJS) $(INFERENCE_OBJS) $(CUDA_LIB_DEPS)
	@mkdir -p $(dir $@)
	$(CXX) $(CXXFLAGS) $(INCLUDES) \
	-o $@ $(INFERENCE_OBJS) $(LIB_OBJS) $(TEGRA_LIBS) \
	$(LIBFLAGS) $(LDFLAGS) \
	-shared -Wl,-soname,$(INFERENCE_SO_NAME) \
	$(LIBS)

$(INFERENCE_SO_NAME): $(INFERENCE_SO_PATH)


# libtensorflow_demo.so:
# This library provides the additional native support necessary to run the
# Android TensorFlow demo. This includes image colorspace conversion and object
# tracking code. It does not provide any TensorFlow functionality itself.
DEMO_SRCS := \
tensorflow/examples/android/jni/imageutils_jni.cc \
tensorflow/examples/android/jni/object_tracking/frame_pair.cc \
tensorflow/examples/android/jni/object_tracking/image_neon.cc \
tensorflow/examples/android/jni/object_tracking/keypoint_detector.cc \
tensorflow/examples/android/jni/object_tracking/logging.cc \
tensorflow/examples/android/jni/object_tracking/object_detector.cc \
tensorflow/examples/android/jni/object_tracking/object_tracker.cc \
tensorflow/examples/android/jni/object_tracking/object_tracker_jni.cc \
tensorflow/examples/android/jni/object_tracking/optical_flow.cc \
tensorflow/examples/android/jni/object_tracking/time_log.cc \
tensorflow/examples/android/jni/object_tracking/tracked_object.cc \
tensorflow/examples/android/jni/object_tracking/utils_neon.cc \
tensorflow/examples/android/jni/rgb2yuv.cc \
tensorflow/examples/android/jni/yuv2rgb.cc

DEMO_OBJS := $(addprefix $(OBJDIR), $(DEMO_SRCS:.cc=.o))

DEMO_SO_NAME := libtensorflow_demo.so
DEMO_SO_PATH := $(LIBDIR)$(DEMO_SO_NAME)

CXXFLAGS += -DSTANDALONE_DEMO_LIB
$(DEMO_SO_PATH): $(DEMO_OBJS)
	@mkdir -p $(dir $@)
	$(CXX) $(CXXFLAGS) \
	-o $@ $(DEMO_OBJS) \
	$(LIBFLAGS) $(LDFLAGS) -shared $(LIBS)

$(DEMO_SO_NAME): $(DEMO_SO_PATH)