aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/quantization/Makefile.in
blob: 563639e5d752c8ab4419d77f3643a570e400e5f7 (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
#!/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/quantization/Makefile.in \
# (optional: NDK_ROOT=<ndk_root>) contrib_quantization_tests
# 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)

QUANTIZATION_TEST_SRCS := \
tensorflow/contrib/quantization/ops/math_ops.cc \
tensorflow/contrib/quantization/kernels/quantize_op.cc \
tensorflow/contrib/quantization/kernels/quantized_conv_ops.cc \
tensorflow/contrib/quantization/kernels/quantized_matmul_op.cc \
tensorflow/contrib/quantization/kernels/quantized_matmul_op_test.cc \
tensorflow/contrib/quantization/kernels/hexagon/quantized_matmul_op_for_hexagon_test.cc \
tensorflow/contrib/makefile/test/test_main.cc

QUANTIZATION_TEST_OBJS := $(addprefix $(OBJDIR), $(QUANTIZATION_TEST_SRCS:.cc=.o))

QUANTIZATION_TEST_NAME := contrib_quantization_tests
QUANTIZATION_TEST_BIN_PATH := $(BINDIR)$(QUANTIZATION_TEST_NAME)

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

QUANTIZATION_TEST_INCLUDES := $(INCLUDES)

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

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

$(QUANTIZATION_TEST_BIN_PATH): $(LIB_PATH) $(LIBDIR)gtest.a $(QUANTIZATION_TEST_OBJS)
	@mkdir -p $(dir $@)
	$(CXX) $(CXXFLAGS) $(QUANTIZATION_TEST_INCLUDES) \
	-o $(QUANTIZATION_TEST_BIN_PATH) $(QUANTIZATION_TEST_OBJS) \
	$(LIBFLAGS) $(LIB_PATH) $(LIBDIR)gtest.a $(LDFLAGS) $(LIBS)

$(QUANTIZATION_TEST_NAME): $(QUANTIZATION_TEST_BIN_PATH)