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