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