blob: 0a27cbed46bd67596aaadc105bf04a26889aca90 [file] [log] [blame]
Misha Brukman6d5ab862004-04-24 00:10:56 +00001#===- ./Makefile -------------------------------------------*- Makefile -*--===#
John Criswelle488e932003-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 Brukman6d5ab862004-04-24 00:10:56 +00008#===------------------------------------------------------------------------===#
Chris Lattner22033b22006-06-02 22:41:18 +00009
Chris Lattner5720be42006-07-26 19:10:34 +000010LEVEL := .
11DIRS := lib/System lib/Support utils lib/VMCore lib tools runtime docs
12OPTIONAL_DIRS := examples projects
13EXTRA_DIST := test llvm.spec include win32 Xcode
Chris Lattner00950542001-06-06 20:29:01 +000014
Reid Spencer06a801a2006-04-08 02:14:37 +000015include $(LEVEL)/Makefile.config
Reid Spencer93bc3cd2006-04-06 22:15:51 +000016
Chris Lattner5720be42006-07-26 19:10:34 +000017# llvm-gcc4 doesn't need runtime libs.
18ifeq ($(LLVMGCC_MAJVERS),4)
19 DIRS := $(filter-out runtime, $(DIRS))
Chris Lattner6a8c2902004-02-03 23:05:24 +000020endif
Chris Lattner22033b22006-06-02 22:41:18 +000021
Chris Lattner5720be42006-07-26 19:10:34 +000022ifeq ($(MAKECMDGOALS),libs-only)
23 DIRS := $(filter-out tools runtime docs, $(DIRS))
Chris Lattner22033b22006-06-02 22:41:18 +000024 OPTIONAL_DIRS :=
25endif
26
Chris Lattner5720be42006-07-26 19:10:34 +000027ifeq ($(MAKECMDGOALS),tools-only)
28 DIRS := $(filter-out runtime docs, $(DIRS))
29 OPTIONAL_DIRS :=
30endif
Chris Lattner22033b22006-06-02 22:41:18 +000031
Chris Lattner5720be42006-07-26 19:10:34 +000032# Don't install utils, examples, or projects they are only used to
33# build LLVM.
34ifeq ($(MAKECMDGOALS),install)
35 DIRS := $(filter-out utils, $(DIRS))
36 OPTIONAL_DIRS :=
37endif
Reid Spencer90c29492004-10-26 07:05:09 +000038
Chris Lattner22033b22006-06-02 22:41:18 +000039# Include the main makefile machinery.
Reid Spencer06a801a2006-04-08 02:14:37 +000040include $(LLVM_SRC_ROOT)/Makefile.rules
41
Reid Spencer45eeed92005-05-24 02:33:20 +000042# Specify options to pass to configure script when we're
43# running the dist-check target
44DIST_CHECK_CONFIG_OPTIONS = --with-llvmgccdir=$(LLVMGCCDIR)
45
Reid Spencerdf561f42004-11-25 09:08:54 +000046.PHONY: debug-opt-prof
47debug-opt-prof:
48 $(Echo) Building Debug Version
49 $(Verb) $(MAKE)
50 $(Echo)
51 $(Echo) Building Optimized Version
52 $(Echo)
53 $(Verb) $(MAKE) ENABLE_OPTIMIZED=1
54 $(Echo)
55 $(Echo) Building Profiling Version
56 $(Echo)
57 $(Verb) $(MAKE) ENABLE_PROFILING=1
58
Reid Spencer151f8ba2004-10-25 08:27:37 +000059dist-hook::
Reid Spencercc2d1e22004-10-30 09:19:36 +000060 $(Echo) Eliminating files constructed by configure
61 $(Verb) $(RM) -f \
Reid Spencer90c29492004-10-26 07:05:09 +000062 $(TopDistDir)/include/llvm/ADT/hash_map \
63 $(TopDistDir)/include/llvm/ADT/hash_set \
64 $(TopDistDir)/include/llvm/ADT/iterator \
65 $(TopDistDir)/include/llvm/Config/config.h \
66 $(TopDistDir)/include/llvm/Support/DataTypes.h \
67 $(TopDistDir)/include/llvm/Support/ThreadSupport.h
Reid Spencer151f8ba2004-10-25 08:27:37 +000068
Chris Lattner9cf662b2004-02-03 22:56:40 +000069tools-only: all
Reid Spencer8b1f7672005-05-25 21:03:17 +000070libs-only: all
Reid Spencerca739c62005-08-25 04:59:49 +000071
72#------------------------------------------------------------------------
73# Make sure the generated headers are up-to-date. This must be kept in
74# sync with the AC_CONFIG_HEADER invocations in autoconf/configure.ac
75#------------------------------------------------------------------------
76FilesToConfig := \
77 include/llvm/Config/config.h \
78 include/llvm/Support/DataTypes.h \
79 include/llvm/ADT/hash_map \
80 include/llvm/ADT/hash_set \
81 include/llvm/ADT/iterator
82FilesToConfigPATH := $(addprefix $(LLVM_OBJ_ROOT)/,$(FilesToConfig))
83
84all-local:: $(FilesToConfigPATH)
85$(FilesToConfigPATH) : $(LLVM_OBJ_ROOT)/% : $(LLVM_SRC_ROOT)/%.in
86 $(Echo) Regenerating $*
87 $(Verb) cd $(LLVM_OBJ_ROOT) && $(ConfigStatusScript) $*
88.PRECIOUS: $(FilesToConfigPATH)
Reid Spencere22f3c02006-04-07 15:58:18 +000089
Chris Lattner38ab6d82006-04-07 16:21:59 +000090# NOTE: This needs to remain as the last target definition in this file so
91# that it gets executed last.
Reid Spencere22f3c02006-04-07 15:58:18 +000092all::
93 $(Echo) '*****' Completed $(BuildMode)$(AssertMode) Build
94ifeq ($(BuildMode),Debug)
95 $(Echo) '*****' Note: Debug build can be 10 times slower than an
96 $(Echo) '*****' optimized build. Use 'make ENABLE_OPTIMIZED=1' to
97 $(Echo) '*****' make an optimized build.
98endif
Chris Lattner38ab6d82006-04-07 16:21:59 +000099
Reid Spencer5b30ee12006-06-01 07:27:53 +0000100check-llvm2cpp:
101 $(MAKE) check TESTSUITE=Feature RUNLLVM2CPP=1
Chris Lattner5720be42006-07-26 19:10:34 +0000102
Reid Spencerf7c75a62006-08-16 00:43:50 +0000103srpm: $(LLVM_OBJ_ROOT)/llvm.spec
104 rpmbuild -bs $(LLVM_OBJ_ROOT)/llvm.spec
105
106rpm: $(LLVM_OBJ_ROOT)/llvm.spec
107 rpmbuild -bb --target $(TARGET_TRIPLE) $(LLVM_OBJ_ROOT)/llvm.spec
108
109.PHONY: srpm rpm