Home | History | Annotate | Download | only in tools
      1 ##===- tools/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 LEVEL := ..
     11 
     12 # Build clang if present.

     13 OPTIONAL_PARALLEL_DIRS := clang
     14 
     15 # Build LLDB if present. Note LLDB must be built last as it depends on the

     16 # wider LLVM infrastructure (including Clang).

     17 OPTIONAL_DIRS := lldb
     18 
     19 # NOTE: The tools are organized into five groups of four consisting of one

     20 # large and three small executables. This is done to minimize memory load

     21 # in parallel builds.  Please retain this ordering.

     22 DIRS := llvm-config
     23 PARALLEL_DIRS := opt llvm-as llvm-dis \
     24                  llc llvm-ranlib llvm-ar llvm-nm \
     25                  llvm-ld llvm-prof llvm-link \
     26                  lli llvm-extract llvm-mc \
     27                  bugpoint llvm-bcanalyzer llvm-stub \
     28                  llvm-diff macho-dump llvm-objdump \
     29 	         llvm-rtdyld llvm-dwarfdump llvm-cov \
     30 	         llvm-size
     31 
     32 # Let users override the set of tools to build from the command line.

     33 ifdef ONLY_TOOLS
     34   OPTIONAL_PARALLEL_DIRS :=
     35   OPTIONAL_DIRS := $(findstring lldb,$(ONLY_TOOLS))
     36   PARALLEL_DIRS := $(filter-out lldb,$(ONLY_TOOLS))
     37 endif
     38 
     39 include $(LEVEL)/Makefile.config
     40 
     41 
     42 # These libraries build as dynamic libraries (.dylib /.so), they can only be

     43 # built if ENABLE_PIC is set.

     44 ifndef ONLY_TOOLS
     45 ifeq ($(ENABLE_PIC),1)
     46   # gold only builds if binutils is around.  It requires "lto" to build before

     47   # it so it is added to DIRS.

     48   ifdef BINUTILS_INCDIR
     49     DIRS += lto gold
     50   else
     51     PARALLEL_DIRS += lto
     52   endif
     53 
     54   PARALLEL_DIRS += bugpoint-passes
     55 
     56   # The edis library is only supported if ARM and/or X86 are enabled, and if

     57   # LLVM is being built PIC on platforms that support dylibs.

     58   ifneq ($(DISABLE_EDIS),1)
     59     ifneq ($(filter $(TARGETS_TO_BUILD), X86 ARM),)
     60       PARALLEL_DIRS += edis
     61     endif
     62   endif
     63 endif
     64 
     65 ifdef LLVM_HAS_POLLY
     66   PARALLEL_DIRS += polly
     67 endif
     68 endif
     69 
     70 # On Win32, loadable modules can be built with ENABLE_SHARED.

     71 ifneq ($(ENABLE_SHARED),1)
     72   ifneq (,$(filter $(HOST_OS), Cygwin MingW))
     73     PARALLEL_DIRS := $(filter-out bugpoint-passes, \
     74                         $(PARALLEL_DIRS))
     75   endif
     76 endif
     77 
     78 include $(LEVEL)/Makefile.common
     79