Make sure `make install` installs the headers into the appropriate location.

Hi samsonov, ddunbar,

http://llvm-reviews.chandlerc.com/D1959

CHANGE SINCE LAST DIFF
  http://llvm-reviews.chandlerc.com/D1959?vs=4993&id=5128#toc

Files:
  ../tools/clang/runtime/compiler-rt/Makefile

Index: ../tools/clang/runtime/compiler-rt/Makefile
===================================================================
--- ../tools/clang/runtime/compiler-rt/Makefile
+++ ../tools/clang/runtime/compiler-rt/Makefile
@@ -23,7 +23,9 @@
 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
@@ -136,7 +138,7 @@
 #
 # We build all the libraries in a single shot to avoid recursive make as much 
as
 # possible.
-BuildRuntimeLibraries:
+BuildRuntimeLibraries: $(ResourceIncludeDir)/sanitizer
        $(Verb) $(MAKE) -C $(COMPILERRT_SRC_ROOT) \
          ProjSrcRoot=$(COMPILERRT_SRC_ROOT) \
          ProjObjRoot=$(PROJ_OBJ_DIR) \
@@ -154,6 +156,13 @@
 $(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
@@ -203,6 +212,7 @@
        $(Echo) Installing compiler runtime library: $1/$$*
        $(Verb) $(DataInstall) $$< $(PROJ_resources_lib)/$1
 
+
 # Rule to install runtime libraries.
 RuntimeLibraryInstall.$1: \
                
$(RuntimeLibrary.$1.Configs:%=$(PROJ_resources_lib)/$1/libclang_rt.%)
@@ -210,9 +220,21 @@
 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.%)
+install-local:: $(RuntimeDirs:%=RuntimeLibraryInstall.% RuntimeHeaderInstall)
 clean-local:: CleanRuntimeLibraries
 
 endif
Index: ../tools/clang/runtime/compiler-rt/Makefile
===================================================================
--- ../tools/clang/runtime/compiler-rt/Makefile
+++ ../tools/clang/runtime/compiler-rt/Makefile
@@ -23,7 +23,9 @@
 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
@@ -136,7 +138,7 @@
 #
 # We build all the libraries in a single shot to avoid recursive make as much as
 # possible.
-BuildRuntimeLibraries:
+BuildRuntimeLibraries: $(ResourceIncludeDir)/sanitizer
 	$(Verb) $(MAKE) -C $(COMPILERRT_SRC_ROOT) \
 	  ProjSrcRoot=$(COMPILERRT_SRC_ROOT) \
 	  ProjObjRoot=$(PROJ_OBJ_DIR) \
@@ -154,6 +156,13 @@
 $(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
@@ -203,6 +212,7 @@
 	$(Echo) Installing compiler runtime library: $1/$$*
 	$(Verb) $(DataInstall) $$< $(PROJ_resources_lib)/$1
 
+
 # Rule to install runtime libraries.
 RuntimeLibraryInstall.$1: \
 		$(RuntimeLibrary.$1.Configs:%=$(PROJ_resources_lib)/$1/libclang_rt.%)
@@ -210,9 +220,21 @@
 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.%)
+install-local:: $(RuntimeDirs:%=RuntimeLibraryInstall.% RuntimeHeaderInstall)
 clean-local:: CleanRuntimeLibraries
 
 endif
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to