blob: a56fca48b106c3b5e85e4ffb1b6bd5fe73cd4ee8 [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 Spencer8b1f7672005-05-25 21:03:17 +000010DIRS = lib/System lib/Support utils lib
Chris Lattner00950542001-06-06 20:29:01 +000011
Reid Spencer93bc3cd2006-04-06 22:15:51 +000012include $(LEVEL)/Makefile.common
13
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
19 ifeq ($(LLVMGCC_MAJVERS),3)
20 DIRS += runtime
21 else
22 $(warning Skipping runtime libraries, llvm-gcc 4 detected.)
23 endif
24 DIRS += docs
Reid Spencer8b1f7672005-05-25 21:03:17 +000025 endif
Reid Spencer93bc3cd2006-04-06 22:15:51 +000026 OPTIONAL_DIRS = examples projects
Chris Lattner6a8c2902004-02-03 23:05:24 +000027endif
Reid Spencer90c29492004-10-26 07:05:09 +000028EXTRA_DIST := test llvm.spec include
29
Reid Spencer45eeed92005-05-24 02:33:20 +000030# Specify options to pass to configure script when we're
31# running the dist-check target
32DIST_CHECK_CONFIG_OPTIONS = --with-llvmgccdir=$(LLVMGCCDIR)
33
Reid Spencerdf561f42004-11-25 09:08:54 +000034.PHONY: debug-opt-prof
35debug-opt-prof:
36 $(Echo) Building Debug Version
37 $(Verb) $(MAKE)
38 $(Echo)
39 $(Echo) Building Optimized Version
40 $(Echo)
41 $(Verb) $(MAKE) ENABLE_OPTIMIZED=1
42 $(Echo)
43 $(Echo) Building Profiling Version
44 $(Echo)
45 $(Verb) $(MAKE) ENABLE_PROFILING=1
46
Reid Spencer151f8ba2004-10-25 08:27:37 +000047dist-hook::
Reid Spencercc2d1e22004-10-30 09:19:36 +000048 $(Echo) Eliminating files constructed by configure
49 $(Verb) $(RM) -f \
Reid Spencer90c29492004-10-26 07:05:09 +000050 $(TopDistDir)/include/llvm/ADT/hash_map \
51 $(TopDistDir)/include/llvm/ADT/hash_set \
52 $(TopDistDir)/include/llvm/ADT/iterator \
53 $(TopDistDir)/include/llvm/Config/config.h \
54 $(TopDistDir)/include/llvm/Support/DataTypes.h \
55 $(TopDistDir)/include/llvm/Support/ThreadSupport.h
Reid Spencer151f8ba2004-10-25 08:27:37 +000056
Chris Lattner9cf662b2004-02-03 22:56:40 +000057tools-only: all
Reid Spencer8b1f7672005-05-25 21:03:17 +000058libs-only: all
Reid Spencerca739c62005-08-25 04:59:49 +000059
60#------------------------------------------------------------------------
61# Make sure the generated headers are up-to-date. This must be kept in
62# sync with the AC_CONFIG_HEADER invocations in autoconf/configure.ac
63#------------------------------------------------------------------------
64FilesToConfig := \
65 include/llvm/Config/config.h \
66 include/llvm/Support/DataTypes.h \
67 include/llvm/ADT/hash_map \
68 include/llvm/ADT/hash_set \
69 include/llvm/ADT/iterator
70FilesToConfigPATH := $(addprefix $(LLVM_OBJ_ROOT)/,$(FilesToConfig))
71
72all-local:: $(FilesToConfigPATH)
73$(FilesToConfigPATH) : $(LLVM_OBJ_ROOT)/% : $(LLVM_SRC_ROOT)/%.in
74 $(Echo) Regenerating $*
75 $(Verb) cd $(LLVM_OBJ_ROOT) && $(ConfigStatusScript) $*
76.PRECIOUS: $(FilesToConfigPATH)