blob: 278546bc1625b7e02c7d6bcf44a1d2da0712422f [file] [log] [blame]
Chris Lattner6d47bae2004-01-05 05:28:15 +00001##===- tools/Makefile --------------------------------------*- Makefile -*-===##
Mikhail Glushenkov113ec352008-11-25 21:38:12 +00002#
John Criswelle2fab732003-10-20 22:29:16 +00003# The LLVM Compiler Infrastructure
4#
Chris Lattner51167842007-12-29 20:07:17 +00005# This file is distributed under the University of Illinois Open Source
6# License. See LICENSE.TXT for details.
Mikhail Glushenkov113ec352008-11-25 21:38:12 +00007#
John Criswelle2fab732003-10-20 22:29:16 +00008##===----------------------------------------------------------------------===##
Chris Lattner6d47bae2004-01-05 05:28:15 +00009
Chris Lattner698e9ce2002-12-06 03:53:40 +000010LEVEL := ..
Mike Stump0a268912009-01-24 00:00:41 +000011
NAKAMURA Takumie5ab51d2011-10-16 02:54:26 +000012include $(LEVEL)/Makefile.config
13
Mike Stump0a268912009-01-24 00:00:41 +000014# Build clang if present.
NAKAMURA Takumie5ab51d2011-10-16 02:54:26 +000015
16ifneq ($(CLANG_SRC_ROOT),)
17 OPTIONAL_PARALLEL_DIRS := $(CLANG_SRC_ROOT)
18else
19 OPTIONAL_PARALLEL_DIRS := clang
20endif
Mike Stump0a268912009-01-24 00:00:41 +000021
Stephen Wilsonebccf082011-02-20 04:17:15 +000022# Build LLDB if present. Note LLDB must be built last as it depends on the
Jim Grosbach1cb19a42011-03-18 17:11:39 +000023# wider LLVM infrastructure (including Clang).
Stephen Wilsonebccf082011-02-20 04:17:15 +000024OPTIONAL_DIRS := lldb
25
Mikhail Glushenkov113ec352008-11-25 21:38:12 +000026# 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 Spencer36a987e2007-02-09 17:02:07 +000028# in parallel builds. Please retain this ordering.
Jim Grosbach1cb19a42011-03-18 17:11:39 +000029DIRS := llvm-config
Chris Lattnere744ab22010-07-20 20:55:57 +000030PARALLEL_DIRS := opt llvm-as llvm-dis \
Reid Spencer36a987e2007-02-09 17:02:07 +000031 llc llvm-ranlib llvm-ar llvm-nm \
Chris Lattner8c2ec512008-03-30 18:58:05 +000032 llvm-ld llvm-prof llvm-link \
Chris Lattner847da552010-07-20 18:25:19 +000033 lli llvm-extract llvm-mc \
Rafael Espindola0b5b1022010-08-09 14:05:42 +000034 bugpoint llvm-bcanalyzer llvm-stub \
Eric Christopherf1175062011-09-19 23:22:41 +000035 llvm-diff macho-dump llvm-objdump \
Michael J. Spencer32a12ba2011-09-28 20:57:46 +000036 llvm-rtdyld llvm-dwarfdump llvm-cov \
Daniel Dunbar7fdd2912011-11-03 17:30:16 +000037 llvm-size llvm-config-2
Bill Wendling041b3f82007-12-08 23:58:46 +000038
Chris Lattner06942902009-04-25 22:08:52 +000039# Let users override the set of tools to build from the command line.
40ifdef ONLY_TOOLS
41 OPTIONAL_PARALLEL_DIRS :=
Stephen Wilsonebccf082011-02-20 04:17:15 +000042 OPTIONAL_DIRS := $(findstring lldb,$(ONLY_TOOLS))
43 PARALLEL_DIRS := $(filter-out lldb,$(ONLY_TOOLS))
Chris Lattner06942902009-04-25 22:08:52 +000044endif
45
Chris Lattner23e6d2b2010-03-05 00:59:18 +000046# These libraries build as dynamic libraries (.dylib /.so), they can only be
47# built if ENABLE_PIC is set.
Daniel Dunbarb8810a32010-12-16 15:42:26 +000048ifndef ONLY_TOOLS
Nick Lewyckye9742d22009-03-03 07:45:09 +000049ifeq ($(ENABLE_PIC),1)
NAKAMURA Takumib4b544d2010-11-29 00:20:34 +000050 # 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 Lattner847da552010-07-20 18:25:19 +000057
NAKAMURA Takumib4b544d2010-11-29 00:20:34 +000058 PARALLEL_DIRS += bugpoint-passes
Rafael Espindola0b5b1022010-08-09 14:05:42 +000059
NAKAMURA Takumib4b544d2010-11-29 00:20:34 +000060 # 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 Lattner847da552010-07-20 18:25:19 +000063 ifneq ($(filter $(TARGETS_TO_BUILD), X86 ARM),)
Chris Lattnere744ab22010-07-20 20:55:57 +000064 PARALLEL_DIRS += edis
Chris Lattner847da552010-07-20 18:25:19 +000065 endif
NAKAMURA Takumib4b544d2010-11-29 00:20:34 +000066 endif
Anton Korobeynikov294492b2006-09-08 18:00:43 +000067endif
Reid Spencerac285882006-05-30 21:20:55 +000068
Tobias Grosserbaaadb22010-10-30 00:54:26 +000069ifdef LLVM_HAS_POLLY
70 PARALLEL_DIRS += polly
71endif
Daniel Dunbarb8810a32010-12-16 15:42:26 +000072endif
Tobias Grosserbaaadb22010-10-30 00:54:26 +000073
NAKAMURA Takumif5f65882010-11-29 00:20:28 +000074# On Win32, loadable modules can be built with ENABLE_SHARED.
75ifneq ($(ENABLE_SHARED),1)
NAKAMURA Takumi0ae59f42010-11-29 08:58:11 +000076 ifneq (,$(filter $(HOST_OS), Cygwin MingW))
NAKAMURA Takumif5f65882010-11-29 00:20:28 +000077 PARALLEL_DIRS := $(filter-out bugpoint-passes, \
78 $(PARALLEL_DIRS))
79 endif
80endif
81
Chris Lattnercf8cb6d2006-09-08 18:33:49 +000082include $(LEVEL)/Makefile.common