Fix a problem exposed by my previous commit and noticed by a release-asserts
[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 # Build clang if present.
13 OPTIONAL_PARALLEL_DIRS := clang
14
15 # NOTE: The tools are organized into five groups of four consisting of one
16 # large and three small executables. This is done to minimize memory load
17 # in parallel builds.  Please retain this ordering.
18
19 # libEnhancedDisassembly must be built ahead of llvm-mc
20 # because llvm-mc links against libEnhancedDisassembly
21 DIRS := llvm-config edis llvm-mc
22 PARALLEL_DIRS := opt llvm-as llvm-dis \
23                  llc llvm-ranlib llvm-ar llvm-nm \
24                  llvm-ld llvm-prof llvm-link \
25                  lli llvm-extract \
26                  bugpoint llvm-bcanalyzer llvm-stub \
27                  llvmc
28
29 # Let users override the set of tools to build from the command line.
30 ifdef ONLY_TOOLS
31   OPTIONAL_PARALLEL_DIRS :=
32   PARALLEL_DIRS := $(ONLY_TOOLS)
33 endif
34
35 include $(LEVEL)/Makefile.config
36
37 # These libraries build as dynamic libraries (.dylib /.so), they can only be
38 # built if ENABLE_PIC is set.
39 ifeq ($(ENABLE_PIC),1)
40   # No support for dynamic libraries on windows targets.
41   ifneq ($(TARGET_OS), $(filter $(TARGET_OS), Cygwin MingW))
42     # gold only builds if binutils is around.  It requires "lto" to build before
43     # it so it is added to DIRS.
44     ifdef BINUTILS_INCDIR
45       DIRS += lto gold
46     else
47       PARALLEL_DIRS += lto
48     endif
49   endif
50 endif
51
52 # Don't build edis if we explicitly disabled it.
53 ifeq ($(DISABLE_EDIS),1)
54   PARALLEL_DIRS := $(filter-out edis, $(PARALLEL_DIRS))
55 endif
56
57 include $(LEVEL)/Makefile.common