Makefile revision 1ad92131abbed3d2992d5996969274a8e1ae9a6b
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
12include $(LEVEL)/Makefile.config
13
14# Build clang if present.
15
16ifneq ($(CLANG_SRC_ROOT),)
17  OPTIONAL_PARALLEL_DIRS := $(CLANG_SRC_ROOT)
18else
19  OPTIONAL_PARALLEL_DIRS := clang
20endif
21
22# Build LLDB if present. Note LLDB must be built last as it depends on the
23# wider LLVM infrastructure (including Clang).
24OPTIONAL_DIRS := lldb
25
26# NOTE: The tools are organized into five groups of four consisting of one
27# large and three small executables. This is done to minimize memory load
28# in parallel builds.  Please retain this ordering.
29DIRS := llvm-config
30PARALLEL_DIRS := opt llvm-as llvm-dis \
31                 llc llvm-ranlib llvm-ar llvm-nm \
32                 llvm-ld llvm-prof llvm-link \
33                 lli llvm-extract llvm-mc \
34                 bugpoint llvm-bcanalyzer llvm-stub \
35                 llvm-diff macho-dump llvm-objdump \
36	         llvm-rtdyld llvm-dwarfdump llvm-cov \
37	         llvm-size llvm-config-2
38
39# Let users override the set of tools to build from the command line.
40ifdef ONLY_TOOLS
41  OPTIONAL_PARALLEL_DIRS :=
42  OPTIONAL_DIRS := $(findstring lldb,$(ONLY_TOOLS))
43  PARALLEL_DIRS := $(filter-out lldb,$(ONLY_TOOLS))
44endif
45
46# These libraries build as dynamic libraries (.dylib /.so), they can only be
47# built if ENABLE_PIC is set.
48ifndef ONLY_TOOLS
49ifeq ($(ENABLE_PIC),1)
50  # gold only builds if binutils is around.  It requires "lto" to build before
51  # it so it is added to DIRS.
52  ifdef BINUTILS_INCDIR
53    DIRS += lto gold
54  else
55    PARALLEL_DIRS += lto
56  endif
57
58  PARALLEL_DIRS += bugpoint-passes
59
60  # The edis library is only supported if ARM and/or X86 are enabled, and if
61  # LLVM is being built PIC on platforms that support dylibs.
62  ifneq ($(DISABLE_EDIS),1)
63    ifneq ($(filter $(TARGETS_TO_BUILD), X86 ARM),)
64      PARALLEL_DIRS += edis
65    endif
66  endif
67endif
68
69ifdef LLVM_HAS_POLLY
70  PARALLEL_DIRS += polly
71endif
72endif
73
74# On Win32, loadable modules can be built with ENABLE_SHARED.
75ifneq ($(ENABLE_SHARED),1)
76  ifneq (,$(filter $(HOST_OS), Cygwin MingW))
77    PARALLEL_DIRS := $(filter-out bugpoint-passes, \
78                        $(PARALLEL_DIRS))
79  endif
80endif
81
82include $(LEVEL)/Makefile.common
83