1 #===- ./Makefile -------------------------------------------*- Makefile -*--===#
3 # The LLVM Compiler Infrastructure
5 # This file is distributed under the University of Illinois Open Source
6 # License. See LICENSE.TXT for details.
8 #===------------------------------------------------------------------------===#
12 # Top-Level LLVM Build Stages:
13 # 1. Build lib/System and lib/Support, which are used by utils (tblgen).
14 # 2. Build utils, which is used by VMCore.
15 # 3. Build VMCore, which builds the Intrinsics.inc file used by libs.
16 # 4. Build libs, which are needed by llvm-config.
17 # 5. Build llvm-config, which determines inter-lib dependencies for tools.
18 # 6. Build tools, runtime, docs.
20 DIRS
:= lib
/System lib
/Support utils lib
/VMCore lib tools
/llvm-config \
23 OPTIONAL_DIRS
:= examples projects bindings
24 EXTRA_DIST
:= test llvm.spec
include win32 Xcode
26 include $(LEVEL
)/Makefile.config
28 # When cross-compiling, there are some things (tablegen) that need to
29 # be build for the build system.
30 ifeq ($(LLVM_CROSS_COMPILING
),1)
31 BUILD_TARGET_DIRS
:= lib
/System lib
/Support utils
34 # llvm-gcc4 doesn't need runtime libs. llvm-gcc4 is the only supported one.
35 # FIXME: Remove runtime entirely once we have an understanding of where
36 # libprofile etc should go.
37 #ifeq ($(LLVMGCC_MAJVERS),4)
38 DIRS
:= $(filter-out runtime
, $(DIRS
))
41 ifeq ($(MAKECMDGOALS
),libs-only
)
42 DIRS
:= $(filter-out tools runtime docs
, $(DIRS
))
46 ifeq ($(MAKECMDGOALS
),install-libs
)
47 DIRS
:= $(filter-out tools runtime docs
, $(DIRS
))
48 OPTIONAL_DIRS
:= $(filter bindings
, $(OPTIONAL_DIRS
))
51 ifeq ($(MAKECMDGOALS
),tools-only
)
52 DIRS
:= $(filter-out runtime docs
, $(DIRS
))
56 # Don't install utils, examples, or projects they are only used to
58 ifeq ($(MAKECMDGOALS
),install)
59 DIRS
:= $(filter-out utils
, $(DIRS
))
60 OPTIONAL_DIRS
:= $(filter bindings
, $(OPTIONAL_DIRS
))
63 # Include the main makefile machinery.
64 include $(LLVM_SRC_ROOT
)/Makefile.rules
66 # Specify options to pass to configure script when we're
67 # running the dist-check target
68 DIST_CHECK_CONFIG_OPTIONS
= --with-llvmgccdir
=$(LLVMGCCDIR
)
70 .PHONY
: debug-opt-prof
72 $(Echo
) Building Debug Version
75 $(Echo
) Building Optimized Version
77 $(Verb
) $(MAKE
) ENABLE_OPTIMIZED
=1
79 $(Echo
) Building Profiling Version
81 $(Verb
) $(MAKE
) ENABLE_PROFILING
=1
84 $(Echo
) Eliminating files constructed by configure
86 $(TopDistDir
)/include/llvm
/ADT
/hash_map.h \
87 $(TopDistDir
)/include/llvm
/ADT
/hash_set.h \
88 $(TopDistDir
)/include/llvm
/ADT
/iterator.h \
89 $(TopDistDir
)/include/llvm
/Config
/config.h \
90 $(TopDistDir
)/include/llvm
/Support
/DataTypes.h \
91 $(TopDistDir
)/include/llvm
/Support
/ThreadSupport.h
97 #------------------------------------------------------------------------
98 # Make sure the generated headers are up-to-date. This must be kept in
99 # sync with the AC_CONFIG_HEADER invocations in autoconf/configure.ac
100 #------------------------------------------------------------------------
102 include/llvm
/Config
/config.h \
103 include/llvm
/Support
/DataTypes.h \
104 include/llvm
/ADT
/hash_map.h \
105 include/llvm
/ADT
/hash_set.h \
106 include/llvm
/ADT
/iterator.h
107 FilesToConfigPATH
:= $(addprefix $(LLVM_OBJ_ROOT
)/,$(FilesToConfig
))
109 all-local
:: $(FilesToConfigPATH
)
110 $(FilesToConfigPATH
) : $(LLVM_OBJ_ROOT
)/% : $(LLVM_SRC_ROOT
)/%.in
111 $(Echo
) Regenerating
$*
112 $(Verb
) cd
$(LLVM_OBJ_ROOT
) && $(ConfigStatusScript
) $*
113 .PRECIOUS
: $(FilesToConfigPATH
)
115 # NOTE: This needs to remain as the last target definition in this file so
116 # that it gets executed last.
118 $(Echo
) '*****' Completed
$(BuildMode
)$(AssertMode
) Build
119 ifeq ($(BuildMode
),Debug
)
120 $(Echo
) '*****' Note
: Debug build can be
10 times slower than an
121 $(Echo
) '*****' optimized build. Use
'make ENABLE_OPTIMIZED=1' to
122 $(Echo
) '*****' make an optimized build. Alternatively you can
123 $(Echo
) '*****' configure with
--enable-optimized.
127 $(Verb
)$(MAKE
) check TESTSUITE
=Feature RUNLLVM2CPP
=1
130 $(Verb
)$(MAKE
) -C
test check-one TESTONE
=$(TESTONE
)
132 srpm
: $(LLVM_OBJ_ROOT
)/llvm.spec
133 rpmbuild
-bs
$(LLVM_OBJ_ROOT
)/llvm.spec
135 rpm
: $(LLVM_OBJ_ROOT
)/llvm.spec
136 rpmbuild
-bb
--target
$(TARGET_TRIPLE
) $(LLVM_OBJ_ROOT
)/llvm.spec
139 $(Verb
) du
-sk
$(LibDir
)
140 $(Verb
) du
-sk
$(ToolDir
)
141 $(Verb
) du
-sk
$(ExmplDir
)
142 $(Verb
) du
-sk
$(ObjDir
)
145 $(Verb
) if
test ! -f .
/config.status
; then \
146 .
/configure
--prefix="$(LLVM_TOP)/install" \
147 --with-llvm-gcc
="$(LLVM_TOP)/llvm-gcc" ; \
149 $(Verb
) $(MAKE
) tools-only
154 SUB-SVN-DIRS
= $(AWK
) '/\?\ \ \ \ \ \ / {print $$2}' \
155 | LANG
=C xargs
$(SVN
) info 2>/dev
/null \
156 |
$(AWK
) '/Path:\ / {print $$2}'
159 $(SVN
) $(SVN-UPDATE-OPTIONS
) update
$(LLVM_SRC_ROOT
)
160 @
$(SVN
) status
$(LLVM_SRC_ROOT
) |
$(SUB-SVN-DIRS
) | xargs
$(SVN
) $(SVN-UPDATE-OPTIONS
) update
162 happiness
: update
all check
164 .PHONY
: srpm rpm update happiness
166 # declare all targets at this level to be serial: