blob: 68ce314c92a172ed0d581d74ceb9d98f57f61828 [file] [log] [blame]
Chris Lattner144992e2004-01-05 05:28:15 +00001##===- tools/Makefile --------------------------------------*- Makefile -*-===##
Mikhail Glushenkov98d5ed52008-11-25 21:38:12 +00002#
John Criswellabe5cdc2003-10-20 22:29:16 +00003# The LLVM Compiler Infrastructure
4#
Chris Lattner8fa21ac2007-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 Glushenkov98d5ed52008-11-25 21:38:12 +00007#
John Criswellabe5cdc2003-10-20 22:29:16 +00008##===----------------------------------------------------------------------===##
Chris Lattner144992e2004-01-05 05:28:15 +00009
Chris Lattner71b82e32002-12-06 03:53:40 +000010LEVEL := ..
Mike Stump82221d62009-01-24 00:00:41 +000011
12# Build clang if present.
13OPTIONAL_PARALLEL_DIRS := clang
14
Stephen Wilsona32b8d72011-02-20 04:17:15 +000015# Build LLDB if present. Note LLDB must be built last as it depends on the
Jim Grosbach0072cdb2011-03-18 17:11:39 +000016# wider LLVM infrastructure (including Clang).
Stephen Wilsona32b8d72011-02-20 04:17:15 +000017OPTIONAL_DIRS := lldb
18
Mikhail Glushenkov98d5ed52008-11-25 21:38:12 +000019# 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 Spencer49785b92007-02-09 17:02:07 +000021# in parallel builds. Please retain this ordering.
Jim Grosbach0072cdb2011-03-18 17:11:39 +000022DIRS := llvm-config
Chris Lattner9289f932010-07-20 20:55:57 +000023PARALLEL_DIRS := opt llvm-as llvm-dis \
Reid Spencer49785b92007-02-09 17:02:07 +000024 llc llvm-ranlib llvm-ar llvm-nm \
Chris Lattnere950eee2008-03-30 18:58:05 +000025 llvm-ld llvm-prof llvm-link \
Chris Lattner979634b2010-07-20 18:25:19 +000026 lli llvm-extract llvm-mc \
Rafael Espindola68f8b272010-08-09 14:05:42 +000027 bugpoint llvm-bcanalyzer llvm-stub \
Eric Christopher4b0ae482011-09-19 23:22:41 +000028 llvm-diff macho-dump llvm-objdump \
Michael J. Spencerc4ad4662011-09-28 20:57:46 +000029 llvm-rtdyld llvm-dwarfdump llvm-cov \
30 llvm-size
Bill Wendling3f19dfe72007-12-08 23:58:46 +000031
Chris Lattner0cb89772009-04-25 22:08:52 +000032# Let users override the set of tools to build from the command line.
33ifdef ONLY_TOOLS
34 OPTIONAL_PARALLEL_DIRS :=
Stephen Wilsona32b8d72011-02-20 04:17:15 +000035 OPTIONAL_DIRS := $(findstring lldb,$(ONLY_TOOLS))
36 PARALLEL_DIRS := $(filter-out lldb,$(ONLY_TOOLS))
Chris Lattner0cb89772009-04-25 22:08:52 +000037endif
38
Chris Lattnerfe01c282006-09-08 18:33:49 +000039include $(LEVEL)/Makefile.config
Chris Lattnereda4a9e2006-09-08 18:08:50 +000040
Chris Lattner979634b2010-07-20 18:25:19 +000041
Chris Lattner2e89d202010-03-05 00:59:18 +000042# These libraries build as dynamic libraries (.dylib /.so), they can only be
43# built if ENABLE_PIC is set.
Daniel Dunbar73a860b2010-12-16 15:42:26 +000044ifndef ONLY_TOOLS
Nick Lewycky9e26e6d2009-03-03 07:45:09 +000045ifeq ($(ENABLE_PIC),1)
NAKAMURA Takumi71c8c122010-11-29 00:20:34 +000046 # gold only builds if binutils is around. It requires "lto" to build before
47 # it so it is added to DIRS.
48 ifdef BINUTILS_INCDIR
49 DIRS += lto gold
50 else
51 PARALLEL_DIRS += lto
52 endif
Chris Lattner979634b2010-07-20 18:25:19 +000053
NAKAMURA Takumi71c8c122010-11-29 00:20:34 +000054 PARALLEL_DIRS += bugpoint-passes
Rafael Espindola68f8b272010-08-09 14:05:42 +000055
NAKAMURA Takumi71c8c122010-11-29 00:20:34 +000056 # The edis library is only supported if ARM and/or X86 are enabled, and if
57 # LLVM is being built PIC on platforms that support dylibs.
58 ifneq ($(DISABLE_EDIS),1)
Chris Lattner979634b2010-07-20 18:25:19 +000059 ifneq ($(filter $(TARGETS_TO_BUILD), X86 ARM),)
Chris Lattner9289f932010-07-20 20:55:57 +000060 PARALLEL_DIRS += edis
Chris Lattner979634b2010-07-20 18:25:19 +000061 endif
NAKAMURA Takumi71c8c122010-11-29 00:20:34 +000062 endif
Anton Korobeynikovdc7b5192006-09-08 18:00:43 +000063endif
Reid Spencerc3b93702006-05-30 21:20:55 +000064
Tobias Grosserea9dca42010-10-30 00:54:26 +000065ifdef LLVM_HAS_POLLY
66 PARALLEL_DIRS += polly
67endif
Daniel Dunbar73a860b2010-12-16 15:42:26 +000068endif
Tobias Grosserea9dca42010-10-30 00:54:26 +000069
NAKAMURA Takumi142b3252010-11-29 00:20:28 +000070# On Win32, loadable modules can be built with ENABLE_SHARED.
71ifneq ($(ENABLE_SHARED),1)
NAKAMURA Takumi638110f2010-11-29 08:58:11 +000072 ifneq (,$(filter $(HOST_OS), Cygwin MingW))
NAKAMURA Takumi142b3252010-11-29 00:20:28 +000073 PARALLEL_DIRS := $(filter-out bugpoint-passes, \
74 $(PARALLEL_DIRS))
75 endif
76endif
77
Chris Lattnerfe01c282006-09-08 18:33:49 +000078include $(LEVEL)/Makefile.common