blob: 86ba72ddacc6a40a58fc576becc14da08ea5e46a [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
12# Build clang if present.
13OPTIONAL_PARALLEL_DIRS := clang
14
Mikhail Glushenkov113ec352008-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 Spencer36a987e2007-02-09 17:02:07 +000017# in parallel builds. Please retain this ordering.
Nick Lewyckydcd158a2009-02-26 07:56:49 +000018DIRS := llvm-config
19PARALLEL_DIRS := opt llvm-as llvm-dis \
Reid Spencer36a987e2007-02-09 17:02:07 +000020 llc llvm-ranlib llvm-ar llvm-nm \
Chris Lattner8c2ec512008-03-30 18:58:05 +000021 llvm-ld llvm-prof llvm-link \
Chris Lattnerdbf75e82009-10-05 02:29:51 +000022 lli llvm-extract \
Daniel Dunbar74deeb82009-06-29 21:12:26 +000023 bugpoint llvm-bcanalyzer llvm-stub \
Chris Lattner23e6d2b2010-03-05 00:59:18 +000024 llvm-mc llvmc
25
Bill Wendling041b3f82007-12-08 23:58:46 +000026
Chris Lattner06942902009-04-25 22:08:52 +000027# Let users override the set of tools to build from the command line.
28ifdef ONLY_TOOLS
29 OPTIONAL_PARALLEL_DIRS :=
30 PARALLEL_DIRS := $(ONLY_TOOLS)
31endif
32
Chris Lattnercf8cb6d2006-09-08 18:33:49 +000033include $(LEVEL)/Makefile.config
Chris Lattner70c35372006-09-08 18:08:50 +000034
Chris Lattner23e6d2b2010-03-05 00:59:18 +000035# These libraries build as dynamic libraries (.dylib /.so), they can only be
36# built if ENABLE_PIC is set.
Nick Lewyckye9742d22009-03-03 07:45:09 +000037ifeq ($(ENABLE_PIC),1)
Chris Lattner23e6d2b2010-03-05 00:59:18 +000038 # No support for dynamic libraries on windows targets.
39 ifneq ($(TARGET_OS), $(filter $(TARGET_OS), Cygwin MingW))
Chris Lattnere5605772010-03-05 02:34:34 +000040 PARALLEL_DIRS += edis
41
42 # gold only builds if binutils is around. It requires "lto" to build before
43 # it so it is added to DIRS.
Chris Lattner23e6d2b2010-03-05 00:59:18 +000044 ifdef BINUTILS_INCDIR
45 PARALLEL_DIRS += gold
Chris Lattnere5605772010-03-05 02:34:34 +000046 DIRS += lto
47 else
48 PARALLEL_DIRS += lto
Chris Lattner23e6d2b2010-03-05 00:59:18 +000049 endif
Nick Lewyckydcd158a2009-02-26 07:56:49 +000050 endif
Anton Korobeynikov294492b2006-09-08 18:00:43 +000051endif
Reid Spencerac285882006-05-30 21:20:55 +000052
Chris Lattner68e32662010-02-26 21:26:33 +000053# Only build edis if X86 target support is enabled.
54ifeq ($(filter $(TARGETS_TO_BUILD), X86),)
55 PARALLEL_DIRS := $(filter-out edis, $(PARALLEL_DIRS))
56endif
57
Chris Lattnercf8cb6d2006-09-08 18:33:49 +000058include $(LEVEL)/Makefile.common