From 39e324505c380c9d449dc31d34629a9d470c765f Mon Sep 17 00:00:00 2001 From: Jason Zaman Date: Tue, 4 Sep 2018 15:01:22 +0800 Subject: Add //tensorflow:install_headers target Used to prepare all the header files so they can easily be installed into /usr/include when packaging TF. Signed-off-by: Jason Zaman --- tensorflow/BUILD | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'tensorflow/BUILD') diff --git a/tensorflow/BUILD b/tensorflow/BUILD index 661cba5ff0..768d4107d8 100644 --- a/tensorflow/BUILD +++ b/tensorflow/BUILD @@ -617,3 +617,31 @@ py_library( visibility = ["//visibility:public"], deps = ["//tensorflow/python:no_contrib"], ) + +genrule( + name = "install_headers", + srcs = [ + "//tensorflow/c:headers", + "//tensorflow/c/eager:headers", + "//tensorflow/cc:headers", + "//tensorflow/core:headers", + ], + outs = ["include"], + cmd = """ + mkdir $@ + for f in $(SRCS); do + d="$${f%/*}" + d="$${d#bazel-out*genfiles/}" + d="$${d#*external/eigen_archive/}" + + if [[ $${d} == *local_config_* ]]; then + continue + fi + + mkdir -p "$@/$${d}" + cp "$${f}" "$@/$${d}/" + done + """, + tags = ["manual"], + visibility = ["//visibility:public"], +) -- cgit v1.2.3