• 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                 llvmc llvm-diff macho-dump llvm-objdump \
29	         llvm-rtdyld
30
31# Let users override the set of tools to build from the command line.
32ifdef ONLY_TOOLS
33  OPTIONAL_PARALLEL_DIRS :=
34  OPTIONAL_DIRS := $(findstring lldb,$(ONLY_TOOLS))
35  PARALLEL_DIRS := $(filter-out lldb,$(ONLY_TOOLS))
36endif
37
38include $(LEVEL)/Makefile.config
39
40
41# These libraries build as dynamic libraries (.dylib /.so), they can only be
42# built if ENABLE_PIC is set.
43ifndef ONLY_TOOLS
44ifeq ($(ENABLE_PIC),1)
45  # gold only builds if binutils is around.  It requires "lto" to build before
46  # it so it is added to DIRS.
47  ifdef BINUTILS_INCDIR
48    DIRS += lto gold
49  else
50    PARALLEL_DIRS += lto
51  endif
52
53  PARALLEL_DIRS += bugpoint-passes
54
55  # The edis library is only supported if ARM and/or X86 are enabled, and if
56  # LLVM is being built PIC on platforms that support dylibs.
57  ifneq ($(DISABLE_EDIS),1)
58    ifneq ($(filter $(TARGETS_TO_BUILD), X86 ARM),)
59      PARALLEL_DIRS += edis
60    endif
61  endif
62endif
63
64ifdef LLVM_HAS_POLLY
65  PARALLEL_DIRS += polly
66endif
67endif
68
69# On Win32, loadable modules can be built with ENABLE_SHARED.
70ifneq ($(ENABLE_SHARED),1)
71  ifneq (,$(filter $(HOST_OS), Cygwin MingW))
72    PARALLEL_DIRS := $(filter-out bugpoint-passes, \
73                        $(PARALLEL_DIRS))
74  endif
75endif
76
77include $(LEVEL)/Makefile.common
78