2004-04-24 08:10:56 +08:00
|
|
|
#===- ./Makefile -------------------------------------------*- Makefile -*--===#
|
2003-10-21 06:26:57 +08:00
|
|
|
#
|
|
|
|
# The LLVM Compiler Infrastructure
|
|
|
|
#
|
2007-12-30 04:11:13 +08:00
|
|
|
# This file is distributed under the University of Illinois Open Source
|
|
|
|
# License. See LICENSE.TXT for details.
|
2003-10-21 06:26:57 +08:00
|
|
|
#
|
2004-04-24 08:10:56 +08:00
|
|
|
#===------------------------------------------------------------------------===#
|
2006-06-03 06:41:18 +08:00
|
|
|
|
2006-07-27 03:10:34 +08:00
|
|
|
LEVEL := .
|
2006-09-04 12:27:07 +08:00
|
|
|
|
|
|
|
# Top-Level LLVM Build Stages:
|
|
|
|
# 1. Build lib/System and lib/Support, which are used by utils (tblgen).
|
|
|
|
# 2. Build utils, which is used by VMCore.
|
|
|
|
# 3. Build VMCore, which builds the Intrinsics.inc file used by libs.
|
|
|
|
# 4. Build libs, which are needed by llvm-config.
|
|
|
|
# 5. Build llvm-config, which determines inter-lib dependencies for tools.
|
2006-11-17 11:32:33 +08:00
|
|
|
# 6. Build tools, runtime, docs.
|
2006-09-04 12:27:07 +08:00
|
|
|
#
|
|
|
|
DIRS := lib/System lib/Support utils lib/VMCore lib tools/llvm-config \
|
2006-11-17 11:32:33 +08:00
|
|
|
tools runtime docs
|
2007-07-12 07:44:08 +08:00
|
|
|
|
2007-09-18 20:49:39 +08:00
|
|
|
OPTIONAL_DIRS := examples projects bindings
|
2006-07-27 03:10:34 +08:00
|
|
|
EXTRA_DIST := test llvm.spec include win32 Xcode
|
2001-06-07 04:29:01 +08:00
|
|
|
|
2006-04-08 10:14:37 +08:00
|
|
|
include $(LEVEL)/Makefile.config
|
2006-04-07 06:15:51 +08:00
|
|
|
|
2007-03-30 02:14:00 +08:00
|
|
|
# llvm-gcc4 doesn't need runtime libs. llvm-gcc4 is the only supported one.
|
|
|
|
# FIXME: Remove runtime entirely once we have an understanding of where
|
|
|
|
# libprofile etc should go.
|
|
|
|
#ifeq ($(LLVMGCC_MAJVERS),4)
|
2006-11-17 11:32:33 +08:00
|
|
|
DIRS := $(filter-out runtime, $(DIRS))
|
2007-03-30 02:14:00 +08:00
|
|
|
#endif
|
2006-11-17 11:32:33 +08:00
|
|
|
|
2006-07-27 03:10:34 +08:00
|
|
|
ifeq ($(MAKECMDGOALS),libs-only)
|
2006-11-17 11:32:33 +08:00
|
|
|
DIRS := $(filter-out tools runtime docs, $(DIRS))
|
2006-07-27 03:10:34 +08:00
|
|
|
OPTIONAL_DIRS :=
|
|
|
|
endif
|
2006-06-03 06:41:18 +08:00
|
|
|
|
2007-12-13 10:17:17 +08:00
|
|
|
ifeq ($(MAKECMDGOALS),install-libs)
|
|
|
|
DIRS := $(filter-out tools runtime docs, $(DIRS))
|
|
|
|
OPTIONAL_DIRS := $(filter bindings, $(OPTIONAL_DIRS))
|
|
|
|
endif
|
|
|
|
|
2005-05-26 05:03:17 +08:00
|
|
|
ifeq ($(MAKECMDGOALS),tools-only)
|
2006-11-17 11:32:33 +08:00
|
|
|
DIRS := $(filter-out runtime docs, $(DIRS))
|
2006-07-27 03:10:34 +08:00
|
|
|
OPTIONAL_DIRS :=
|
2004-02-04 07:05:24 +08:00
|
|
|
endif
|
2006-06-03 06:41:18 +08:00
|
|
|
|
2007-02-21 14:23:20 +08:00
|
|
|
# Don't install utils, examples, or projects they are only used to
|
|
|
|
# build LLVM.
|
|
|
|
ifeq ($(MAKECMDGOALS),install)
|
|
|
|
DIRS := $(filter-out utils, $(DIRS))
|
2007-09-18 20:49:39 +08:00
|
|
|
OPTIONAL_DIRS := $(filter bindings, $(OPTIONAL_DIRS))
|
2007-02-21 14:23:20 +08:00
|
|
|
endif
|
|
|
|
|
2006-06-03 06:41:18 +08:00
|
|
|
# Include the main makefile machinery.
|
2006-04-08 10:14:37 +08:00
|
|
|
include $(LLVM_SRC_ROOT)/Makefile.rules
|
|
|
|
|
2005-05-24 10:33:20 +08:00
|
|
|
# Specify options to pass to configure script when we're
|
|
|
|
# running the dist-check target
|
|
|
|
DIST_CHECK_CONFIG_OPTIONS = --with-llvmgccdir=$(LLVMGCCDIR)
|
|
|
|
|
2004-11-25 17:08:54 +08:00
|
|
|
.PHONY: debug-opt-prof
|
|
|
|
debug-opt-prof:
|
|
|
|
$(Echo) Building Debug Version
|
|
|
|
$(Verb) $(MAKE)
|
|
|
|
$(Echo)
|
|
|
|
$(Echo) Building Optimized Version
|
|
|
|
$(Echo)
|
|
|
|
$(Verb) $(MAKE) ENABLE_OPTIMIZED=1
|
|
|
|
$(Echo)
|
|
|
|
$(Echo) Building Profiling Version
|
|
|
|
$(Echo)
|
|
|
|
$(Verb) $(MAKE) ENABLE_PROFILING=1
|
|
|
|
|
2004-10-25 16:27:37 +08:00
|
|
|
dist-hook::
|
2004-10-30 17:19:36 +08:00
|
|
|
$(Echo) Eliminating files constructed by configure
|
|
|
|
$(Verb) $(RM) -f \
|
2004-10-26 15:05:09 +08:00
|
|
|
$(TopDistDir)/include/llvm/ADT/hash_map \
|
|
|
|
$(TopDistDir)/include/llvm/ADT/hash_set \
|
|
|
|
$(TopDistDir)/include/llvm/ADT/iterator \
|
|
|
|
$(TopDistDir)/include/llvm/Config/config.h \
|
|
|
|
$(TopDistDir)/include/llvm/Support/DataTypes.h \
|
|
|
|
$(TopDistDir)/include/llvm/Support/ThreadSupport.h
|
2004-10-25 16:27:37 +08:00
|
|
|
|
2004-02-04 06:56:40 +08:00
|
|
|
tools-only: all
|
2005-05-26 05:03:17 +08:00
|
|
|
libs-only: all
|
2007-12-13 10:17:17 +08:00
|
|
|
install-libs: install
|
2005-08-25 12:59:49 +08:00
|
|
|
|
|
|
|
#------------------------------------------------------------------------
|
|
|
|
# Make sure the generated headers are up-to-date. This must be kept in
|
|
|
|
# sync with the AC_CONFIG_HEADER invocations in autoconf/configure.ac
|
|
|
|
#------------------------------------------------------------------------
|
|
|
|
FilesToConfig := \
|
|
|
|
include/llvm/Config/config.h \
|
|
|
|
include/llvm/Support/DataTypes.h \
|
|
|
|
include/llvm/ADT/hash_map \
|
|
|
|
include/llvm/ADT/hash_set \
|
|
|
|
include/llvm/ADT/iterator
|
|
|
|
FilesToConfigPATH := $(addprefix $(LLVM_OBJ_ROOT)/,$(FilesToConfig))
|
|
|
|
|
|
|
|
all-local:: $(FilesToConfigPATH)
|
|
|
|
$(FilesToConfigPATH) : $(LLVM_OBJ_ROOT)/% : $(LLVM_SRC_ROOT)/%.in
|
|
|
|
$(Echo) Regenerating $*
|
|
|
|
$(Verb) cd $(LLVM_OBJ_ROOT) && $(ConfigStatusScript) $*
|
|
|
|
.PRECIOUS: $(FilesToConfigPATH)
|
2006-04-07 23:58:18 +08:00
|
|
|
|
2006-04-08 00:21:59 +08:00
|
|
|
# NOTE: This needs to remain as the last target definition in this file so
|
|
|
|
# that it gets executed last.
|
2006-04-07 23:58:18 +08:00
|
|
|
all::
|
|
|
|
$(Echo) '*****' Completed $(BuildMode)$(AssertMode) Build
|
|
|
|
ifeq ($(BuildMode),Debug)
|
|
|
|
$(Echo) '*****' Note: Debug build can be 10 times slower than an
|
|
|
|
$(Echo) '*****' optimized build. Use 'make ENABLE_OPTIMIZED=1' to
|
2008-02-28 19:48:14 +08:00
|
|
|
$(Echo) '*****' make an optimized build. Alternatively you can
|
|
|
|
$(Echo) '*****' configure with --enable-optimized.
|
2006-04-07 23:58:18 +08:00
|
|
|
endif
|
2006-04-08 00:21:59 +08:00
|
|
|
|
2006-06-01 15:27:53 +08:00
|
|
|
check-llvm2cpp:
|
2007-04-15 14:22:48 +08:00
|
|
|
$(Verb)$(MAKE) check TESTSUITE=Feature RUNLLVM2CPP=1
|
2006-07-27 03:10:34 +08:00
|
|
|
|
2007-04-15 14:18:50 +08:00
|
|
|
check-one:
|
2007-04-15 14:22:48 +08:00
|
|
|
$(Verb)$(MAKE) -C test check-one TESTONE=$(TESTONE)
|
2007-04-15 14:18:50 +08:00
|
|
|
|
2006-08-16 08:43:50 +08:00
|
|
|
srpm: $(LLVM_OBJ_ROOT)/llvm.spec
|
|
|
|
rpmbuild -bs $(LLVM_OBJ_ROOT)/llvm.spec
|
|
|
|
|
|
|
|
rpm: $(LLVM_OBJ_ROOT)/llvm.spec
|
|
|
|
rpmbuild -bb --target $(TARGET_TRIPLE) $(LLVM_OBJ_ROOT)/llvm.spec
|
|
|
|
|
2007-02-06 07:18:58 +08:00
|
|
|
show-footprint:
|
|
|
|
$(Verb) du -sk $(LibDir)
|
|
|
|
$(Verb) du -sk $(ToolDir)
|
|
|
|
$(Verb) du -sk $(ExmplDir)
|
|
|
|
$(Verb) du -sk $(ObjDir)
|
|
|
|
|
2007-07-08 11:50:22 +08:00
|
|
|
build-for-llvm-top:
|
|
|
|
$(Verb) if test ! -f ./config.status ; then \
|
|
|
|
./configure --prefix="$(LLVM_TOP)/install" \
|
|
|
|
--with-llvm-gcc="$(LLVM_TOP)/llvm-gcc" ; \
|
|
|
|
fi
|
|
|
|
$(Verb) $(MAKE) tools-only
|
|
|
|
|
2006-08-16 08:43:50 +08:00
|
|
|
.PHONY: srpm rpm
|
2007-07-08 11:50:22 +08:00
|
|
|
|
2008-02-28 19:48:14 +08:00
|
|
|
# declare all targets at this level to be serial:
|
|
|
|
|
|
|
|
.NOTPARALLEL:
|
|
|
|
|