@@ -23,7 +23,9 @@ ResourceDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/lib/clang/$(CLANG_VERSION)
23
23
PROJ_resources := $(DESTDIR )$(PROJ_prefix ) /lib/clang/$(CLANG_VERSION )
24
24
25
25
ResourceLibDir := $(ResourceDir ) /lib
26
+ ResourceIncludeDir := $(ResourceDir ) /include
26
27
PROJ_resources_lib := $(PROJ_resources ) /lib
28
+ PROJ_resources_include := $(PROJ_resources ) /include
27
29
28
30
# Expect compiler-rt to be in llvm/projects/compiler-rt
29
31
COMPILERRT_SRC_ROOT := $(LLVM_SRC_ROOT ) /projects/compiler-rt
@@ -150,10 +152,18 @@ CleanRuntimeLibraries:
150
152
ProjObjRoot=$(PROJ_OBJ_DIR ) \
151
153
clean
152
154
.PHONY : CleanRuntimeLibraries
155
+ RuntimeHeader : $(ResourceIncludeDir ) /sanitizer
153
156
154
157
$(PROJ_resources_lib ) :
155
158
$(Verb ) $(MKDIR ) $@
156
159
160
+ $(ResourceIncludeDir ) :
161
+ $(Verb ) $(MKDIR ) $@
162
+
163
+ $(ResourceIncludeDir ) /sanitizer : $(ResourceIncludeDir )
164
+ $(Verb ) $(MKDIR ) $@
165
+ $(Verb ) cp $(COMPILERRT_SRC_ROOT ) /include/sanitizer/* .h $@
166
+
157
167
# Expand rules for copying/installing each individual library. We can't use
158
168
# implicit rules here because we need to match against multiple things.
159
169
define RuntimeLibraryTemplate
@@ -210,9 +220,21 @@ RuntimeLibraryInstall.$1: \
210
220
endef
211
221
$(foreach lib,$(RuntimeDirs), $(eval $(call RuntimeLibraryTemplate,$(lib))))
212
222
223
+ $(PROJ_resources_include ) :
224
+ $(Verb ) $(MKDIR ) $@
225
+
226
+ $(PROJ_resources_include ) /sanitizer : $(ResourceIncludeDir ) /sanitizer $(PROJ_resources_include )
227
+ $(Verb ) $(MKDIR ) $@
228
+ $(Echo ) Installing compiler runtime headers
229
+ $(Verb ) $(DataInstall ) $(ResourceIncludeDir ) /sanitizer/* \
230
+ $(PROJ_resources_include)/sanitizer
231
+
232
+ RuntimeHeaderInstall : $(PROJ_resources_include ) /sanitizer
233
+ .PHONY : RuntimeHeaderInstall
234
+
213
235
# Hook into the standard Makefile rules.
214
- all-local :: $(RuntimeDirs:%=RuntimeLibrary.% )
215
- install-local :: $(RuntimeDirs:%=RuntimeLibraryInstall.% )
236
+ all-local :: $(RuntimeDirs:%=RuntimeLibrary.% ) RuntimeHeader
237
+ install-local :: $(RuntimeDirs:%=RuntimeLibraryInstall.% ) RuntimeHeaderInstall
216
238
clean-local :: CleanRuntimeLibraries
217
239
218
240
endif
0 commit comments