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 | |
| 12 | # Build clang if present. |
| 13 | OPTIONAL_PARALLEL_DIRS := clang |
| 14 | |
Stephen Wilson | ebccf08 | 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 |
Jim Grosbach | 1cb19a4 | 2011-03-18 17:11:39 +0000 | [diff] [blame^] | 16 | # wider LLVM infrastructure (including Clang). |
Stephen Wilson | ebccf08 | 2011-02-20 04:17:15 +0000 | [diff] [blame] | 17 | OPTIONAL_DIRS := lldb |
| 18 | |
Mikhail Glushenkov | 113ec35 | 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 | 36a987e | 2007-02-09 17:02:07 +0000 | [diff] [blame] | 21 | # in parallel builds. Please retain this ordering. |
Jim Grosbach | 1cb19a4 | 2011-03-18 17:11:39 +0000 | [diff] [blame^] | 22 | DIRS := llvm-config |
Chris Lattner | e744ab2 | 2010-07-20 20:55:57 +0000 | [diff] [blame] | 23 | PARALLEL_DIRS := opt llvm-as llvm-dis \ |
Reid Spencer | 36a987e | 2007-02-09 17:02:07 +0000 | [diff] [blame] | 24 | llc llvm-ranlib llvm-ar llvm-nm \ |
Chris Lattner | 8c2ec51 | 2008-03-30 18:58:05 +0000 | [diff] [blame] | 25 | llvm-ld llvm-prof llvm-link \ |
Chris Lattner | 847da55 | 2010-07-20 18:25:19 +0000 | [diff] [blame] | 26 | lli llvm-extract llvm-mc \ |
Rafael Espindola | 0b5b102 | 2010-08-09 14:05:42 +0000 | [diff] [blame] | 27 | bugpoint llvm-bcanalyzer llvm-stub \ |
Jim Grosbach | 1cb19a4 | 2011-03-18 17:11:39 +0000 | [diff] [blame^] | 28 | llvmc llvm-diff macho-dump llvm-objdump \ |
| 29 | llvm-rtdyld |
Bill Wendling | 041b3f8 | 2007-12-08 23:58:46 +0000 | [diff] [blame] | 30 | |
Chris Lattner | 0694290 | 2009-04-25 22:08:52 +0000 | [diff] [blame] | 31 | # Let users override the set of tools to build from the command line. |
| 32 | ifdef ONLY_TOOLS |
| 33 | OPTIONAL_PARALLEL_DIRS := |
Stephen Wilson | ebccf08 | 2011-02-20 04:17:15 +0000 | [diff] [blame] | 34 | OPTIONAL_DIRS := $(findstring lldb,$(ONLY_TOOLS)) |
| 35 | PARALLEL_DIRS := $(filter-out lldb,$(ONLY_TOOLS)) |
Chris Lattner | 0694290 | 2009-04-25 22:08:52 +0000 | [diff] [blame] | 36 | endif |
| 37 | |
Chris Lattner | cf8cb6d | 2006-09-08 18:33:49 +0000 | [diff] [blame] | 38 | include $(LEVEL)/Makefile.config |
Chris Lattner | 70c3537 | 2006-09-08 18:08:50 +0000 | [diff] [blame] | 39 | |
Chris Lattner | 847da55 | 2010-07-20 18:25:19 +0000 | [diff] [blame] | 40 | |
Chris Lattner | 23e6d2b | 2010-03-05 00:59:18 +0000 | [diff] [blame] | 41 | # These libraries build as dynamic libraries (.dylib /.so), they can only be |
| 42 | # built if ENABLE_PIC is set. |
Daniel Dunbar | b8810a3 | 2010-12-16 15:42:26 +0000 | [diff] [blame] | 43 | ifndef ONLY_TOOLS |
Nick Lewycky | e9742d2 | 2009-03-03 07:45:09 +0000 | [diff] [blame] | 44 | ifeq ($(ENABLE_PIC),1) |
NAKAMURA Takumi | b4b544d | 2010-11-29 00:20:34 +0000 | [diff] [blame] | 45 | # gold only builds if binutils is around. It requires "lto" to build before |
| 46 | # it so it is added to DIRS. |
| 47 | ifdef BINUTILS_INCDIR |
| 48 | DIRS += lto gold |
| 49 | else |
| 50 | PARALLEL_DIRS += lto |
| 51 | endif |
Chris Lattner | 847da55 | 2010-07-20 18:25:19 +0000 | [diff] [blame] | 52 | |
NAKAMURA Takumi | b4b544d | 2010-11-29 00:20:34 +0000 | [diff] [blame] | 53 | PARALLEL_DIRS += bugpoint-passes |
Rafael Espindola | 0b5b102 | 2010-08-09 14:05:42 +0000 | [diff] [blame] | 54 | |
NAKAMURA Takumi | b4b544d | 2010-11-29 00:20:34 +0000 | [diff] [blame] | 55 | # The edis library is only supported if ARM and/or X86 are enabled, and if |
| 56 | # LLVM is being built PIC on platforms that support dylibs. |
| 57 | ifneq ($(DISABLE_EDIS),1) |
Chris Lattner | 847da55 | 2010-07-20 18:25:19 +0000 | [diff] [blame] | 58 | ifneq ($(filter $(TARGETS_TO_BUILD), X86 ARM),) |
Chris Lattner | e744ab2 | 2010-07-20 20:55:57 +0000 | [diff] [blame] | 59 | PARALLEL_DIRS += edis |
Chris Lattner | 847da55 | 2010-07-20 18:25:19 +0000 | [diff] [blame] | 60 | endif |
NAKAMURA Takumi | b4b544d | 2010-11-29 00:20:34 +0000 | [diff] [blame] | 61 | endif |
Anton Korobeynikov | 294492b | 2006-09-08 18:00:43 +0000 | [diff] [blame] | 62 | endif |
Reid Spencer | ac28588 | 2006-05-30 21:20:55 +0000 | [diff] [blame] | 63 | |
Tobias Grosser | baaadb2 | 2010-10-30 00:54:26 +0000 | [diff] [blame] | 64 | ifdef LLVM_HAS_POLLY |
| 65 | PARALLEL_DIRS += polly |
| 66 | endif |
Daniel Dunbar | b8810a3 | 2010-12-16 15:42:26 +0000 | [diff] [blame] | 67 | endif |
Tobias Grosser | baaadb2 | 2010-10-30 00:54:26 +0000 | [diff] [blame] | 68 | |
NAKAMURA Takumi | f5f6588 | 2010-11-29 00:20:28 +0000 | [diff] [blame] | 69 | # On Win32, loadable modules can be built with ENABLE_SHARED. |
| 70 | ifneq ($(ENABLE_SHARED),1) |
NAKAMURA Takumi | 0ae59f4 | 2010-11-29 08:58:11 +0000 | [diff] [blame] | 71 | ifneq (,$(filter $(HOST_OS), Cygwin MingW)) |
NAKAMURA Takumi | f5f6588 | 2010-11-29 00:20:28 +0000 | [diff] [blame] | 72 | PARALLEL_DIRS := $(filter-out bugpoint-passes, \ |
| 73 | $(PARALLEL_DIRS)) |
| 74 | endif |
| 75 | endif |
| 76 | |
Chris Lattner | cf8cb6d | 2006-09-08 18:33:49 +0000 | [diff] [blame] | 77 | include $(LEVEL)/Makefile.common |