summaryrefslogtreecommitdiff
path: root/runtime/compiler-rt
diff options
context:
space:
mode:
authorAlexander Potapenko <glider@google.com>2013-10-28 08:21:35 +0000
committerAlexander Potapenko <glider@google.com>2013-10-28 08:21:35 +0000
commit0e7a1cf16c361cd247e31472c253663f6ae32feb (patch)
tree3af930e09a8ca25073a007c0070b80968337db79 /runtime/compiler-rt
parent9cf772554d75f0a370b34a853de9207be3a07890 (diff)
downloadclang-0e7a1cf16c361cd247e31472c253663f6ae32feb.tar.gz
[libsanitizer] configure+make: install include/sanitizer into Clang
When building Clang with compiler-rt, copy the contents of compiler-rt/include/sanitizer into lib/clang/3.4/include/sanitizer git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193515 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'runtime/compiler-rt')
-rw-r--r--runtime/compiler-rt/Makefile26
1 files changed, 24 insertions, 2 deletions
diff --git a/runtime/compiler-rt/Makefile b/runtime/compiler-rt/Makefile
index 96fb8fe7a4..c4d2ad0cf9 100644
--- a/runtime/compiler-rt/Makefile
+++ b/runtime/compiler-rt/Makefile
@@ -23,7 +23,9 @@ ResourceDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/lib/clang/$(CLANG_VERSION)
PROJ_resources := $(DESTDIR)$(PROJ_prefix)/lib/clang/$(CLANG_VERSION)
ResourceLibDir := $(ResourceDir)/lib
+ResourceIncludeDir := $(ResourceDir)/include
PROJ_resources_lib := $(PROJ_resources)/lib
+PROJ_resources_include := $(PROJ_resources)/include
# Expect compiler-rt to be in llvm/projects/compiler-rt
COMPILERRT_SRC_ROOT := $(LLVM_SRC_ROOT)/projects/compiler-rt
@@ -150,10 +152,18 @@ CleanRuntimeLibraries:
ProjObjRoot=$(PROJ_OBJ_DIR) \
clean
.PHONY: CleanRuntimeLibraries
+RuntimeHeader: $(ResourceIncludeDir)/sanitizer
$(PROJ_resources_lib):
$(Verb) $(MKDIR) $@
+$(ResourceIncludeDir):
+ $(Verb) $(MKDIR) $@
+
+$(ResourceIncludeDir)/sanitizer: $(ResourceIncludeDir)
+ $(Verb) $(MKDIR) $@
+ $(Verb) cp $(COMPILERRT_SRC_ROOT)/include/sanitizer/*.h $@
+
# Expand rules for copying/installing each individual library. We can't use
# implicit rules here because we need to match against multiple things.
define RuntimeLibraryTemplate
@@ -210,9 +220,21 @@ RuntimeLibraryInstall.$1: \
endef
$(foreach lib,$(RuntimeDirs), $(eval $(call RuntimeLibraryTemplate,$(lib))))
+$(PROJ_resources_include):
+ $(Verb) $(MKDIR) $@
+
+$(PROJ_resources_include)/sanitizer: $(ResourceIncludeDir)/sanitizer $(PROJ_resources_include)
+ $(Verb) $(MKDIR) $@
+ $(Echo) Installing compiler runtime headers
+ $(Verb) $(DataInstall) $(ResourceIncludeDir)/sanitizer/* \
+ $(PROJ_resources_include)/sanitizer
+
+RuntimeHeaderInstall: $(PROJ_resources_include)/sanitizer
+.PHONY: RuntimeHeaderInstall
+
# Hook into the standard Makefile rules.
-all-local:: $(RuntimeDirs:%=RuntimeLibrary.%)
-install-local:: $(RuntimeDirs:%=RuntimeLibraryInstall.%)
+all-local:: $(RuntimeDirs:%=RuntimeLibrary.%) RuntimeHeader
+install-local:: $(RuntimeDirs:%=RuntimeLibraryInstall.%) RuntimeHeaderInstall
clean-local:: CleanRuntimeLibraries
endif