blob: 550f2aff29fde5fc1d5c524968042714acc10e01 [file] [log] [blame]
Misha Brukman7426c892004-04-24 00:10:56 +00001#===- ./Makefile -------------------------------------------*- Makefile -*--===#
John Criswell4436c492003-10-20 22:26:57 +00002#
3# The LLVM Compiler Infrastructure
4#
5# This file was developed by the LLVM research group and is distributed under
6# the University of Illinois Open Source License. See LICENSE.TXT for details.
7#
Misha Brukman7426c892004-04-24 00:10:56 +00008#===------------------------------------------------------------------------===#
Chris Lattner2f7c9632001-06-06 20:29:01 +00009LEVEL = .
Reid Spencera22a5b32006-05-17 22:55:35 +000010DIRS = lib/System lib/Support utils lib/VMCore lib
Chris Lattner2f7c9632001-06-06 20:29:01 +000011
Reid Spencer8ac50622006-04-08 02:14:37 +000012include $(LEVEL)/Makefile.config
Reid Spenceraed84e42006-04-06 22:15:51 +000013
Reid Spencerfec4f802005-05-25 21:03:17 +000014ifeq ($(MAKECMDGOALS),tools-only)
Reid Spenceraed84e42006-04-06 22:15:51 +000015 DIRS += tools
Reid Spencerfec4f802005-05-25 21:03:17 +000016else
17 ifneq ($(MAKECMDGOALS),libs-only)
Reid Spenceraed84e42006-04-06 22:15:51 +000018 DIRS += tools
Reid Spencer4873c792006-04-07 21:45:23 +000019 ifneq ($(LLVMGCC_MAJVERS),4)
Reid Spenceraed84e42006-04-06 22:15:51 +000020 DIRS += runtime
21 else
22 $(warning Skipping runtime libraries, llvm-gcc 4 detected.)
23 endif
Chris Lattnerf5668212006-06-02 22:34:39 +000024
25 # Don't install examples or projects.
26 ifneq ($(MAKECMDGOALS),install)
27 OPTIONAL_DIRS := examples projects
28 endif
Reid Spenceraed84e42006-04-06 22:15:51 +000029 DIRS += docs
Reid Spencerfec4f802005-05-25 21:03:17 +000030 endif
Chris Lattner135dcc02004-02-03 23:05:24 +000031endif
Reid Spencerd3d5fc02006-04-12 20:53:14 +000032EXTRA_DIST := test llvm.spec include win32 Xcode
Reid Spencer4a9b5ff2004-10-26 07:05:09 +000033
Reid Spencer8ac50622006-04-08 02:14:37 +000034include $(LLVM_SRC_ROOT)/Makefile.rules
35
Reid Spencer13f51932005-05-24 02:33:20 +000036# Specify options to pass to configure script when we're
37# running the dist-check target
38DIST_CHECK_CONFIG_OPTIONS = --with-llvmgccdir=$(LLVMGCCDIR)
39
Reid Spencer33478272004-11-25 09:08:54 +000040.PHONY: debug-opt-prof
41debug-opt-prof:
42 $(Echo) Building Debug Version
43 $(Verb) $(MAKE)
44 $(Echo)
45 $(Echo) Building Optimized Version
46 $(Echo)
47 $(Verb) $(MAKE) ENABLE_OPTIMIZED=1
48 $(Echo)
49 $(Echo) Building Profiling Version
50 $(Echo)
51 $(Verb) $(MAKE) ENABLE_PROFILING=1
52
Reid Spencer100080c2004-10-25 08:27:37 +000053dist-hook::
Reid Spencerf88808a2004-10-30 09:19:36 +000054 $(Echo) Eliminating files constructed by configure
55 $(Verb) $(RM) -f \
Reid Spencer4a9b5ff2004-10-26 07:05:09 +000056 $(TopDistDir)/include/llvm/ADT/hash_map \
57 $(TopDistDir)/include/llvm/ADT/hash_set \
58 $(TopDistDir)/include/llvm/ADT/iterator \
59 $(TopDistDir)/include/llvm/Config/config.h \
60 $(TopDistDir)/include/llvm/Support/DataTypes.h \
61 $(TopDistDir)/include/llvm/Support/ThreadSupport.h
Reid Spencer100080c2004-10-25 08:27:37 +000062
Chris Lattner6bd75a62004-02-03 22:56:40 +000063tools-only: all
Reid Spencerfec4f802005-05-25 21:03:17 +000064libs-only: all
Reid Spencer53846bc2005-08-25 04:59:49 +000065
66#------------------------------------------------------------------------
67# Make sure the generated headers are up-to-date. This must be kept in
68# sync with the AC_CONFIG_HEADER invocations in autoconf/configure.ac
69#------------------------------------------------------------------------
70FilesToConfig := \
71 include/llvm/Config/config.h \
72 include/llvm/Support/DataTypes.h \
73 include/llvm/ADT/hash_map \
74 include/llvm/ADT/hash_set \
75 include/llvm/ADT/iterator
76FilesToConfigPATH := $(addprefix $(LLVM_OBJ_ROOT)/,$(FilesToConfig))
77
78all-local:: $(FilesToConfigPATH)
79$(FilesToConfigPATH) : $(LLVM_OBJ_ROOT)/% : $(LLVM_SRC_ROOT)/%.in
80 $(Echo) Regenerating $*
81 $(Verb) cd $(LLVM_OBJ_ROOT) && $(ConfigStatusScript) $*
82.PRECIOUS: $(FilesToConfigPATH)
Reid Spencer754cfec2006-04-07 15:58:18 +000083
Chris Lattnere690a932006-04-07 16:21:59 +000084# NOTE: This needs to remain as the last target definition in this file so
85# that it gets executed last.
Reid Spencer754cfec2006-04-07 15:58:18 +000086all::
87 $(Echo) '*****' Completed $(BuildMode)$(AssertMode) Build
88ifeq ($(BuildMode),Debug)
89 $(Echo) '*****' Note: Debug build can be 10 times slower than an
90 $(Echo) '*****' optimized build. Use 'make ENABLE_OPTIMIZED=1' to
91 $(Echo) '*****' make an optimized build.
92endif
Chris Lattnere690a932006-04-07 16:21:59 +000093
Reid Spencer9c226202006-06-01 07:27:53 +000094check-llvm2cpp:
95 $(MAKE) check TESTSUITE=Feature RUNLLVM2CPP=1