Chris Lattner | 6d47bae | 2004-01-05 05:28:15 +0000 | [diff] [blame] | 1 | ##===- tools/Makefile --------------------------------------*- Makefile -*-===## |
Mikhail Glushenkov | 113ec35 | 2008-11-25 21:38:12 +0000 | [diff] [blame] | 2 | # |
John Criswell | e2fab73 | 2003-10-20 22:29:16 +0000 | [diff] [blame] | 3 | # The LLVM Compiler Infrastructure |
| 4 | # |
Chris Lattner | 5116784 | 2007-12-29 20:07:17 +0000 | [diff] [blame] | 5 | # This file is distributed under the University of Illinois Open Source |
| 6 | # License. See LICENSE.TXT for details. |
Mikhail Glushenkov | 113ec35 | 2008-11-25 21:38:12 +0000 | [diff] [blame] | 7 | # |
John Criswell | e2fab73 | 2003-10-20 22:29:16 +0000 | [diff] [blame] | 8 | ##===----------------------------------------------------------------------===## |
Chris Lattner | 6d47bae | 2004-01-05 05:28:15 +0000 | [diff] [blame] | 9 | |
Chris Lattner | 698e9ce | 2002-12-06 03:53:40 +0000 | [diff] [blame] | 10 | LEVEL := .. |
Mike Stump | 0a26891 | 2009-01-24 00:00:41 +0000 | [diff] [blame] | 11 | |
NAKAMURA Takumi | e5ab51d | 2011-10-16 02:54:26 +0000 | [diff] [blame] | 12 | include $(LEVEL)/Makefile.config |
| 13 | |
Mike Stump | 0a26891 | 2009-01-24 00:00:41 +0000 | [diff] [blame] | 14 | # Build clang if present. |
NAKAMURA Takumi | e5ab51d | 2011-10-16 02:54:26 +0000 | [diff] [blame] | 15 | |
| 16 | ifneq ($(CLANG_SRC_ROOT),) |
| 17 | OPTIONAL_PARALLEL_DIRS := $(CLANG_SRC_ROOT) |
| 18 | else |
| 19 | OPTIONAL_PARALLEL_DIRS := clang |
| 20 | endif |
Mike Stump | 0a26891 | 2009-01-24 00:00:41 +0000 | [diff] [blame] | 21 | |
Stephen Wilson | ebccf08 | 2011-02-20 04:17:15 +0000 | [diff] [blame] | 22 | # Build LLDB if present. Note LLDB must be built last as it depends on the |
Jim Grosbach | 1cb19a4 | 2011-03-18 17:11:39 +0000 | [diff] [blame] | 23 | # wider LLVM infrastructure (including Clang). |
Stephen Wilson | ebccf08 | 2011-02-20 04:17:15 +0000 | [diff] [blame] | 24 | OPTIONAL_DIRS := lldb |
| 25 | |
Mikhail Glushenkov | 113ec35 | 2008-11-25 21:38:12 +0000 | [diff] [blame] | 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 |
Reid Spencer | 36a987e | 2007-02-09 17:02:07 +0000 | [diff] [blame] | 28 | # in parallel builds. Please retain this ordering. |
Jim Grosbach | 1cb19a4 | 2011-03-18 17:11:39 +0000 | [diff] [blame] | 29 | DIRS := llvm-config |
Chris Lattner | e744ab2 | 2010-07-20 20:55:57 +0000 | [diff] [blame] | 30 | PARALLEL_DIRS := opt llvm-as llvm-dis \ |
Reid Spencer | 36a987e | 2007-02-09 17:02:07 +0000 | [diff] [blame] | 31 | llc llvm-ranlib llvm-ar llvm-nm \ |
Chris Lattner | 8c2ec51 | 2008-03-30 18:58:05 +0000 | [diff] [blame] | 32 | llvm-ld llvm-prof llvm-link \ |
Chris Lattner | 847da55 | 2010-07-20 18:25:19 +0000 | [diff] [blame] | 33 | lli llvm-extract llvm-mc \ |
Rafael Espindola | 0b5b102 | 2010-08-09 14:05:42 +0000 | [diff] [blame] | 34 | bugpoint llvm-bcanalyzer llvm-stub \ |
Eric Christopher | f117506 | 2011-09-19 23:22:41 +0000 | [diff] [blame] | 35 | llvm-diff macho-dump llvm-objdump \ |
Michael J. Spencer | 32a12ba | 2011-09-28 20:57:46 +0000 | [diff] [blame] | 36 | llvm-rtdyld llvm-dwarfdump llvm-cov \ |
Daniel Dunbar | 7fdd291 | 2011-11-03 17:30:16 +0000 | [diff] [blame] | 37 | llvm-size llvm-config-2 |
Bill Wendling | 041b3f8 | 2007-12-08 23:58:46 +0000 | [diff] [blame] | 38 | |
Chris Lattner | 0694290 | 2009-04-25 22:08:52 +0000 | [diff] [blame] | 39 | # Let users override the set of tools to build from the command line. |
| 40 | ifdef ONLY_TOOLS |
| 41 | OPTIONAL_PARALLEL_DIRS := |
Stephen Wilson | ebccf08 | 2011-02-20 04:17:15 +0000 | [diff] [blame] | 42 | OPTIONAL_DIRS := $(findstring lldb,$(ONLY_TOOLS)) |
| 43 | PARALLEL_DIRS := $(filter-out lldb,$(ONLY_TOOLS)) |
Chris Lattner | 0694290 | 2009-04-25 22:08:52 +0000 | [diff] [blame] | 44 | endif |
| 45 | |
Chris Lattner | 23e6d2b | 2010-03-05 00:59:18 +0000 | [diff] [blame] | 46 | # These libraries build as dynamic libraries (.dylib /.so), they can only be |
| 47 | # built if ENABLE_PIC is set. |
Daniel Dunbar | b8810a3 | 2010-12-16 15:42:26 +0000 | [diff] [blame] | 48 | ifndef ONLY_TOOLS |
Nick Lewycky | e9742d2 | 2009-03-03 07:45:09 +0000 | [diff] [blame] | 49 | ifeq ($(ENABLE_PIC),1) |
NAKAMURA Takumi | b4b544d | 2010-11-29 00:20:34 +0000 | [diff] [blame] | 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 |
Chris Lattner | 847da55 | 2010-07-20 18:25:19 +0000 | [diff] [blame] | 57 | |
NAKAMURA Takumi | b4b544d | 2010-11-29 00:20:34 +0000 | [diff] [blame] | 58 | PARALLEL_DIRS += bugpoint-passes |
Rafael Espindola | 0b5b102 | 2010-08-09 14:05:42 +0000 | [diff] [blame] | 59 | |
NAKAMURA Takumi | b4b544d | 2010-11-29 00:20:34 +0000 | [diff] [blame] | 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) |
Chris Lattner | 847da55 | 2010-07-20 18:25:19 +0000 | [diff] [blame] | 63 | ifneq ($(filter $(TARGETS_TO_BUILD), X86 ARM),) |
Chris Lattner | e744ab2 | 2010-07-20 20:55:57 +0000 | [diff] [blame] | 64 | PARALLEL_DIRS += edis |
Chris Lattner | 847da55 | 2010-07-20 18:25:19 +0000 | [diff] [blame] | 65 | endif |
NAKAMURA Takumi | b4b544d | 2010-11-29 00:20:34 +0000 | [diff] [blame] | 66 | endif |
Anton Korobeynikov | 294492b | 2006-09-08 18:00:43 +0000 | [diff] [blame] | 67 | endif |
Reid Spencer | ac28588 | 2006-05-30 21:20:55 +0000 | [diff] [blame] | 68 | |
Tobias Grosser | baaadb2 | 2010-10-30 00:54:26 +0000 | [diff] [blame] | 69 | ifdef LLVM_HAS_POLLY |
| 70 | PARALLEL_DIRS += polly |
| 71 | endif |
Daniel Dunbar | b8810a3 | 2010-12-16 15:42:26 +0000 | [diff] [blame] | 72 | endif |
Tobias Grosser | baaadb2 | 2010-10-30 00:54:26 +0000 | [diff] [blame] | 73 | |
NAKAMURA Takumi | f5f6588 | 2010-11-29 00:20:28 +0000 | [diff] [blame] | 74 | # On Win32, loadable modules can be built with ENABLE_SHARED. |
| 75 | ifneq ($(ENABLE_SHARED),1) |
NAKAMURA Takumi | 0ae59f4 | 2010-11-29 08:58:11 +0000 | [diff] [blame] | 76 | ifneq (,$(filter $(HOST_OS), Cygwin MingW)) |
NAKAMURA Takumi | f5f6588 | 2010-11-29 00:20:28 +0000 | [diff] [blame] | 77 | PARALLEL_DIRS := $(filter-out bugpoint-passes, \ |
| 78 | $(PARALLEL_DIRS)) |
| 79 | endif |
| 80 | endif |
| 81 | |
Chris Lattner | cf8cb6d | 2006-09-08 18:33:49 +0000 | [diff] [blame] | 82 | include $(LEVEL)/Makefile.common |