mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Remove duplication in Makefile.rules.
Merge common bits from the LLVMC and TABLEGEN sections. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65834 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
09c9ed4409
commit
1386ae4b0f
@ -208,7 +208,7 @@ endif
|
|||||||
|
|
||||||
# TableGen stuff...
|
# TableGen stuff...
|
||||||
ifneq ($(BUILT_SOURCES),)
|
ifneq ($(BUILT_SOURCES),)
|
||||||
BUILD_AUTOGENERATED_INC=1
|
LLVMC_BUILD_AUTOGENERATED_INC=1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
endif # LLVMC_PLUGIN
|
endif # LLVMC_PLUGIN
|
||||||
@ -1303,50 +1303,20 @@ $(ObjDir)/%.bc: %.ll $(ObjDir)/.dir $(LLVMAS)
|
|||||||
$(Echo) "Compiling $*.ll for $(BuildMode) build"
|
$(Echo) "Compiling $*.ll for $(BuildMode) build"
|
||||||
$(Verb) $(LLVMAS) $< -f -o $@
|
$(Verb) $(LLVMAS) $< -f -o $@
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# LLVMC: Provide rules for compiling llvmc plugins, pt. 2
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
ifdef BUILD_AUTOGENERATED_INC
|
|
||||||
|
|
||||||
# This needs to be in a separate section, otherwise we get an infinite loop:)
|
|
||||||
|
|
||||||
# This stuff is mostly copied from the TABLEGEN section below
|
|
||||||
# TODO: merge
|
|
||||||
|
|
||||||
LLVMCPluginSrc := $(strip $(wildcard $(PROJ_SRC_DIR)/*.td))
|
|
||||||
TDFiles := $(LLVMCPluginSrc) \
|
|
||||||
$(strip $(wildcard $(LLVM_SRC_ROOT)/include/llvm/CompilerDriver/*.td))
|
|
||||||
INCFiles := $(filter %.inc,$(BUILT_SOURCES))
|
|
||||||
INCTMPFiles := $(INCFiles:%=$(ObjDir)/%.tmp)
|
|
||||||
.PRECIOUS: $(INCTMPFiles) $(INCFiles)
|
|
||||||
|
|
||||||
# All of these files depend on tblgen and the .td files.
|
|
||||||
$(INCTMPFiles) : $(TBLGEN) $(TDFiles)
|
|
||||||
|
|
||||||
$(INCFiles) : %.inc : $(ObjDir)/%.inc.tmp
|
|
||||||
$(Verb) $(CMP) -s $@ $< || $(CP) $< $@
|
|
||||||
|
|
||||||
$(ObjDir)/AutoGenerated.inc.tmp: $(LLVMCPluginSrc) $(ObjDir)/.dir \
|
|
||||||
$(TBLGEN) $(TD_COMMON)
|
|
||||||
$(Echo) "Building LLVMC configuration library with tblgen"
|
|
||||||
$(Verb) $(TableGen) -gen-llvmc -o $(call SYSPATH, $@) $<
|
|
||||||
|
|
||||||
endif # BUILD_AUTOGENERATED_INC
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# TABLEGEN: Provide rules for running tblgen to produce *.inc files
|
# TABLEGEN: Provide rules for running tblgen to produce *.inc files
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
ifdef TARGET
|
ifdef TARGET
|
||||||
|
TABLEGEN_INC_FILES_COMMON = 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef LLVMC_BUILD_AUTOGENERATED_INC
|
||||||
|
TABLEGEN_INC_FILES_COMMON = 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef TABLEGEN_INC_FILES_COMMON
|
||||||
|
|
||||||
TDFiles := $(strip $(wildcard $(PROJ_SRC_DIR)/*.td) \
|
|
||||||
$(LLVM_SRC_ROOT)/include/llvm/Target/Target.td \
|
|
||||||
$(LLVM_SRC_ROOT)/include/llvm/Target/TargetCallingConv.td \
|
|
||||||
$(LLVM_SRC_ROOT)/include/llvm/Target/TargetSchedule.td \
|
|
||||||
$(LLVM_SRC_ROOT)/include/llvm/Target/TargetSelectionDAG.td \
|
|
||||||
$(LLVM_SRC_ROOT)/include/llvm/CodeGen/ValueTypes.td) \
|
|
||||||
$(wildcard $(LLVM_SRC_ROOT)/include/llvm/Intrinsics*.td)
|
|
||||||
INCFiles := $(filter %.inc,$(BUILT_SOURCES))
|
INCFiles := $(filter %.inc,$(BUILT_SOURCES))
|
||||||
INCTMPFiles := $(INCFiles:%=$(ObjDir)/%.tmp)
|
INCTMPFiles := $(INCFiles:%=$(ObjDir)/%.tmp)
|
||||||
.PRECIOUS: $(INCTMPFiles) $(INCFiles)
|
.PRECIOUS: $(INCTMPFiles) $(INCFiles)
|
||||||
@ -1363,6 +1333,18 @@ $(INCTMPFiles) : $(TBLGEN) $(TDFiles)
|
|||||||
$(INCFiles) : %.inc : $(ObjDir)/%.inc.tmp
|
$(INCFiles) : %.inc : $(ObjDir)/%.inc.tmp
|
||||||
$(Verb) $(CMP) -s $@ $< || $(CP) $< $@
|
$(Verb) $(CMP) -s $@ $< || $(CP) $< $@
|
||||||
|
|
||||||
|
endif # TABLEGEN_INC_FILES_COMMON
|
||||||
|
|
||||||
|
ifdef TARGET
|
||||||
|
|
||||||
|
TDFiles := $(strip $(wildcard $(PROJ_SRC_DIR)/*.td) \
|
||||||
|
$(LLVM_SRC_ROOT)/include/llvm/Target/Target.td \
|
||||||
|
$(LLVM_SRC_ROOT)/include/llvm/Target/TargetCallingConv.td \
|
||||||
|
$(LLVM_SRC_ROOT)/include/llvm/Target/TargetSchedule.td \
|
||||||
|
$(LLVM_SRC_ROOT)/include/llvm/Target/TargetSelectionDAG.td \
|
||||||
|
$(LLVM_SRC_ROOT)/include/llvm/CodeGen/ValueTypes.td) \
|
||||||
|
$(wildcard $(LLVM_SRC_ROOT)/include/llvm/Intrinsics*.td)
|
||||||
|
|
||||||
$(TARGET:%=$(ObjDir)/%GenRegisterNames.inc.tmp): \
|
$(TARGET:%=$(ObjDir)/%GenRegisterNames.inc.tmp): \
|
||||||
$(ObjDir)/%GenRegisterNames.inc.tmp : %.td $(ObjDir)/.dir
|
$(ObjDir)/%GenRegisterNames.inc.tmp : %.td $(ObjDir)/.dir
|
||||||
$(Echo) "Building $(<F) register names with tblgen"
|
$(Echo) "Building $(<F) register names with tblgen"
|
||||||
@ -1431,7 +1413,22 @@ $(ObjDir)/%GenIntrinsics.inc.tmp : Intrinsics%.td $(ObjDir)/.dir
|
|||||||
clean-local::
|
clean-local::
|
||||||
-$(Verb) $(RM) -f $(INCFiles)
|
-$(Verb) $(RM) -f $(INCFiles)
|
||||||
|
|
||||||
endif
|
endif # TARGET
|
||||||
|
|
||||||
|
ifdef LLVMC_BUILD_AUTOGENERATED_INC
|
||||||
|
|
||||||
|
LLVMCPluginSrc := $(strip $(wildcard $(PROJ_SRC_DIR)/*.td))
|
||||||
|
|
||||||
|
TDFiles := $(LLVMCPluginSrc) \
|
||||||
|
$(strip $(wildcard $(LLVM_SRC_ROOT)/include/llvm/CompilerDriver/*.td))
|
||||||
|
|
||||||
|
$(ObjDir)/AutoGenerated.inc.tmp: $(LLVMCPluginSrc) $(ObjDir)/.dir \
|
||||||
|
$(TBLGEN) $(TD_COMMON)
|
||||||
|
$(Echo) "Building LLVMC configuration library with tblgen"
|
||||||
|
$(Verb) $(TableGen) -gen-llvmc -o $(call SYSPATH, $@) $<
|
||||||
|
|
||||||
|
endif # LLVMC_BUILD_AUTOGENERATED_INC
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# OTHER RULES: Other rules needed
|
# OTHER RULES: Other rules needed
|
||||||
|
Loading…
Reference in New Issue
Block a user