Second try at integrating the edis tester. This
[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 DIRS := llvm-config
19 PARALLEL_DIRS := opt llvm-as llvm-dis \
20                  llc llvm-ranlib llvm-ar llvm-nm \
21                  llvm-ld llvm-prof llvm-link \
22                  lli llvm-extract \
23                  bugpoint llvm-bcanalyzer llvm-stub \
24                  llvm-mc llvmc
25
26 # Let users override the set of tools to build from the command line.
27 ifdef ONLY_TOOLS
28   OPTIONAL_PARALLEL_DIRS :=
29   PARALLEL_DIRS := $(ONLY_TOOLS)
30 endif
31
32 include $(LEVEL)/Makefile.config
33
34 # These libraries build as dynamic libraries (.dylib /.so), they can only be
35 # built if ENABLE_PIC is set.
36 ifeq ($(ENABLE_PIC),1)
37   # No support for dynamic libraries on windows targets.
38   ifneq ($(TARGET_OS), $(filter $(TARGET_OS), Cygwin MingW))
39     # libEnhancedDisassembly must be built ahead of llvm-mc
40     # because llvm-mc links against libEnhancedDisassembly
41     DIRS += edis
42
43     # gold only builds if binutils is around.  It requires "lto" to build before
44     # it so it is added to DIRS.
45     ifdef BINUTILS_INCDIR
46       DIRS += lto gold
47     else
48       PARALLEL_DIRS += lto
49     endif
50   endif
51 endif
52
53 # Only build edis if X86 target support is enabled.
54 ifeq ($(filter $(TARGETS_TO_BUILD), X86),)
55   PARALLEL_DIRS := $(filter-out edis, $(PARALLEL_DIRS))
56 endif
57
58 # Don't build edis if we explicitly disabled it.
59 ifeq ($(DISABLE_EDIS),1)
60   PARALLEL_DIRS := $(filter-out edis, $(PARALLEL_DIRS))
61 endif
62
63 include $(LEVEL)/Makefile.common