blob: d917e58811f60b15602de377ef6adc7608731aee [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 Lattner00950542001-06-06 20:29:01 +00009LEVEL = .
Reid Spencerdd1aac32006-05-17 22:55:35 +000010DIRS = lib/System lib/Support utils lib/VMCore lib
Chris Lattner00950542001-06-06 20:29:01 +000011
Reid Spencer06a801a2006-04-08 02:14:37 +000012include $(LEVEL)/Makefile.config
Reid Spencer93bc3cd2006-04-06 22:15:51 +000013
Reid Spencer8b1f7672005-05-25 21:03:17 +000014ifeq ($(MAKECMDGOALS),tools-only)
Reid Spencer93bc3cd2006-04-06 22:15:51 +000015 DIRS += tools
Reid Spencer8b1f7672005-05-25 21:03:17 +000016else
17 ifneq ($(MAKECMDGOALS),libs-only)
Reid Spencer93bc3cd2006-04-06 22:15:51 +000018 DIRS += tools
Reid Spencer30ea2fa2006-04-07 21:45:23 +000019 ifneq ($(LLVMGCC_MAJVERS),4)
Reid Spencer93bc3cd2006-04-06 22:15:51 +000020 DIRS += runtime
21 else
22 $(warning Skipping runtime libraries, llvm-gcc 4 detected.)
23 endif
Reid Spencer06a801a2006-04-08 02:14:37 +000024 OPTIONAL_DIRS := examples projects
Reid Spencer93bc3cd2006-04-06 22:15:51 +000025 DIRS += docs
Reid Spencer8b1f7672005-05-25 21:03:17 +000026 endif
Chris Lattner6a8c2902004-02-03 23:05:24 +000027endif
Reid Spencer0c82def2006-04-12 20:53:14 +000028EXTRA_DIST := test llvm.spec include win32 Xcode
Reid Spencer90c29492004-10-26 07:05:09 +000029
Reid Spencer06a801a2006-04-08 02:14:37 +000030include $(LLVM_SRC_ROOT)/Makefile.rules
31
Reid Spencer45eeed92005-05-24 02:33:20 +000032# Specify options to pass to configure script when we're
33# running the dist-check target
34DIST_CHECK_CONFIG_OPTIONS = --with-llvmgccdir=$(LLVMGCCDIR)
35
Reid Spencerdf561f42004-11-25 09:08:54 +000036.PHONY: debug-opt-prof
37debug-opt-prof:
38 $(Echo) Building Debug Version
39 $(Verb) $(MAKE)
40 $(Echo)
41 $(Echo) Building Optimized Version
42 $(Echo)
43 $(Verb) $(MAKE) ENABLE_OPTIMIZED=1
44 $(Echo)
45 $(Echo) Building Profiling Version
46 $(Echo)
47 $(Verb) $(MAKE) ENABLE_PROFILING=1
48
Reid Spencer151f8ba2004-10-25 08:27:37 +000049dist-hook::
Reid Spencercc2d1e22004-10-30 09:19:36 +000050 $(Echo) Eliminating files constructed by configure
51 $(Verb) $(RM) -f \
Reid Spencer90c29492004-10-26 07:05:09 +000052 $(TopDistDir)/include/llvm/ADT/hash_map \
53 $(TopDistDir)/include/llvm/ADT/hash_set \
54 $(TopDistDir)/include/llvm/ADT/iterator \
55 $(TopDistDir)/include/llvm/Config/config.h \
56 $(TopDistDir)/include/llvm/Support/DataTypes.h \
57 $(TopDistDir)/include/llvm/Support/ThreadSupport.h
Reid Spencer151f8ba2004-10-25 08:27:37 +000058
Chris Lattner9cf662b2004-02-03 22:56:40 +000059tools-only: all
Reid Spencer8b1f7672005-05-25 21:03:17 +000060libs-only: all
Reid Spencerca739c62005-08-25 04:59:49 +000061
62#------------------------------------------------------------------------
63# Make sure the generated headers are up-to-date. This must be kept in
64# sync with the AC_CONFIG_HEADER invocations in autoconf/configure.ac
65#------------------------------------------------------------------------
66FilesToConfig := \
67 include/llvm/Config/config.h \
68 include/llvm/Support/DataTypes.h \
69 include/llvm/ADT/hash_map \
70 include/llvm/ADT/hash_set \
71 include/llvm/ADT/iterator
72FilesToConfigPATH := $(addprefix $(LLVM_OBJ_ROOT)/,$(FilesToConfig))
73
74all-local:: $(FilesToConfigPATH)
75$(FilesToConfigPATH) : $(LLVM_OBJ_ROOT)/% : $(LLVM_SRC_ROOT)/%.in
76 $(Echo) Regenerating $*
77 $(Verb) cd $(LLVM_OBJ_ROOT) && $(ConfigStatusScript) $*
78.PRECIOUS: $(FilesToConfigPATH)
Reid Spencere22f3c02006-04-07 15:58:18 +000079
Chris Lattner38ab6d82006-04-07 16:21:59 +000080# NOTE: This needs to remain as the last target definition in this file so
81# that it gets executed last.
Reid Spencere22f3c02006-04-07 15:58:18 +000082all::
83 $(Echo) '*****' Completed $(BuildMode)$(AssertMode) Build
84ifeq ($(BuildMode),Debug)
85 $(Echo) '*****' Note: Debug build can be 10 times slower than an
86 $(Echo) '*****' optimized build. Use 'make ENABLE_OPTIMIZED=1' to
87 $(Echo) '*****' make an optimized build.
88endif
Chris Lattner38ab6d82006-04-07 16:21:59 +000089
Reid Spencer5b30ee12006-06-01 07:27:53 +000090check-llvm2cpp:
91 $(MAKE) check TESTSUITE=Feature RUNLLVM2CPP=1