blob: e124422cd6de023ebbcfdf0103f9e44d00dd282b [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
Mikhail Glushenkov98d5ed52008-11-25 21:38:12 +000015# 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 Spencer49785b92007-02-09 17:02:07 +000017# in parallel builds. Please retain this ordering.
Nick Lewycky5eb37732009-02-26 07:56:49 +000018DIRS := llvm-config
19PARALLEL_DIRS := opt llvm-as llvm-dis \
Reid Spencer49785b92007-02-09 17:02:07 +000020 llc llvm-ranlib llvm-ar llvm-nm \
Chris Lattnere950eee2008-03-30 18:58:05 +000021 llvm-ld llvm-prof llvm-link \
Chris Lattnercb08fb72009-10-05 02:29:51 +000022 lli llvm-extract \
Daniel Dunbarfdbbc522009-06-29 21:12:26 +000023 bugpoint llvm-bcanalyzer llvm-stub \
Chris Lattner2e89d202010-03-05 00:59:18 +000024 llvm-mc llvmc
Bill Wendling3f19dfe72007-12-08 23:58:46 +000025
Chris Lattner0cb89772009-04-25 22:08:52 +000026# Let users override the set of tools to build from the command line.
27ifdef ONLY_TOOLS
28 OPTIONAL_PARALLEL_DIRS :=
29 PARALLEL_DIRS := $(ONLY_TOOLS)
30endif
31
Chris Lattnerfe01c282006-09-08 18:33:49 +000032include $(LEVEL)/Makefile.config
Chris Lattnereda4a9e2006-09-08 18:08:50 +000033
Chris Lattner2e89d202010-03-05 00:59:18 +000034# These libraries build as dynamic libraries (.dylib /.so), they can only be
35# built if ENABLE_PIC is set.
Nick Lewycky9e26e6d2009-03-03 07:45:09 +000036ifeq ($(ENABLE_PIC),1)
Chris Lattner2e89d202010-03-05 00:59:18 +000037 # No support for dynamic libraries on windows targets.
38 ifneq ($(TARGET_OS), $(filter $(TARGET_OS), Cygwin MingW))
Chris Lattner5ec1b24f2010-03-05 02:34:34 +000039 PARALLEL_DIRS += edis
Bill Wendlingc9416192010-03-23 22:15:33 +000040
Chris Lattner5ec1b24f2010-03-05 02:34:34 +000041 # gold only builds if binutils is around. It requires "lto" to build before
42 # it so it is added to DIRS.
Chris Lattner2e89d202010-03-05 00:59:18 +000043 ifdef BINUTILS_INCDIR
Duncan Sands5674c342010-03-09 09:03:21 +000044 DIRS += lto gold
Chris Lattner5ec1b24f2010-03-05 02:34:34 +000045 else
46 PARALLEL_DIRS += lto
Chris Lattner2e89d202010-03-05 00:59:18 +000047 endif
Nick Lewycky5eb37732009-02-26 07:56:49 +000048 endif
Anton Korobeynikovdc7b5192006-09-08 18:00:43 +000049endif
Reid Spencerc3b93702006-05-30 21:20:55 +000050
Chris Lattner134a9dc2010-02-26 21:26:33 +000051# Only build edis if X86 target support is enabled.
52ifeq ($(filter $(TARGETS_TO_BUILD), X86),)
53 PARALLEL_DIRS := $(filter-out edis, $(PARALLEL_DIRS))
54endif
55
Bill Wendlingc9416192010-03-23 22:15:33 +000056# Don't build edis if we explicitly disabled it.
Bill Wendling703d0b92010-03-23 23:09:03 +000057ifeq ($(DISABLE_EDIS),1)
Bill Wendlingc9416192010-03-23 22:15:33 +000058 PARALLEL_DIRS := $(filter-out edis, $(PARALLEL_DIRS))
59endif
60
Chris Lattnerfe01c282006-09-08 18:33:49 +000061include $(LEVEL)/Makefile.common