aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/makefile/sub_makefiles/hexagon_graph_execution/Makefile.in
blob: ccbbfa41324657cc7a9b812339fa5956270d36e3 (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
#!/usr/bin/env bash
# Copyright 2016 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 libraries under this directory. 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=<target> \
# SUB_MAKEFILES=\
# $(pwd)/tensorflow/contrib/makefile/sub_makefiles/hexagon_graph_execution/Makefile.in \
# (optional: NDK_ROOT=<ndk_root>) hexagon_graph_execution
# TODO(satok): Support more targets

GTEST_DIR := \
$(MAKEFILE_DIR)/downloads/googletest/googletest

GTEST_HEADERS = \
$(wildcard $(GTEST_DIR)/include/gtest/*.h) \
$(wildcard $(GTEST_DIR)/include/gtest/internal/*.h)

GTEST_SRCS := \
$(wildcard $(GTEST_DIR)/src/*.cc) \
$(wildcard $(GTEST_DIR)/src/*.h) \
$(GTEST_HEADERS)

# CAVEAT: We should disable TENSORFLOW_DISABLE_META while running
# quantized_matmul on Android because it crashes in
# MultiThreadGemm in tensorflow/core/kernels/meta_support.cc
# TODO(satok): Remove once it's fixed
CXXFLAGS += -DTENSORFLOW_DISABLE_META

# Declare __ANDROID_TYPES_FULL__ to enable required types for hvx
CXXFLAGS += -D__ANDROID_TYPES_FULL__

GRAPH_TRANSFER_SRCS := \
tensorflow/cc/framework/scope.cc \
tensorflow/cc/framework/ops.cc \
tensorflow/cc/ops/const_op.cc \
tensorflow/core/kernels/function_ops.cc \
tensorflow/core/kernels/hexagon/graph_transfer_utils.cc \
tensorflow/core/kernels/hexagon/graph_transferer.cc \
tensorflow/core/kernels/hexagon/hexagon_control_wrapper.cc \
tensorflow/core/kernels/hexagon/hexagon_ops_definitions.cc \
tensorflow/core/kernels/hexagon/hexagon_remote_fused_graph_executor_build.cc \
tensorflow/core/kernels/remote_fused_graph_execute_op.cc \
tensorflow/core/kernels/remote_fused_graph_execute_utils.cc \
tensorflow/core/ops/remote_fused_graph_ops.cc \
tensorflow/core/platform/posix/test.cc

GRAPH_EXECUTION_SRCS := \
$(GRAPH_TRANSFER_SRCS) \
tensorflow/core/kernels/hexagon/hexagon_graph_execution_test.cc \
tensorflow/contrib/makefile/test/test_main.cc

GRAPH_EXECUTION_OBJS := $(addprefix $(OBJDIR), $(GRAPH_EXECUTION_SRCS:.cc=.o))

GRAPH_EXECUTION_NAME := hexagon_graph_execution
GRAPH_EXECUTION_BIN_PATH := $(BINDIR)$(GRAPH_EXECUTION_NAME)

INCLUDES += \
-I$(MAKEFILE_DIR)/downloads/googletest/googletest/include

GRAPH_EXECUTION_INCLUDES := $(INCLUDES)

$(OBJDIR)gtest-all.o: $(GTEST_SRCS) $(GRAPH_EXECUTION_OBJS)
	$(CXX) $(CXXFLAGS) $(GRAPH_EXECUTION_INCLUDES) -I $(GTEST_DIR) -c \
	$(GTEST_DIR)/src/gtest-all.cc -o $@

$(LIBDIR)gtest.a: $(OBJDIR)gtest-all.o
	@mkdir -p $(dir $@)
	$(AR) $(ARFLAGS) $@ $^

$(GRAPH_EXECUTION_BIN_PATH): $(LIB_PATH) $(LIBDIR)gtest.a $(GRAPH_EXECUTION_OBJS)
	@mkdir -p $(dir $@)
	$(CXX) $(CXXFLAGS) $(GRAPH_EXECUTION_INCLUDES) \
		-o $(GRAPH_EXECUTION_BIN_PATH) $(GRAPH_EXECUTION_OBJS) \
		$(LIBFLAGS) $(LIB_PATH) $(LIBDIR)gtest.a $(LDFLAGS) $(LIBS)

$(GRAPH_EXECUTION_NAME): $(GRAPH_EXECUTION_BIN_PATH)