blob: eaf9ed3577276d06a1426a8b0f3ca6cd745f2c40 [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
NAKAMURA Takumi914f1922011-10-16 02:54:26 +000012include $(LEVEL)/Makefile.config
13
Mike Stump82221d62009-01-24 00:00:41 +000014# Build clang if present.
NAKAMURA Takumi914f1922011-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 Stump82221d62009-01-24 00:00:41 +000021
Stephen Wilsona32b8d72011-02-20 04:17:15 +000022# Build LLDB if present. Note LLDB must be built last as it depends on the
Jim Grosbach0072cdb2011-03-18 17:11:39 +000023# wider LLVM infrastructure (including Clang).
Stephen Wilsona32b8d72011-02-20 04:17:15 +000024OPTIONAL_DIRS := lldb
25
Mikhail Glushenkov98d5ed52008-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 Spencer49785b92007-02-09 17:02:07 +000028# in parallel builds. Please retain this ordering.
Jim Grosbach0072cdb2011-03-18 17:11:39 +000029DIRS := llvm-config
Chris Lattner9289f932010-07-20 20:55:57 +000030PARALLEL_DIRS := opt llvm-as llvm-dis \
Reid Spencer49785b92007-02-09 17:02:07 +000031 llc llvm-ranlib llvm-ar llvm-nm \
Michael J. Spencer91254932012-04-19 19:27:54 +000032 llvm-prof llvm-link \
Chris Lattner979634b2010-07-20 18:25:19 +000033 lli llvm-extract llvm-mc \
Michael J. Spencer91254932012-04-19 19:27:54 +000034 bugpoint llvm-bcanalyzer \
David Meyer2fc34c52012-03-01 01:36:50 +000035 llvm-diff macho-dump llvm-objdump llvm-readobj \
Andrew Kaylorc5feb512012-11-27 01:24:25 +000036 llvm-rtdyld llvm-dwarfdump llvm-cov \
Alexander Potapenko8c07f552012-11-12 11:33:29 +000037 llvm-size llvm-stress llvm-mcmarkup \
Rafael Espindola3add3e92013-04-05 20:00:35 +000038 llvm-symbolizer obj2yaml yaml2obj
Bill Wendling3f19dfe72007-12-08 23:58:46 +000039
Andrew Kaylorc5feb512012-11-27 01:24:25 +000040# If Intel JIT Events support is configured, build an extra tool to test it.
41ifeq ($(USE_INTEL_JITEVENTS), 1)
42 PARALLEL_DIRS += llvm-jitlistener
43endif
44
Chris Lattner0cb89772009-04-25 22:08:52 +000045# Let users override the set of tools to build from the command line.
46ifdef ONLY_TOOLS
47 OPTIONAL_PARALLEL_DIRS :=
Stephen Wilsona32b8d72011-02-20 04:17:15 +000048 OPTIONAL_DIRS := $(findstring lldb,$(ONLY_TOOLS))
49 PARALLEL_DIRS := $(filter-out lldb,$(ONLY_TOOLS))
Chris Lattner0cb89772009-04-25 22:08:52 +000050endif
51
Chris Lattner2e89d202010-03-05 00:59:18 +000052# These libraries build as dynamic libraries (.dylib /.so), they can only be
53# built if ENABLE_PIC is set.
Daniel Dunbar73a860b2010-12-16 15:42:26 +000054ifndef ONLY_TOOLS
Nick Lewycky9e26e6d2009-03-03 07:45:09 +000055ifeq ($(ENABLE_PIC),1)
NAKAMURA Takumi71c8c122010-11-29 00:20:34 +000056 # gold only builds if binutils is around. It requires "lto" to build before
57 # it so it is added to DIRS.
58 ifdef BINUTILS_INCDIR
59 DIRS += lto gold
60 else
61 PARALLEL_DIRS += lto
62 endif
Chris Lattner979634b2010-07-20 18:25:19 +000063
NAKAMURA Takumi71c8c122010-11-29 00:20:34 +000064 PARALLEL_DIRS += bugpoint-passes
Anton Korobeynikovdc7b5192006-09-08 18:00:43 +000065endif
Reid Spencerc3b93702006-05-30 21:20:55 +000066
Tobias Grosserea9dca42010-10-30 00:54:26 +000067ifdef LLVM_HAS_POLLY
68 PARALLEL_DIRS += polly
69endif
Daniel Dunbar73a860b2010-12-16 15:42:26 +000070endif
Tobias Grosserea9dca42010-10-30 00:54:26 +000071
NAKAMURA Takumi142b3252010-11-29 00:20:28 +000072# On Win32, loadable modules can be built with ENABLE_SHARED.
73ifneq ($(ENABLE_SHARED),1)
NAKAMURA Takumi638110f2010-11-29 08:58:11 +000074 ifneq (,$(filter $(HOST_OS), Cygwin MingW))
NAKAMURA Takumi142b3252010-11-29 00:20:28 +000075 PARALLEL_DIRS := $(filter-out bugpoint-passes, \
76 $(PARALLEL_DIRS))
77 endif
78endif
79
Chris Lattnerfe01c282006-09-08 18:33:49 +000080include $(LEVEL)/Makefile.common