Skip to content

Commit

Permalink
Remove dead code from the makefile build system.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
espindola committed Jul 25, 2013
1 parent cb420a4 commit 1a9e248
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 546 deletions.
247 changes: 1 addition & 246 deletions Makefile.rules
Original file line number Diff line number Diff line change
Expand Up @@ -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)

#--------------------------------------------------------------------
Expand Down Expand Up @@ -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
#--------------------------------------------------------------------
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -812,7 +785,6 @@ endif
BaseNameSources := $(sort $(basename $(Sources)))

ObjectsO := $(BaseNameSources:%=$(ObjDir)/%.o)
ObjectsBC := $(BaseNameSources:%=$(ObjDir)/%.bc)

#----------------------------------------------------------
# For Mingw MSYS bash and Python/w32:
Expand Down Expand Up @@ -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

Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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


Expand Down Expand Up @@ -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
###############################################################################
Expand Down Expand Up @@ -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
Expand Down
Loading

0 comments on commit 1a9e248

Please sign in to comment.