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 |
| 19 | PARALLEL_DIRS := opt llvm-as llvm-dis edis \ |
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 \ |
Daniel Dunbar | 74deeb8 | 2009-06-29 21:12:26 +0000 | [diff] [blame] | 23 | bugpoint llvm-bcanalyzer llvm-stub \ |
Sean Callanan | 18d5766 | 2010-04-12 23:55:28 +0000 | [diff] [blame] | 24 | llvmc |
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) |
Chris Lattner | 23e6d2b | 2010-03-05 00:59:18 +0000 | [diff] [blame] | 38 | # No support for dynamic libraries on windows targets. |
| 39 | ifneq ($(TARGET_OS), $(filter $(TARGET_OS), Cygwin MingW)) |
Chris Lattner | e560577 | 2010-03-05 02:34:34 +0000 | [diff] [blame] | 40 | # gold only builds if binutils is around. It requires "lto" to build before |
| 41 | # it so it is added to DIRS. |
Chris Lattner | 23e6d2b | 2010-03-05 00:59:18 +0000 | [diff] [blame] | 42 | ifdef BINUTILS_INCDIR |
Duncan Sands | 7ebc377 | 2010-03-09 09:03:21 +0000 | [diff] [blame] | 43 | DIRS += lto gold |
Chris Lattner | e560577 | 2010-03-05 02:34:34 +0000 | [diff] [blame] | 44 | else |
| 45 | PARALLEL_DIRS += lto |
Chris Lattner | 23e6d2b | 2010-03-05 00:59:18 +0000 | [diff] [blame] | 46 | endif |
Chris Lattner | 847da55 | 2010-07-20 18:25:19 +0000 | [diff] [blame^] | 47 | |
| 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) |
| 51 | ifneq ($(filter $(TARGETS_TO_BUILD), X86 ARM),) |
| 52 | PARALLEL_DIRS := $(filter-out edis, $(PARALLEL_DIRS)) |
| 53 | endif |
| 54 | endif |
Nick Lewycky | dcd158a | 2009-02-26 07:56:49 +0000 | [diff] [blame] | 55 | endif |
Anton Korobeynikov | 294492b | 2006-09-08 18:00:43 +0000 | [diff] [blame] | 56 | endif |
Reid Spencer | ac28588 | 2006-05-30 21:20:55 +0000 | [diff] [blame] | 57 | |
Chris Lattner | cf8cb6d | 2006-09-08 18:33:49 +0000 | [diff] [blame] | 58 | include $(LEVEL)/Makefile.common |