blob: 4b68b97a1eb87feeeb5efccb33a0d62dbade259b [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 Lattner00950542001-06-06 20:29:01 +000010LEVEL = .
Reid Spencerdd1aac32006-05-17 22:55:35 +000011DIRS = lib/System lib/Support utils lib/VMCore lib
Chris Lattner00950542001-06-06 20:29:01 +000012
Reid Spencer06a801a2006-04-08 02:14:37 +000013include $(LEVEL)/Makefile.config
Reid Spencer93bc3cd2006-04-06 22:15:51 +000014
Chris Lattner22033b22006-06-02 22:41:18 +000015
Reid Spencer8b1f7672005-05-25 21:03:17 +000016ifeq ($(MAKECMDGOALS),tools-only)
Reid Spencer93bc3cd2006-04-06 22:15:51 +000017 DIRS += tools
Reid Spencer8b1f7672005-05-25 21:03:17 +000018else
19 ifneq ($(MAKECMDGOALS),libs-only)
Reid Spencer93bc3cd2006-04-06 22:15:51 +000020 DIRS += tools
Reid Spencer30ea2fa2006-04-07 21:45:23 +000021 ifneq ($(LLVMGCC_MAJVERS),4)
Reid Spencer93bc3cd2006-04-06 22:15:51 +000022 DIRS += runtime
23 else
24 $(warning Skipping runtime libraries, llvm-gcc 4 detected.)
25 endif
Chris Lattner936cd542006-06-02 22:34:39 +000026
Reid Spencer93bc3cd2006-04-06 22:15:51 +000027 DIRS += docs
Reid Spencer8b1f7672005-05-25 21:03:17 +000028 endif
Chris Lattner6a8c2902004-02-03 23:05:24 +000029endif
Chris Lattner22033b22006-06-02 22:41:18 +000030
31# Don't install utils, they are only used to build LLVM.
32#
33ifeq ($(MAKECMDGOALS),install)
34 DIRS := $(filter-out utils, $(DIRS))
35
36 # Don't install examples or projects.
37 OPTIONAL_DIRS :=
38endif
39
40
Reid Spencer0c82def2006-04-12 20:53:14 +000041EXTRA_DIST := test llvm.spec include win32 Xcode
Reid Spencer90c29492004-10-26 07:05:09 +000042
Chris Lattner22033b22006-06-02 22:41:18 +000043# Include the main makefile machinery.
Reid Spencer06a801a2006-04-08 02:14:37 +000044include $(LLVM_SRC_ROOT)/Makefile.rules
45
Reid Spencer45eeed92005-05-24 02:33:20 +000046# Specify options to pass to configure script when we're
47# running the dist-check target
48DIST_CHECK_CONFIG_OPTIONS = --with-llvmgccdir=$(LLVMGCCDIR)
49
Reid Spencerdf561f42004-11-25 09:08:54 +000050.PHONY: debug-opt-prof
51debug-opt-prof:
52 $(Echo) Building Debug Version
53 $(Verb) $(MAKE)
54 $(Echo)
55 $(Echo) Building Optimized Version
56 $(Echo)
57 $(Verb) $(MAKE) ENABLE_OPTIMIZED=1
58 $(Echo)
59 $(Echo) Building Profiling Version
60 $(Echo)
61 $(Verb) $(MAKE) ENABLE_PROFILING=1
62
Reid Spencer151f8ba2004-10-25 08:27:37 +000063dist-hook::
Reid Spencercc2d1e22004-10-30 09:19:36 +000064 $(Echo) Eliminating files constructed by configure
65 $(Verb) $(RM) -f \
Reid Spencer90c29492004-10-26 07:05:09 +000066 $(TopDistDir)/include/llvm/ADT/hash_map \
67 $(TopDistDir)/include/llvm/ADT/hash_set \
68 $(TopDistDir)/include/llvm/ADT/iterator \
69 $(TopDistDir)/include/llvm/Config/config.h \
70 $(TopDistDir)/include/llvm/Support/DataTypes.h \
71 $(TopDistDir)/include/llvm/Support/ThreadSupport.h
Reid Spencer151f8ba2004-10-25 08:27:37 +000072
Chris Lattner9cf662b2004-02-03 22:56:40 +000073tools-only: all
Reid Spencer8b1f7672005-05-25 21:03:17 +000074libs-only: all
Reid Spencerca739c62005-08-25 04:59:49 +000075
76#------------------------------------------------------------------------
77# Make sure the generated headers are up-to-date. This must be kept in
78# sync with the AC_CONFIG_HEADER invocations in autoconf/configure.ac
79#------------------------------------------------------------------------
80FilesToConfig := \
81 include/llvm/Config/config.h \
82 include/llvm/Support/DataTypes.h \
83 include/llvm/ADT/hash_map \
84 include/llvm/ADT/hash_set \
85 include/llvm/ADT/iterator
86FilesToConfigPATH := $(addprefix $(LLVM_OBJ_ROOT)/,$(FilesToConfig))
87
88all-local:: $(FilesToConfigPATH)
89$(FilesToConfigPATH) : $(LLVM_OBJ_ROOT)/% : $(LLVM_SRC_ROOT)/%.in
90 $(Echo) Regenerating $*
91 $(Verb) cd $(LLVM_OBJ_ROOT) && $(ConfigStatusScript) $*
92.PRECIOUS: $(FilesToConfigPATH)
Reid Spencere22f3c02006-04-07 15:58:18 +000093
Chris Lattner38ab6d82006-04-07 16:21:59 +000094# NOTE: This needs to remain as the last target definition in this file so
95# that it gets executed last.
Reid Spencere22f3c02006-04-07 15:58:18 +000096all::
97 $(Echo) '*****' Completed $(BuildMode)$(AssertMode) Build
98ifeq ($(BuildMode),Debug)
99 $(Echo) '*****' Note: Debug build can be 10 times slower than an
100 $(Echo) '*****' optimized build. Use 'make ENABLE_OPTIMIZED=1' to
101 $(Echo) '*****' make an optimized build.
102endif
Chris Lattner38ab6d82006-04-07 16:21:59 +0000103
Reid Spencer5b30ee12006-06-01 07:27:53 +0000104check-llvm2cpp:
105 $(MAKE) check TESTSUITE=Feature RUNLLVM2CPP=1