r193515 - [libsanitizer] configure+make: install include/sanitizer into Clang

Alexander Potapenko glider at google.com
Mon Oct 28 01:21:36 PDT 2013


Author: glider
Date: Mon Oct 28 03:21:35 2013
New Revision: 193515

URL: http://llvm.org/viewvc/llvm-project?rev=193515&view=rev
Log:
[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


Modified:
    cfe/trunk/runtime/compiler-rt/Makefile

Modified: cfe/trunk/runtime/compiler-rt/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/runtime/compiler-rt/Makefile?rev=193515&r1=193514&r2=193515&view=diff
==============================================================================
--- cfe/trunk/runtime/compiler-rt/Makefile (original)
+++ cfe/trunk/runtime/compiler-rt/Makefile Mon Oct 28 03:21:35 2013
@@ -23,7 +23,9 @@ ResourceDir := $(PROJ_OBJ_ROOT)/$(BuildM
 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





More information about the cfe-commits mailing list