Chris Lattner | 144992e | 2004-01-05 05:28:15 +0000 | [diff] [blame] | 1 | ##===- tools/Makefile --------------------------------------*- Makefile -*-===## |
Mikhail Glushenkov | 98d5ed5 | 2008-11-25 21:38:12 +0000 | [diff] [blame] | 2 | # |
John Criswell | abe5cdc | 2003-10-20 22:29:16 +0000 | [diff] [blame] | 3 | # The LLVM Compiler Infrastructure |
| 4 | # |
Chris Lattner | 8fa21ac | 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 | 98d5ed5 | 2008-11-25 21:38:12 +0000 | [diff] [blame] | 7 | # |
John Criswell | abe5cdc | 2003-10-20 22:29:16 +0000 | [diff] [blame] | 8 | ##===----------------------------------------------------------------------===## |
Chris Lattner | 144992e | 2004-01-05 05:28:15 +0000 | [diff] [blame] | 9 | |
Chris Lattner | 71b82e3 | 2002-12-06 03:53:40 +0000 | [diff] [blame] | 10 | LEVEL := .. |
Mike Stump | 82221d6 | 2009-01-24 00:00:41 +0000 | [diff] [blame] | 11 | |
| 12 | # Build clang if present. |
| 13 | OPTIONAL_PARALLEL_DIRS := clang |
| 14 | |
Stephen Wilson | a32b8d7 | 2011-02-20 04:17:15 +0000 | [diff] [blame^] | 15 | # Build LLDB if present. Note LLDB must be built last as it depends on the |
| 16 | # wider LLVM infrastructure (including Clang). |
| 17 | OPTIONAL_DIRS := lldb |
| 18 | |
Mikhail Glushenkov | 98d5ed5 | 2008-11-25 21:38:12 +0000 | [diff] [blame] | 19 | # NOTE: The tools are organized into five groups of four consisting of one |
| 20 | # large and three small executables. This is done to minimize memory load |
Reid Spencer | 49785b9 | 2007-02-09 17:02:07 +0000 | [diff] [blame] | 21 | # in parallel builds. Please retain this ordering. |
Chris Lattner | 979634b | 2010-07-20 18:25:19 +0000 | [diff] [blame] | 22 | DIRS := llvm-config |
Chris Lattner | 9289f93 | 2010-07-20 20:55:57 +0000 | [diff] [blame] | 23 | PARALLEL_DIRS := opt llvm-as llvm-dis \ |
Reid Spencer | 49785b9 | 2007-02-09 17:02:07 +0000 | [diff] [blame] | 24 | llc llvm-ranlib llvm-ar llvm-nm \ |
Chris Lattner | e950eee | 2008-03-30 18:58:05 +0000 | [diff] [blame] | 25 | llvm-ld llvm-prof llvm-link \ |
Chris Lattner | 979634b | 2010-07-20 18:25:19 +0000 | [diff] [blame] | 26 | lli llvm-extract llvm-mc \ |
Rafael Espindola | 68f8b27 | 2010-08-09 14:05:42 +0000 | [diff] [blame] | 27 | bugpoint llvm-bcanalyzer llvm-stub \ |
Michael J. Spencer | 2670c25 | 2011-01-20 06:39:06 +0000 | [diff] [blame] | 28 | llvmc llvm-diff macho-dump llvm-objdump |
Bill Wendling | 3f19dfe7 | 2007-12-08 23:58:46 +0000 | [diff] [blame] | 29 | |
Chris Lattner | 0cb8977 | 2009-04-25 22:08:52 +0000 | [diff] [blame] | 30 | # Let users override the set of tools to build from the command line. |
| 31 | ifdef ONLY_TOOLS |
| 32 | OPTIONAL_PARALLEL_DIRS := |
Stephen Wilson | a32b8d7 | 2011-02-20 04:17:15 +0000 | [diff] [blame^] | 33 | OPTIONAL_DIRS := $(findstring lldb,$(ONLY_TOOLS)) |
| 34 | PARALLEL_DIRS := $(filter-out lldb,$(ONLY_TOOLS)) |
Chris Lattner | 0cb8977 | 2009-04-25 22:08:52 +0000 | [diff] [blame] | 35 | endif |
| 36 | |
Chris Lattner | fe01c28 | 2006-09-08 18:33:49 +0000 | [diff] [blame] | 37 | include $(LEVEL)/Makefile.config |
Chris Lattner | eda4a9e | 2006-09-08 18:08:50 +0000 | [diff] [blame] | 38 | |
Chris Lattner | 979634b | 2010-07-20 18:25:19 +0000 | [diff] [blame] | 39 | |
Chris Lattner | 2e89d20 | 2010-03-05 00:59:18 +0000 | [diff] [blame] | 40 | # These libraries build as dynamic libraries (.dylib /.so), they can only be |
| 41 | # built if ENABLE_PIC is set. |
Daniel Dunbar | 73a860b | 2010-12-16 15:42:26 +0000 | [diff] [blame] | 42 | ifndef ONLY_TOOLS |
Nick Lewycky | 9e26e6d | 2009-03-03 07:45:09 +0000 | [diff] [blame] | 43 | ifeq ($(ENABLE_PIC),1) |
NAKAMURA Takumi | 71c8c12 | 2010-11-29 00:20:34 +0000 | [diff] [blame] | 44 | # gold only builds if binutils is around. It requires "lto" to build before |
| 45 | # it so it is added to DIRS. |
| 46 | ifdef BINUTILS_INCDIR |
| 47 | DIRS += lto gold |
| 48 | else |
| 49 | PARALLEL_DIRS += lto |
| 50 | endif |
Chris Lattner | 979634b | 2010-07-20 18:25:19 +0000 | [diff] [blame] | 51 | |
NAKAMURA Takumi | 71c8c12 | 2010-11-29 00:20:34 +0000 | [diff] [blame] | 52 | PARALLEL_DIRS += bugpoint-passes |
Rafael Espindola | 68f8b27 | 2010-08-09 14:05:42 +0000 | [diff] [blame] | 53 | |
NAKAMURA Takumi | 71c8c12 | 2010-11-29 00:20:34 +0000 | [diff] [blame] | 54 | # The edis library is only supported if ARM and/or X86 are enabled, and if |
| 55 | # LLVM is being built PIC on platforms that support dylibs. |
| 56 | ifneq ($(DISABLE_EDIS),1) |
Chris Lattner | 979634b | 2010-07-20 18:25:19 +0000 | [diff] [blame] | 57 | ifneq ($(filter $(TARGETS_TO_BUILD), X86 ARM),) |
Chris Lattner | 9289f93 | 2010-07-20 20:55:57 +0000 | [diff] [blame] | 58 | PARALLEL_DIRS += edis |
Chris Lattner | 979634b | 2010-07-20 18:25:19 +0000 | [diff] [blame] | 59 | endif |
NAKAMURA Takumi | 71c8c12 | 2010-11-29 00:20:34 +0000 | [diff] [blame] | 60 | endif |
Anton Korobeynikov | dc7b519 | 2006-09-08 18:00:43 +0000 | [diff] [blame] | 61 | endif |
Reid Spencer | c3b9370 | 2006-05-30 21:20:55 +0000 | [diff] [blame] | 62 | |
Tobias Grosser | ea9dca4 | 2010-10-30 00:54:26 +0000 | [diff] [blame] | 63 | ifdef LLVM_HAS_POLLY |
| 64 | PARALLEL_DIRS += polly |
| 65 | endif |
Daniel Dunbar | 73a860b | 2010-12-16 15:42:26 +0000 | [diff] [blame] | 66 | endif |
Tobias Grosser | ea9dca4 | 2010-10-30 00:54:26 +0000 | [diff] [blame] | 67 | |
NAKAMURA Takumi | 142b325 | 2010-11-29 00:20:28 +0000 | [diff] [blame] | 68 | # On Win32, loadable modules can be built with ENABLE_SHARED. |
| 69 | ifneq ($(ENABLE_SHARED),1) |
NAKAMURA Takumi | 638110f | 2010-11-29 08:58:11 +0000 | [diff] [blame] | 70 | ifneq (,$(filter $(HOST_OS), Cygwin MingW)) |
NAKAMURA Takumi | 142b325 | 2010-11-29 00:20:28 +0000 | [diff] [blame] | 71 | PARALLEL_DIRS := $(filter-out bugpoint-passes, \ |
| 72 | $(PARALLEL_DIRS)) |
| 73 | endif |
| 74 | endif |
| 75 | |
Chris Lattner | fe01c28 | 2006-09-08 18:33:49 +0000 | [diff] [blame] | 76 | include $(LEVEL)/Makefile.common |