• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
10LEVEL := ..
11
12# Build clang if present.
13OPTIONAL_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).
17OPTIONAL_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.
22DIRS := llvm-config
23PARALLEL_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.
33ifdef ONLY_TOOLS
34  OPTIONAL_PARALLEL_DIRS :=
35  OPTIONAL_DIRS := $(findstring lldb,$(ONLY_TOOLS))
36  PARALLEL_DIRS := $(filter-out lldb,$(ONLY_TOOLS))
37endif
38
39include $(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.
44ifndef ONLY_TOOLS
45ifeq ($(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
63endif
64
65ifdef LLVM_HAS_POLLY
66  PARALLEL_DIRS += polly
67endif
68endif
69
70# On Win32, loadable modules can be built with ENABLE_SHARED.
71ifneq ($(ENABLE_SHARED),1)
72  ifneq (,$(filter $(HOST_OS), Cygwin MingW))
73    PARALLEL_DIRS := $(filter-out bugpoint-passes, \
74                        $(PARALLEL_DIRS))
75  endif
76endif
77
78include $(LEVEL)/Makefile.common
79