summaryrefslogtreecommitdiff
path: root/lib/Headers/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Headers/Makefile')
-rw-r--r--lib/Headers/Makefile21
1 files changed, 17 insertions, 4 deletions
diff --git a/lib/Headers/Makefile b/lib/Headers/Makefile
index cb36e84319a1..ebb83843cacd 100644
--- a/lib/Headers/Makefile
+++ b/lib/Headers/Makefile
@@ -7,10 +7,15 @@
#
##===----------------------------------------------------------------------===##
-LEVEL = ../../../..
-include $(LEVEL)/Makefile.common
+CLANG_LEVEL := ../..
-CLANG_VERSION := $(shell cat $(PROJ_SRC_DIR)/../../VER)
+BUILT_SOURCES = arm_neon.h.inc
+TABLEGEN_INC_FILES_COMMON = 1
+
+include $(CLANG_LEVEL)/Makefile
+
+CLANG_VERSION := $(word 3,$(shell grep "CLANG_VERSION " \
+ $(PROJ_OBJ_DIR)/$(CLANG_LEVEL)/include/clang/Basic/Version.inc))
HeaderDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/lib/clang/$(CLANG_VERSION)/include
@@ -19,7 +24,11 @@ HEADERS := $(notdir $(wildcard $(PROJ_SRC_DIR)/*.h))
OBJHEADERS := $(addprefix $(HeaderDir)/, $(HEADERS))
-$(OBJHEADERS): $(HeaderDir)/%.h: $(PROJ_SRC_DIR)/%.h $(HeaderDir)/.dir
+$(OBJHEADERS): $(HeaderDir)/%.h: $(PROJ_SRC_DIR)/%.h $(HeaderDir)/.dir $(HeaderDir)/arm_neon.h
+ $(Verb) cp $< $@
+ $(Echo) Copying $(notdir $<) to build dir
+
+$(HeaderDir)/arm_neon.h: $(BUILT_SOURCES) $(HeaderDir)/.dir
$(Verb) cp $< $@
$(Echo) Copying $(notdir $<) to build dir
@@ -38,3 +47,7 @@ $(INSTHEADERS): $(PROJ_headers)/%.h: $(HeaderDir)/%.h | $(PROJ_headers)
$(Echo) Installing compiler include file: $(notdir $<)
install-local:: $(INSTHEADERS)
+
+$(ObjDir)/arm_neon.h.inc.tmp : $(CLANG_LEVEL)/include/clang/Basic/arm_neon.td $(TBLGEN) $(ObjDir)/.dir
+ $(Echo) "Building Clang arm_neon.h.inc with tblgen"
+ $(Verb) $(TableGen) -gen-arm-neon -o $(call SYSPATH, $@) $<