mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-25 14:32:53 +00:00
Remove dead code from the makefile build system.
Back in r140220 we removed the autoconf code that would set LLVMCC_OPTION since it was only used by the test-suite. This patch now removes code that would only be used if LLVMCC_OPTION was set. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187154 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cb420a4bc0
commit
1a9e24844f
247
Makefile.rules
247
Makefile.rules
@ -42,7 +42,7 @@ VPATH=$(PROJ_SRC_DIR)
|
||||
# Reset the list of suffixes we know how to build.
|
||||
#--------------------------------------------------------------------
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .cpp .cc .h .hpp .o .a .bc .td .ps .dot .ll .m .mm
|
||||
.SUFFIXES: .c .cpp .cc .h .hpp .o .a .td .ps .dot .m .mm
|
||||
.SUFFIXES: $(SHLIBEXT) $(SUFFIXES)
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
@ -500,27 +500,6 @@ ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
|
||||
endif
|
||||
endif
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# LLVM Capable Compiler
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
ifneq ($(findstring llvm-gcc,$(LLVMCC_OPTION)),)
|
||||
LLVMCC := $(LLVMGCC)
|
||||
LLVMCXX := $(LLVMGXX)
|
||||
else
|
||||
ifneq ($(findstring clang,$(LLVMCC_OPTION)),)
|
||||
ifneq ($(CLANGPATH),)
|
||||
LLVMCC := $(CLANGPATH)
|
||||
LLVMCXX := $(CLANGXXPATH)
|
||||
else
|
||||
ifeq ($(ENABLE_BUILT_CLANG),1)
|
||||
LLVMCC := $(LLVMToolDir)/clang
|
||||
LLVMCXX := $(LLVMToolDir)/clang++
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Full Paths To Compiled Tools and Utilities
|
||||
#--------------------------------------------------------------------
|
||||
@ -762,14 +741,9 @@ Link = $(Compile.Wrapper) \
|
||||
$(CXX) $(CXXFLAGS) $(LD.Flags) $(LDFLAGS) \
|
||||
$(TargetCommonOpts) $(Strip)
|
||||
|
||||
BCCompile.C = $(LLVMCC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
|
||||
$(TargetCommonOpts) $(CompileCommonOpts)
|
||||
Preprocess.C = $(CC) $(CPP.Flags) $(C.Flags) $(CPPFLAGS) \
|
||||
$(TargetCommonOpts) $(CompileCommonOpts) -E
|
||||
|
||||
BCCompile.CXX = $(LLVMCXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(CPPFLAGS) \
|
||||
$(TargetCommonOpts) $(CompileCommonOpts)
|
||||
|
||||
ProgInstall = $(INSTALL) $(Install.StripFlag) -m 0755
|
||||
ScriptInstall = $(INSTALL) -m 0755
|
||||
DataInstall = $(INSTALL) -m 0644
|
||||
@ -784,7 +758,6 @@ TableGen.Flags= -I $(call SYSPATH, $(PROJ_SRC_DIR)) \
|
||||
LLVMTableGen = $(LLVM_TBLGEN) $(TableGen.Flags)
|
||||
|
||||
Archive = $(AR) $(AR.Flags)
|
||||
LArchive = $(LLVMToolDir)/llvm-ar rcsf
|
||||
ifdef RANLIB
|
||||
Ranlib = $(RANLIB)
|
||||
else
|
||||
@ -812,7 +785,6 @@ endif
|
||||
BaseNameSources := $(sort $(basename $(Sources)))
|
||||
|
||||
ObjectsO := $(BaseNameSources:%=$(ObjDir)/%.o)
|
||||
ObjectsBC := $(BaseNameSources:%=$(ObjDir)/%.bc)
|
||||
|
||||
#----------------------------------------------------------
|
||||
# For Mingw MSYS bash and Python/w32:
|
||||
@ -1140,67 +1112,6 @@ endif
|
||||
# Library Build Rules: Four ways to build a library
|
||||
###############################################################################
|
||||
|
||||
#---------------------------------------------------------
|
||||
# Bytecode Module Targets:
|
||||
# If the user set MODULE_NAME then they want to build a
|
||||
# bytecode module from the sources. We compile all the
|
||||
# sources and link it together into a single bytecode
|
||||
# module.
|
||||
#---------------------------------------------------------
|
||||
|
||||
ifdef MODULE_NAME
|
||||
ifeq ($(strip $(LLVMCC)),)
|
||||
$(warning Modules require LLVM capable compiler but none is available ****)
|
||||
else
|
||||
|
||||
Module := $(LibDir)/$(MODULE_NAME).bc
|
||||
LinkModule := $(LLVMLINK)
|
||||
|
||||
|
||||
ifdef EXPORTED_SYMBOL_FILE
|
||||
LinkModule += -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
|
||||
endif
|
||||
|
||||
$(Module): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(LLVMLINK)
|
||||
$(Echo) Building $(BuildMode) Bytecode Module $(notdir $@)
|
||||
$(Verb) $(LinkModule) -o $@ $(ObjectsBC)
|
||||
|
||||
all-local:: $(Module)
|
||||
|
||||
clean-local::
|
||||
ifneq ($(strip $(Module)),)
|
||||
-$(Verb) $(RM) -f $(Module)
|
||||
endif
|
||||
|
||||
ifdef BYTECODE_DESTINATION
|
||||
ModuleDestDir := $(BYTECODE_DESTINATION)
|
||||
else
|
||||
ModuleDestDir := $(DESTDIR)$(PROJ_libdir)
|
||||
endif
|
||||
|
||||
ifdef NO_INSTALL
|
||||
install-local::
|
||||
$(Echo) Install circumvented with NO_INSTALL
|
||||
uninstall-local::
|
||||
$(Echo) Uninstall circumvented with NO_INSTALL
|
||||
else
|
||||
DestModule := $(ModuleDestDir)/$(MODULE_NAME).bc
|
||||
|
||||
install-module:: $(DestModule)
|
||||
install-local:: $(DestModule)
|
||||
|
||||
$(DestModule): $(ModuleDestDir) $(Module)
|
||||
$(Echo) Installing $(BuildMode) Bytecode Module $(DestModule)
|
||||
$(Verb) $(DataInstall) $(Module) $(DestModule)
|
||||
|
||||
uninstall-local::
|
||||
$(Echo) Uninstalling $(BuildMode) Bytecode Module $(DestModule)
|
||||
-$(Verb) $(RM) -f $(DestModule)
|
||||
endif
|
||||
|
||||
endif
|
||||
endif
|
||||
|
||||
# if we're building a library ...
|
||||
ifdef LIBRARYNAME
|
||||
|
||||
@ -1216,7 +1127,6 @@ endif
|
||||
LibName.A := $(LibDir)/$(BaseLibName.A)
|
||||
LibName.SO := $(SharedLibDir)/$(BaseLibName.SO)
|
||||
LibName.O := $(LibDir)/$(LIBRARYNAME).o
|
||||
LibName.BCA:= $(LibDir)/lib$(LIBRARYNAME).bca
|
||||
|
||||
#---------------------------------------------------------
|
||||
# Shared Library Targets:
|
||||
@ -1282,72 +1192,6 @@ uninstall-local::
|
||||
endif
|
||||
endif
|
||||
|
||||
#---------------------------------------------------------
|
||||
# Bytecode Library Targets:
|
||||
# If the user asked for a bytecode library to be built
|
||||
# with the BYTECODE_LIBRARY variable, then we provide
|
||||
# targets for building them.
|
||||
#---------------------------------------------------------
|
||||
ifdef BYTECODE_LIBRARY
|
||||
ifeq ($(strip $(LLVMCC)),)
|
||||
$(warning Bytecode libraries require LLVM capable compiler but none is available ****)
|
||||
else
|
||||
|
||||
all-local:: $(LibName.BCA)
|
||||
|
||||
ifdef EXPORTED_SYMBOL_FILE
|
||||
BCLinkLib = $(LLVMLINK) -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
|
||||
|
||||
$(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir $(LLVMLINK) \
|
||||
$(LLVMToolDir)/llvm-ar
|
||||
$(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@) \
|
||||
"(internalize)"
|
||||
$(Verb) $(BCLinkLib) -o $(ObjDir)/$(LIBRARYNAME).internalize $(ObjectsBC)
|
||||
$(Verb) $(RM) -f $@
|
||||
$(Verb) $(LArchive) $@ $(ObjDir)/$(LIBRARYNAME).internalize.bc
|
||||
else
|
||||
$(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir \
|
||||
$(LLVMToolDir)/llvm-ar
|
||||
$(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@)
|
||||
$(Verb) $(RM) -f $@
|
||||
$(Verb) $(LArchive) $@ $(ObjectsBC)
|
||||
|
||||
endif
|
||||
|
||||
clean-local::
|
||||
ifneq ($(strip $(LibName.BCA)),)
|
||||
-$(Verb) $(RM) -f $(LibName.BCA)
|
||||
endif
|
||||
|
||||
ifdef BYTECODE_DESTINATION
|
||||
BytecodeDestDir := $(BYTECODE_DESTINATION)
|
||||
else
|
||||
BytecodeDestDir := $(DESTDIR)$(PROJ_libdir)
|
||||
endif
|
||||
|
||||
DestBytecodeLib = $(BytecodeDestDir)/lib$(LIBRARYNAME).bca
|
||||
|
||||
install-bytecode-local:: $(DestBytecodeLib)
|
||||
|
||||
ifdef NO_INSTALL
|
||||
install-local::
|
||||
$(Echo) Install circumvented with NO_INSTALL
|
||||
uninstall-local::
|
||||
$(Echo) Uninstall circumvented with NO_INSTALL
|
||||
else
|
||||
install-local:: $(DestBytecodeLib)
|
||||
|
||||
$(DestBytecodeLib): $(LibName.BCA) $(BytecodeDestDir)
|
||||
$(Echo) Installing $(BuildMode) Bytecode Archive $(DestBytecodeLib)
|
||||
$(Verb) $(DataInstall) $(LibName.BCA) $(DestBytecodeLib)
|
||||
|
||||
uninstall-local::
|
||||
$(Echo) Uninstalling $(BuildMode) Bytecode Archive $(DestBytecodeLib)
|
||||
-$(Verb) $(RM) -f $(DestBytecodeLib)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
#---------------------------------------------------------
|
||||
# Library Targets:
|
||||
# If neither BUILD_ARCHIVE or LOADABLE_MODULE are specified, default to
|
||||
@ -1635,48 +1479,6 @@ $(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
|
||||
$(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
|
||||
$(DEPEND_MOVEFILE)
|
||||
|
||||
#---------------------------------------------------------
|
||||
# Create .bc files in the ObjDir directory from .cpp .cc and .c files...
|
||||
#---------------------------------------------------------
|
||||
|
||||
BC_DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.bc.d.tmp" \
|
||||
-MT "$(ObjDir)/$*.ll" -MT "$(ObjDir)/$*.bc.d"
|
||||
|
||||
# If the build succeeded, move the dependency file over, otherwise
|
||||
# remove it.
|
||||
BC_DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.bc.d.tmp" "$(ObjDir)/$*.bc.d"; \
|
||||
else $(RM) "$(ObjDir)/$*.bc.d.tmp"; exit 1; fi
|
||||
|
||||
$(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
|
||||
$(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
|
||||
$(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
|
||||
$< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
|
||||
$(BC_DEPEND_MOVEFILE)
|
||||
|
||||
$(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
|
||||
$(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)"
|
||||
$(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
|
||||
$< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
|
||||
$(BC_DEPEND_MOVEFILE)
|
||||
|
||||
$(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
|
||||
$(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
|
||||
$(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
|
||||
$< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
|
||||
$(BC_DEPEND_MOVEFILE)
|
||||
|
||||
$(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
|
||||
$(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
|
||||
$(Verb) if $(BCCompile.C) $(BC_DEPEND_OPTIONS) \
|
||||
$< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
|
||||
$(BC_DEPEND_MOVEFILE)
|
||||
|
||||
$(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
|
||||
$(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)"
|
||||
$(Verb) if $(BCCompile.C) $(BC_DEPEND_OPTIONS) \
|
||||
$< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
|
||||
$(BC_DEPEND_MOVEFILE)
|
||||
|
||||
# Provide alternate rule sets if dependencies are disabled
|
||||
else
|
||||
|
||||
@ -1699,27 +1501,6 @@ $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
|
||||
$(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
|
||||
$(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG)
|
||||
$(Compile.C) $< -o $@
|
||||
|
||||
$(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
|
||||
$(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
|
||||
$(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
|
||||
|
||||
$(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
|
||||
$(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)"
|
||||
$(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
|
||||
|
||||
$(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
|
||||
$(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
|
||||
$(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
|
||||
|
||||
$(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
|
||||
$(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
|
||||
$(BCCompile.C) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
|
||||
|
||||
$(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
|
||||
$(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)"
|
||||
$(BCCompile.C) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
|
||||
|
||||
endif
|
||||
|
||||
|
||||
@ -1765,27 +1546,6 @@ $(ObjDir)/%.s: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
|
||||
$(Echo) "Compiling $*.m to asm for $(BuildMode) build" $(PIC_FLAG)
|
||||
$(Compile.C) $< -o $@ -S
|
||||
|
||||
|
||||
# make the C and C++ compilers strip debug info out of bytecode libraries.
|
||||
ifdef DEBUG_RUNTIME
|
||||
$(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
|
||||
$(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
|
||||
$(Verb) $(LOPT) $< -std-compile-opts -o $@
|
||||
else
|
||||
$(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
|
||||
$(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
|
||||
$(Verb) $(LOPT) $< -std-compile-opts -strip-debug -o $@
|
||||
endif
|
||||
|
||||
|
||||
#---------------------------------------------------------
|
||||
# Provide rule to build .bc files from .ll sources,
|
||||
# regardless of dependencies
|
||||
#---------------------------------------------------------
|
||||
$(ObjDir)/%.bc: %.ll $(ObjDir)/.dir $(LLVMAS)
|
||||
$(Echo) "Compiling $*.ll for $(BuildMode) build"
|
||||
$(Verb) $(LLVMAS) $< -f -o $@
|
||||
|
||||
###############################################################################
|
||||
# TABLEGEN: Provide rules for running tblgen to produce *.inc files
|
||||
###############################################################################
|
||||
@ -1953,11 +1713,6 @@ ifndef IS_CLEANING_TARGET
|
||||
DependSourceFiles := $(basename $(filter %.cpp %.c %.cc %.m %.mm, $(Sources)))
|
||||
DependFiles := $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.d)
|
||||
|
||||
# Include bitcode dependency files if using bitcode libraries
|
||||
ifdef BYTECODE_LIBRARY
|
||||
DependFiles += $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.bc.d)
|
||||
endif
|
||||
|
||||
-include $(DependFiles) ""
|
||||
|
||||
endif
|
||||
|
@ -172,26 +172,6 @@ intend to be loaded into an tool via the ``-load`` option. `Pass documentation
|
||||
<writing-an-llvm-pass-makefile>`_ has an example of why you might want to do
|
||||
this.
|
||||
|
||||
Bitcode Modules
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
In some situations, it is desirable to build a single bitcode module from a
|
||||
variety of sources, instead of an archive, shared library, or bitcode
|
||||
library. Bitcode modules can be specified in addition to any of the other types
|
||||
of libraries by defining the `MODULE_NAME`_ variable. For example:
|
||||
|
||||
.. code-block:: makefile
|
||||
|
||||
LIBRARYNAME = mylib
|
||||
BYTECODE_LIBRARY = 1
|
||||
MODULE_NAME = mymod
|
||||
|
||||
will build a module named ``mymod.bc`` from the sources in the directory. This
|
||||
module will be an aggregation of all the bitcode modules derived from the
|
||||
sources. The example will also build a bitcode archive containing a bitcode
|
||||
module for each compiled source file. The difference is subtle, but important
|
||||
depending on how the module or library is to be linked.
|
||||
|
||||
Loadable Modules
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
@ -486,9 +466,6 @@ system that tell it what to do for the current directory.
|
||||
files. These sources will be built before any other target processing to
|
||||
ensure they are present.
|
||||
|
||||
``BYTECODE_LIBRARY``
|
||||
If set to any value, causes a bitcode library (.bc) to be built.
|
||||
|
||||
``CONFIG_FILES``
|
||||
Specifies a set of configuration files to be installed.
|
||||
|
||||
@ -590,13 +567,6 @@ system that tell it what to do for the current directory.
|
||||
setting this variable without also setting ``SHARED_LIBRARY`` will have no
|
||||
effect.
|
||||
|
||||
.. _MODULE_NAME:
|
||||
|
||||
``MODULE_NAME``
|
||||
Specifies the name of a bitcode module to be created. A bitcode module can
|
||||
be specified in conjunction with other kinds of library builds or by
|
||||
itself. It constructs from the sources a single linked bitcode file.
|
||||
|
||||
``NO_INSTALL``
|
||||
Specifies that the build products of the directory should not be installed
|
||||
but should be built even if the ``install`` target is given. This is handy
|
||||
@ -739,12 +709,6 @@ The override variables are given below:
|
||||
``LLVMAS`` (defaulted)
|
||||
Specifies the path to the ``llvm-as`` tool.
|
||||
|
||||
``LLVMCC``
|
||||
Specifies the path to the LLVM capable compiler.
|
||||
|
||||
``LLVMCXX``
|
||||
Specifies the path to the LLVM C++ capable compiler.
|
||||
|
||||
``LLVMGCC`` (defaulted)
|
||||
Specifies the path to the LLVM version of the GCC 'C' Compiler.
|
||||
|
||||
@ -888,8 +852,6 @@ internal. You should not use these variables under any circumstances.
|
||||
Archive
|
||||
AR.Flags
|
||||
BaseNameSources
|
||||
BCCompile.C
|
||||
BCCompile.CXX
|
||||
BCLinkLib
|
||||
C.Flags
|
||||
Compile.C
|
||||
@ -936,7 +898,6 @@ internal. You should not use these variables under any circumstances.
|
||||
LLVMUsedLibs
|
||||
LocalTargets
|
||||
Module
|
||||
ObjectsBC
|
||||
ObjectsLO
|
||||
ObjectsO
|
||||
ObjMakefiles
|
||||
|
@ -42,7 +42,7 @@ VPATH=$(PROJ_SRC_DIR)
|
||||
# Reset the list of suffixes we know how to build.
|
||||
#--------------------------------------------------------------------
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .cpp .cc .h .hpp .o .a .bc .td .ps .dot .ll .m .mm
|
||||
.SUFFIXES: .c .cpp .cc .h .hpp .o .a .td .ps .dot .m .mm
|
||||
.SUFFIXES: $(SHLIBEXT) $(SUFFIXES)
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
@ -437,27 +437,6 @@ ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
|
||||
endif
|
||||
endif
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# LLVM Capable Compiler
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
ifneq ($(findstring llvm-gcc,$(LLVMCC_OPTION)),)
|
||||
LLVMCC := $(LLVMGCC)
|
||||
LLVMCXX := $(LLVMGXX)
|
||||
else
|
||||
ifneq ($(findstring clang,$(LLVMCC_OPTION)),)
|
||||
ifneq ($(CLANGPATH),)
|
||||
LLVMCC := $(CLANGPATH)
|
||||
LLVMCXX := $(CLANGXXPATH)
|
||||
else
|
||||
ifeq ($(ENABLE_BUILT_CLANG),1)
|
||||
LLVMCC := $(LLVMToolDir)/clang
|
||||
LLVMCXX := $(LLVMToolDir)/clang++
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Full Paths To Compiled Tools and Utilities
|
||||
#--------------------------------------------------------------------
|
||||
@ -690,14 +669,9 @@ else
|
||||
$(LDFLAGS) $(TargetCommonOpts) $(CompileCommonOpts) $(Strip)
|
||||
endif
|
||||
|
||||
BCCompile.C = $(LLVMCC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
|
||||
$(TargetCommonOpts) $(CompileCommonOpts)
|
||||
Preprocess.C = $(CC) $(CPP.Flags) $(C.Flags) $(CPPFLAGS) \
|
||||
$(TargetCommonOpts) $(CompileCommonOpts) -E
|
||||
|
||||
BCCompile.CXX = $(LLVMCXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(CPPFLAGS) \
|
||||
$(TargetCommonOpts) $(CompileCommonOpts)
|
||||
|
||||
ProgInstall = $(INSTALL) $(Install.StripFlag) -m 0755
|
||||
ScriptInstall = $(INSTALL) -m 0755
|
||||
DataInstall = $(INSTALL) -m 0644
|
||||
@ -712,7 +686,6 @@ TableGen.Flags= -I $(call SYSPATH, $(PROJ_SRC_DIR)) \
|
||||
LLVMTableGen = $(LLVM_TBLGEN) $(TableGen.Flags)
|
||||
|
||||
Archive = $(AR) $(AR.Flags)
|
||||
LArchive = $(LLVMToolDir)/llvm-ar rcsf
|
||||
ifdef RANLIB
|
||||
Ranlib = $(RANLIB)
|
||||
else
|
||||
@ -740,7 +713,6 @@ endif
|
||||
BaseNameSources := $(sort $(basename $(Sources)))
|
||||
|
||||
ObjectsO := $(BaseNameSources:%=$(ObjDir)/%.o)
|
||||
ObjectsBC := $(BaseNameSources:%=$(ObjDir)/%.bc)
|
||||
|
||||
#----------------------------------------------------------
|
||||
# For Mingw MSYS bash and Python/w32:
|
||||
@ -1061,67 +1033,6 @@ endif
|
||||
# Library Build Rules: Four ways to build a library
|
||||
###############################################################################
|
||||
|
||||
#---------------------------------------------------------
|
||||
# Bytecode Module Targets:
|
||||
# If the user set MODULE_NAME then they want to build a
|
||||
# bytecode module from the sources. We compile all the
|
||||
# sources and link it together into a single bytecode
|
||||
# module.
|
||||
#---------------------------------------------------------
|
||||
|
||||
ifdef MODULE_NAME
|
||||
ifeq ($(strip $(LLVMCC)),)
|
||||
$(warning Modules require LLVM capable compiler but none is available ****)
|
||||
else
|
||||
|
||||
Module := $(LibDir)/$(MODULE_NAME).bc
|
||||
LinkModule := $(LLVMLD) -r
|
||||
|
||||
|
||||
ifdef EXPORTED_SYMBOL_FILE
|
||||
LinkModule += -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
|
||||
endif
|
||||
|
||||
$(Module): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(LLVMLD)
|
||||
$(Echo) Building $(BuildMode) Bytecode Module $(notdir $@)
|
||||
$(Verb) $(LinkModule) -o $@ $(ObjectsBC)
|
||||
|
||||
all-local:: $(Module)
|
||||
|
||||
clean-local::
|
||||
ifneq ($(strip $(Module)),)
|
||||
-$(Verb) $(RM) -f $(Module)
|
||||
endif
|
||||
|
||||
ifdef BYTECODE_DESTINATION
|
||||
ModuleDestDir := $(BYTECODE_DESTINATION)
|
||||
else
|
||||
ModuleDestDir := $(DESTDIR)$(PROJ_libdir)
|
||||
endif
|
||||
|
||||
ifdef NO_INSTALL
|
||||
install-local::
|
||||
$(Echo) Install circumvented with NO_INSTALL
|
||||
uninstall-local::
|
||||
$(Echo) Uninstall circumvented with NO_INSTALL
|
||||
else
|
||||
DestModule := $(ModuleDestDir)/$(MODULE_NAME).bc
|
||||
|
||||
install-module:: $(DestModule)
|
||||
install-local:: $(DestModule)
|
||||
|
||||
$(DestModule): $(ModuleDestDir) $(Module)
|
||||
$(Echo) Installing $(BuildMode) Bytecode Module $(DestModule)
|
||||
$(Verb) $(DataInstall) $(Module) $(DestModule)
|
||||
|
||||
uninstall-local::
|
||||
$(Echo) Uninstalling $(BuildMode) Bytecode Module $(DestModule)
|
||||
-$(Verb) $(RM) -f $(DestModule)
|
||||
endif
|
||||
|
||||
endif
|
||||
endif
|
||||
|
||||
# if we're building a library ...
|
||||
ifdef LIBRARYNAME
|
||||
|
||||
@ -1137,7 +1048,6 @@ endif
|
||||
LibName.A := $(LibDir)/$(BaseLibName.A)
|
||||
LibName.SO := $(SharedLibDir)/$(BaseLibName.SO)
|
||||
LibName.O := $(LibDir)/$(LIBRARYNAME).o
|
||||
LibName.BCA:= $(LibDir)/lib$(LIBRARYNAME).bca
|
||||
|
||||
#---------------------------------------------------------
|
||||
# Shared Library Targets:
|
||||
@ -1203,72 +1113,6 @@ uninstall-local::
|
||||
endif
|
||||
endif
|
||||
|
||||
#---------------------------------------------------------
|
||||
# Bytecode Library Targets:
|
||||
# If the user asked for a bytecode library to be built
|
||||
# with the BYTECODE_LIBRARY variable, then we provide
|
||||
# targets for building them.
|
||||
#---------------------------------------------------------
|
||||
ifdef BYTECODE_LIBRARY
|
||||
ifeq ($(strip $(LLVMCC)),)
|
||||
$(warning Bytecode libraries require LLVM capable compiler but none is available ****)
|
||||
else
|
||||
|
||||
all-local:: $(LibName.BCA)
|
||||
|
||||
ifdef EXPORTED_SYMBOL_FILE
|
||||
BCLinkLib = $(LLVMLD) -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
|
||||
|
||||
$(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir $(LLVMLD) \
|
||||
$(LLVMToolDir)/llvm-ar
|
||||
$(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@) \
|
||||
"(internalize)"
|
||||
$(Verb) $(BCLinkLib) -o $(ObjDir)/$(LIBRARYNAME).internalize $(ObjectsBC)
|
||||
$(Verb) $(RM) -f $@
|
||||
$(Verb) $(LArchive) $@ $(ObjDir)/$(LIBRARYNAME).internalize.bc
|
||||
else
|
||||
$(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir \
|
||||
$(LLVMToolDir)/llvm-ar
|
||||
$(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@)
|
||||
$(Verb) $(RM) -f $@
|
||||
$(Verb) $(LArchive) $@ $(ObjectsBC)
|
||||
|
||||
endif
|
||||
|
||||
clean-local::
|
||||
ifneq ($(strip $(LibName.BCA)),)
|
||||
-$(Verb) $(RM) -f $(LibName.BCA)
|
||||
endif
|
||||
|
||||
ifdef BYTECODE_DESTINATION
|
||||
BytecodeDestDir := $(BYTECODE_DESTINATION)
|
||||
else
|
||||
BytecodeDestDir := $(DESTDIR)$(PROJ_libdir)
|
||||
endif
|
||||
|
||||
DestBytecodeLib = $(BytecodeDestDir)/lib$(LIBRARYNAME).bca
|
||||
|
||||
install-bytecode-local:: $(DestBytecodeLib)
|
||||
|
||||
ifdef NO_INSTALL
|
||||
install-local::
|
||||
$(Echo) Install circumvented with NO_INSTALL
|
||||
uninstall-local::
|
||||
$(Echo) Uninstall circumvented with NO_INSTALL
|
||||
else
|
||||
install-local:: $(DestBytecodeLib)
|
||||
|
||||
$(DestBytecodeLib): $(LibName.BCA) $(BytecodeDestDir)
|
||||
$(Echo) Installing $(BuildMode) Bytecode Archive $(DestBytecodeLib)
|
||||
$(Verb) $(DataInstall) $(LibName.BCA) $(DestBytecodeLib)
|
||||
|
||||
uninstall-local::
|
||||
$(Echo) Uninstalling $(BuildMode) Bytecode Archive $(DestBytecodeLib)
|
||||
-$(Verb) $(RM) -f $(DestBytecodeLib)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
#---------------------------------------------------------
|
||||
# Library Targets:
|
||||
# If neither BUILD_ARCHIVE or LOADABLE_MODULE are specified, default to
|
||||
@ -1536,48 +1380,6 @@ $(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
|
||||
$(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
|
||||
$(DEPEND_MOVEFILE)
|
||||
|
||||
#---------------------------------------------------------
|
||||
# Create .bc files in the ObjDir directory from .cpp .cc and .c files...
|
||||
#---------------------------------------------------------
|
||||
|
||||
BC_DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.bc.d.tmp" \
|
||||
-MT "$(ObjDir)/$*.ll" -MT "$(ObjDir)/$*.bc.d"
|
||||
|
||||
# If the build succeeded, move the dependency file over, otherwise
|
||||
# remove it.
|
||||
BC_DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.bc.d.tmp" "$(ObjDir)/$*.bc.d"; \
|
||||
else $(RM) "$(ObjDir)/$*.bc.d.tmp"; exit 1; fi
|
||||
|
||||
$(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
|
||||
$(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
|
||||
$(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
|
||||
$< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
|
||||
$(BC_DEPEND_MOVEFILE)
|
||||
|
||||
$(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
|
||||
$(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)"
|
||||
$(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
|
||||
$< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
|
||||
$(BC_DEPEND_MOVEFILE)
|
||||
|
||||
$(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
|
||||
$(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
|
||||
$(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
|
||||
$< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
|
||||
$(BC_DEPEND_MOVEFILE)
|
||||
|
||||
$(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
|
||||
$(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
|
||||
$(Verb) if $(BCCompile.C) $(BC_DEPEND_OPTIONS) \
|
||||
$< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
|
||||
$(BC_DEPEND_MOVEFILE)
|
||||
|
||||
$(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
|
||||
$(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)"
|
||||
$(Verb) if $(BCCompile.C) $(BC_DEPEND_OPTIONS) \
|
||||
$< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
|
||||
$(BC_DEPEND_MOVEFILE)
|
||||
|
||||
# Provide alternate rule sets if dependencies are disabled
|
||||
else
|
||||
|
||||
@ -1600,27 +1402,6 @@ $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
|
||||
$(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
|
||||
$(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG)
|
||||
$(Compile.C) $< -o $@
|
||||
|
||||
$(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
|
||||
$(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
|
||||
$(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
|
||||
|
||||
$(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
|
||||
$(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)"
|
||||
$(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
|
||||
|
||||
$(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
|
||||
$(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
|
||||
$(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
|
||||
|
||||
$(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
|
||||
$(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
|
||||
$(BCCompile.C) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
|
||||
|
||||
$(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
|
||||
$(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)"
|
||||
$(BCCompile.C) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
|
||||
|
||||
endif
|
||||
|
||||
|
||||
@ -1666,27 +1447,6 @@ $(ObjDir)/%.s: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
|
||||
$(Echo) "Compiling $*.m to asm for $(BuildMode) build" $(PIC_FLAG)
|
||||
$(Compile.C) $< -o $@ -S
|
||||
|
||||
|
||||
# make the C and C++ compilers strip debug info out of bytecode libraries.
|
||||
ifdef DEBUG_RUNTIME
|
||||
$(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
|
||||
$(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
|
||||
$(Verb) $(LOPT) $< -std-compile-opts -o $@
|
||||
else
|
||||
$(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
|
||||
$(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
|
||||
$(Verb) $(LOPT) $< -std-compile-opts -strip-debug -o $@
|
||||
endif
|
||||
|
||||
|
||||
#---------------------------------------------------------
|
||||
# Provide rule to build .bc files from .ll sources,
|
||||
# regardless of dependencies
|
||||
#---------------------------------------------------------
|
||||
$(ObjDir)/%.bc: %.ll $(ObjDir)/.dir $(LLVMAS)
|
||||
$(Echo) "Compiling $*.ll for $(BuildMode) build"
|
||||
$(Verb) $(LLVMAS) $< -f -o $@
|
||||
|
||||
###############################################################################
|
||||
# TABLEGEN: Provide rules for running tblgen to produce *.inc files
|
||||
###############################################################################
|
||||
@ -1857,11 +1617,6 @@ ifndef IS_CLEANING_TARGET
|
||||
DependSourceFiles := $(basename $(filter %.cpp %.c %.cc %.m %.mm, $(Sources)))
|
||||
DependFiles := $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.d)
|
||||
|
||||
# Include bitcode dependency files if using bitcode libraries
|
||||
ifdef BYTECODE_LIBRARY
|
||||
DependFiles += $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.bc.d)
|
||||
endif
|
||||
|
||||
-include $(DependFiles) ""
|
||||
|
||||
endif
|
||||
|
@ -10,9 +10,6 @@
|
||||
LEVEL = ../..
|
||||
include $(LEVEL)/Makefile.config
|
||||
|
||||
ifneq ($(strip $(LLVMCC)),)
|
||||
BYTECODE_LIBRARY = 1
|
||||
endif
|
||||
LIBRARYNAME = profile_rt
|
||||
LINK_LIBS_IN_SHARED = 1
|
||||
SHARED_LIBRARY = 1
|
||||
|
@ -47,18 +47,6 @@ clean::
|
||||
$(RM) -f a.out core
|
||||
$(RM) -rf Output/
|
||||
|
||||
# Compile from X.c to Output/X.ll
|
||||
Output/%.ll: %.c $(LCC1) Output/.dir $(INCLUDES)
|
||||
-$(LLVMCC) $(CPPFLAGS) $(LCCFLAGS) -S $< -o $@
|
||||
|
||||
# Compile from X.cpp to Output/X.ll
|
||||
Output/%.ll: %.cpp $(LCC1XX) Output/.dir $(INCLUDES)
|
||||
-$(LLVMCXX) $(CPPFLAGS) $(LCXXFLAGS) -S $< -o $@
|
||||
|
||||
# Compile from X.cc to Output/X.ll
|
||||
Output/%.ll: %.cc $(LCC1XX) Output/.dir $(INCLUDES)
|
||||
-$(LLVMCXX) $(CPPFLAGS) $(LCXXFLAGS) -S $< -o $@
|
||||
|
||||
# LLVM Assemble from Output/X.ll to Output/X.bc. Output/X.ll must have come
|
||||
# from GCC output, so use GCCAS.
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user