llvm/tools/Makefile: Suppress building llvm-lto on cygming, for now, probably due...
[oota-llvm.git] / tools / Makefile
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 include $(LEVEL)/Makefile.config
13
14 # Build clang if present.
15
16 ifneq ($(CLANG_SRC_ROOT),)
17   OPTIONAL_PARALLEL_DIRS := $(CLANG_SRC_ROOT)
18 else
19   OPTIONAL_PARALLEL_DIRS := clang
20 endif
21
22 # Build LLDB if present. Note LLDB must be built last as it depends on the
23 # wider LLVM infrastructure (including Clang).
24 OPTIONAL_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.
29 DIRS := llvm-config
30 PARALLEL_DIRS := opt llvm-as llvm-dis \
31                  llc llvm-ar llvm-nm \
32                  llvm-prof llvm-link \
33                  lli llvm-extract llvm-mc \
34                  bugpoint llvm-bcanalyzer \
35                  llvm-diff macho-dump llvm-objdump llvm-readobj \
36                  llvm-rtdyld llvm-dwarfdump llvm-cov \
37                  llvm-size llvm-stress llvm-mcmarkup \
38                  llvm-symbolizer obj2yaml yaml2obj
39
40 # If Intel JIT Events support is configured, build an extra tool to test it.
41 ifeq ($(USE_INTEL_JITEVENTS), 1)
42   PARALLEL_DIRS += llvm-jitlistener
43 endif
44
45 # Let users override the set of tools to build from the command line.
46 ifdef ONLY_TOOLS
47   OPTIONAL_PARALLEL_DIRS :=
48   OPTIONAL_DIRS := $(findstring lldb,$(ONLY_TOOLS))
49   PARALLEL_DIRS := $(filter-out lldb,$(ONLY_TOOLS))
50 endif
51
52 # These libraries build as dynamic libraries (.dylib /.so), they can only be
53 # built if ENABLE_PIC is set.
54 ifndef ONLY_TOOLS
55 ifeq ($(ENABLE_PIC),1)
56   # gold only builds if binutils is around.  It requires "lto" to build before
57   # it so it is added to DIRS. llvm-lto also requires lto
58   DIRS += lto llvm-lto
59   ifdef BINUTILS_INCDIR
60     DIRS += gold
61   endif
62
63   PARALLEL_DIRS += bugpoint-passes
64 endif
65
66 ifdef LLVM_HAS_POLLY
67   PARALLEL_DIRS += polly
68 endif
69 endif
70
71 # On Win32, loadable modules can be built with ENABLE_SHARED.
72 ifneq ($(ENABLE_SHARED),1)
73   ifneq (,$(filter $(HOST_OS), Cygwin MingW))
74     DIRS := $(filter-out llvm-lto, \
75                         $(DIRS))
76     PARALLEL_DIRS := $(filter-out bugpoint-passes, \
77                         $(PARALLEL_DIRS))
78   endif
79 endif
80
81 include $(LEVEL)/Makefile.common