1 ##===- clang/lib/Headers/Makefile --------------------------*- Makefile -*-===## 2 # 3 # The LLVM Compiler Infrastructure 4 # 5 # This file is distributed under the University of Illinois Open Source 6 # License. See LICENSE.TXT for details. 7 # 8 ##===----------------------------------------------------------------------===## 9 10 CLANG_LEVEL := ../.. 11 12 BUILT_SOURCES = arm_neon.h.inc 13 TABLEGEN_INC_FILES_COMMON = 1 14 15 include $(CLANG_LEVEL)/Makefile 16 17 CLANG_VERSION := $(word 3,$(shell grep "CLANG_VERSION " \ 18 $(PROJ_OBJ_DIR)/$(CLANG_LEVEL)/include/clang/Basic/Version.inc)) 19 20 HeaderDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/lib/clang/$(CLANG_VERSION)/include 21 22 HEADERS := $(notdir $(wildcard $(PROJ_SRC_DIR)/*.h)) 23 24 OBJHEADERS := $(addprefix $(HeaderDir)/, $(HEADERS)) 25 26 27 $(OBJHEADERS): $(HeaderDir)/%.h: $(PROJ_SRC_DIR)/%.h $(HeaderDir)/.dir $(HeaderDir)/arm_neon.h 28 $(Verb) cp $< $@ 29 $(Echo) Copying $(notdir $<) to build dir 30 31 $(HeaderDir)/arm_neon.h: $(BUILT_SOURCES) $(HeaderDir)/.dir 32 $(Verb) cp $< $@ 33 $(Echo) Copying $(notdir $<) to build dir 34 35 $(HeaderDir)/module.modulemap: $(PROJ_SRC_DIR)/module.modulemap $(HeaderDir)/.dir 36 $(Verb) cp $< $@ 37 $(Echo) Copying $(notdir $<) to build dir 38 39 40 # Hook into the standard Makefile rules. 41 all-local:: $(OBJHEADERS) $(HeaderDir)/module.modulemap 42 43 PROJ_headers := $(DESTDIR)$(PROJ_prefix)/lib/clang/$(CLANG_VERSION)/include 44 45 INSTHEADERS := $(addprefix $(PROJ_headers)/, $(HEADERS)) 46 INSTHEADERS += $(PROJ_headers)/arm_neon.h 47 48 $(PROJ_headers): 49 $(Verb) $(MKDIR) $@ 50 51 $(INSTHEADERS): $(PROJ_headers)/%.h: $(HeaderDir)/%.h | $(PROJ_headers) 52 $(Verb) $(DataInstall) $< $(PROJ_headers) 53 $(Echo) Installing compiler include file: $(notdir $<) 54 55 $(PROJ_headers)/module.modulemap: $(HeaderDir)/module.modulemap | $(PROJ_headers) 56 $(Verb) $(DataInstall) $< $(PROJ_headers) 57 $(Echo) Installing compiler module map file: $(notdir $<) 58 59 60 install-local:: $(INSTHEADERS) $(PROJ_headers)/module.modulemap 61 62 $(ObjDir)/arm_neon.h.inc.tmp : $(CLANG_LEVEL)/include/clang/Basic/arm_neon.td $(CLANG_TBLGEN) $(ObjDir)/.dir 63 $(Echo) "Building Clang arm_neon.h.inc with tblgen" 64 $(Verb) $(ClangTableGen) -gen-arm-neon -o $(call SYSPATH, $@) $< 65