blob: da98cc042fa785bdc7e07429e6dc6cb5e971ab6c [file] [log] [blame]
Misha Brukman7426c892004-04-24 00:10:56 +00001#===-- Makefile.rules - Common make rules for LLVM ---------*- Makefile -*--===#
2#
John Criswell23e43fb2003-10-21 14:33:46 +00003# 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 +00009#
Reid Spencer81cd0492004-10-23 20:04:14 +000010# This file is included by all of the LLVM makefiles. For details on how to use
11# it properly, please see the document MakefileGuide.html in the docs directory.
Chris Lattner2e9fc94a2003-08-15 03:02:52 +000012#
Vikram S. Adve24132e82002-07-09 12:04:21 +000013#===-----------------------------------------------------------------------====
Chris Lattner2f7c9632001-06-06 20:29:01 +000014
Reid Spencerf88808a2004-10-30 09:19:36 +000015################################################################################
Reid Spencer81cd0492004-10-23 20:04:14 +000016# TARGETS: Define standard targets that can be invoked
Reid Spencerf88808a2004-10-30 09:19:36 +000017################################################################################
John Criswell3ef61af2003-06-30 21:59:07 +000018
Chris Lattner2f7c9632001-06-06 20:29:01 +000019#--------------------------------------------------------------------
Reid Spencer81cd0492004-10-23 20:04:14 +000020# Define the various target sets
21#--------------------------------------------------------------------
Reid Spencer9d0c1e02004-11-02 16:36:03 +000022RecursiveTargets := all clean clean-all check install uninstall
23LocalTargets := all-local clean-local clean-all-local check-local \
24 install-local printvars uninstall-local
Reid Spencerf88808a2004-10-30 09:19:36 +000025TopLevelTargets := dist dist-check dist-clean tags dist-gzip dist-bzip2 \
26 dist-zip
27UserTargets := $(RecursiveTargets) $(LocalTargets) $(TopLevelTargets)
28InternalTargets := preconditions distdir dist-hook
Reid Spencer81cd0492004-10-23 20:04:14 +000029
Reid Spencerf88808a2004-10-30 09:19:36 +000030################################################################################
Reid Spencer77a46d22004-10-26 22:26:33 +000031# INITIALIZATION: Basic things the makefile needs
Reid Spencerf88808a2004-10-30 09:19:36 +000032################################################################################
33
34#--------------------------------------------------------------------
35# Set the VPATH so that we can find source files.
36#--------------------------------------------------------------------
37VPATH=$(BUILD_SRC_DIR)
Reid Spencer77a46d22004-10-26 22:26:33 +000038
39#--------------------------------------------------------------------
40# Reset the list of suffixes we know how to build
41#--------------------------------------------------------------------
42.SUFFIXES:
Reid Spencerf88808a2004-10-30 09:19:36 +000043.SUFFIXES: .c .cpp .h .hpp .y .l .lo .o .a .bc .td .ps .dot
44.SUFFIXES: $(SHLIBEXT) $(SUFFIXES)
Reid Spencer77a46d22004-10-26 22:26:33 +000045
Reid Spencer81cd0492004-10-23 20:04:14 +000046#--------------------------------------------------------------------
47# Mark all of these targets as phony to avoid implicit rule search
48#--------------------------------------------------------------------
Reid Spencerf88808a2004-10-30 09:19:36 +000049.PHONY: $(UserTargets) $(InternalTargets)
Reid Spencer81cd0492004-10-23 20:04:14 +000050
51#--------------------------------------------------------------------
Reid Spencer77a46d22004-10-26 22:26:33 +000052# Make sure all the user-target rules are double colon rules and
53# they are defined first.
Reid Spencer81cd0492004-10-23 20:04:14 +000054#--------------------------------------------------------------------
55
Reid Spencerf88808a2004-10-30 09:19:36 +000056$(UserTargets)::
Reid Spencer100080c2004-10-25 08:27:37 +000057
Reid Spencer77a46d22004-10-26 22:26:33 +000058################################################################################
59# PRECONDITIONS: that which must be built/checked first
60################################################################################
61
Reid Spencer91234ff2004-11-17 19:08:44 +000062SrcMakefiles := $(filter %Makefile %Makefile.tests %Makefile.JIT,\
63 $(wildcard $(BUILD_SRC_DIR)/Makefile*))
Reid Spencerf88808a2004-10-30 09:19:36 +000064ObjMakefiles := $(subst $(BUILD_SRC_DIR),$(BUILD_OBJ_DIR),$(SrcMakefiles))
65ConfigureScript := $(LLVM_SRC_ROOT)/configure
66ConfigStatusScript := $(LLVM_OBJ_ROOT)/config.status
67MakefileConfigIn := $(LLVM_SRC_ROOT)/Makefile.config.in
68MakefileConfig := $(LLVM_OBJ_ROOT)/Makefile.config
69PreConditions := $(ConfigStatusScript) $(MakefileConfig) $(ObjMakefiles)
Reid Spencer77a46d22004-10-26 22:26:33 +000070
Reid Spencerf88808a2004-10-30 09:19:36 +000071preconditions : $(PreConditions)
Reid Spencer77a46d22004-10-26 22:26:33 +000072
73#------------------------------------------------------------------------
74# Make sure the BUILT_SOURCES are built first
75#------------------------------------------------------------------------
Reid Spencerf88808a2004-10-30 09:19:36 +000076$(filter-out clean clean-local,UserTargets):: $(BUILT_SOURCES)
Reid Spencer77a46d22004-10-26 22:26:33 +000077
78clean-local::
79ifneq ($(strip $(BUILT_SOURCES)),)
Reid Spencer651dd3ad2004-11-02 16:56:15 +000080 -$(Verb) $(RM) -f $(BUILT_SOURCES)
Reid Spencer77a46d22004-10-26 22:26:33 +000081endif
82
Reid Spencerf88808a2004-10-30 09:19:36 +000083$(BUILT_SOURCES) : $(ObjMakefiles)
Reid Spencerb7f710a2004-10-28 00:41:43 +000084
Reid Spencer77a46d22004-10-26 22:26:33 +000085#------------------------------------------------------------------------
86# Make sure we're not using a stale configuration
87#------------------------------------------------------------------------
Reid Spencerf88808a2004-10-30 09:19:36 +000088.PRECIOUS: $(ConfigStatusScript)
89$(ConfigStatusScript): $(ConfigureScript)
90 $(Echo) Reconfiguring with $<
Reid Spencer50f34872004-11-29 12:37:44 +000091 $(Verb) cd $(BUILD_OBJ_ROOT) && \
92 $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
93 $(ConfigStatusScript)
Reid Spencer77a46d22004-10-26 22:26:33 +000094
95#------------------------------------------------------------------------
96# Make sure the configuration makefile is up to date
97#------------------------------------------------------------------------
Reid Spencerf88808a2004-10-30 09:19:36 +000098$(MakefileConfig): $(MakefileConfigIn) $(ConfigStatusScript)
99 $(Echo) Regenerating $@
100 $(Verb) cd $(LLVM_OBJ_ROOT) ; $(ConfigStatusScript) Makefile.config
Reid Spencer77a46d22004-10-26 22:26:33 +0000101
102#------------------------------------------------------------------------
103# If the Makefile in the source tree has been updated, copy it over into the
104# build tree. But, only do this if the source and object makefiles differ
105#------------------------------------------------------------------------
106ifneq ($(BUILD_OBJ_DIR),$(BUILD_SRC_DIR))
107
Reid Spencer91234ff2004-11-17 19:08:44 +0000108Makefile: $(BUILD_SRC_DIR)/Makefile
Reid Spencerf88808a2004-10-30 09:19:36 +0000109 $(Echo) "Updating Makefile"
110 $(Verb) $(MKDIR) $(@D)
111 $(Verb) cp -f $< $@
Reid Spencer77a46d22004-10-26 22:26:33 +0000112
113# Copy the Makefile.* files unless we're in the root directory which avoids
114# the copying of Makefile.config.in or other things that should be explicitly
115# taken care of.
Reid Spencer77a46d22004-10-26 22:26:33 +0000116$(BUILD_OBJ_DIR)/Makefile% : $(BUILD_SRC_DIR)/Makefile%
Reid Spencerd94bb332004-10-26 23:10:00 +0000117 @case '$?' in \
118 *Makefile.rules) ;; \
119 *.in) ;; \
Reid Spencerf88808a2004-10-30 09:19:36 +0000120 *) $(Echo) "Updating $(@F)" ; \
Reid Spencerd94bb332004-10-26 23:10:00 +0000121 $(MKDIR) $(@D) ; \
122 cp -f $< $@ ;; \
123 esac
124
Reid Spencer77a46d22004-10-26 22:26:33 +0000125endif
126
127#------------------------------------------------------------------------
128# Set up the basic dependencies
129#------------------------------------------------------------------------
Reid Spencerf88808a2004-10-30 09:19:36 +0000130$(UserTargets):: $(PreConditions)
Reid Spencer77a46d22004-10-26 22:26:33 +0000131
132all:: all-local
Reid Spencer81cd0492004-10-23 20:04:14 +0000133check:: check-local
134clean:: clean-local
Reid Spencer9d0c1e02004-11-02 16:36:03 +0000135clean-all:: clean-local clean-all-local
Reid Spencer77a46d22004-10-26 22:26:33 +0000136install:: install-local
137uninstall:: uninstall-local
138check-local:: all-local
139install-local:: all-local
Reid Spencer81cd0492004-10-23 20:04:14 +0000140
141###############################################################################
142# VARIABLES: Set up various variables based on configuration data
143###############################################################################
144
145#--------------------------------------------------------------------
146# Variables derived from configuration we are building
Chris Lattner2f7c9632001-06-06 20:29:01 +0000147#--------------------------------------------------------------------
148
Chris Lattnerc2bd7cf2003-03-14 20:25:22 +0000149ifdef ENABLE_PROFILING
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000150 BuildMode := Profile
Reid Spencerf88808a2004-10-30 09:19:36 +0000151 CXX.Flags := -O3 -DNDEBUG -felide-constructors -finline-functions -pg
152 C.Flags := -O3 -DNDEBUG -pg
153 LD.Flags := -O3 -DNDEBUG -pg
Chris Lattnerc2bd7cf2003-03-14 20:25:22 +0000154else
155 ifdef ENABLE_OPTIMIZED
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000156 BuildMode := Release
Reid Spencerf88808a2004-10-30 09:19:36 +0000157 CXX.Flags := -O3 -DNDEBUG -finline-functions -felide-constructors -fomit-frame-pointer
158 C.Flags := -O3 -DNDEBUG -fomit-frame-pointer
159 LD.Flags := -O3 -DNDEBUG
Chris Lattnerc2bd7cf2003-03-14 20:25:22 +0000160 else
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000161 BuildMode := Debug
Reid Spencerf88808a2004-10-30 09:19:36 +0000162 CXX.Flags := -g -D_DEBUG
163 C.Flags := -g -D_DEBUG
164 LD.Flags := -g -D_DEBUG
Reid Spencerf206bd72004-10-22 21:01:56 +0000165 KEEP_SYMBOLS := 1
Chris Lattnerc2bd7cf2003-03-14 20:25:22 +0000166 endif
167endif
168
Reid Spencerf88808a2004-10-30 09:19:36 +0000169CXX.Flags += $(CXXFLAGS)
170C.Flags += $(CFLAGS)
171CPP.Flags += $(CPPFLAGS)
172LD.Flags += $(LDFLAGS)
173AR.Flags := cru
174LibTool.Flags := --tag=CXX
Reid Spencer81cd0492004-10-23 20:04:14 +0000175
176#--------------------------------------------------------------------
Reid Spencerf206bd72004-10-22 21:01:56 +0000177# Directory locations
Reid Spencer81cd0492004-10-23 20:04:14 +0000178#--------------------------------------------------------------------
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000179ObjDir := $(BUILD_OBJ_DIR)/$(BuildMode)
Reid Spencer7e9e0b02004-11-18 10:03:46 +0000180LibDir := $(BUILD_OBJ_ROOT)/$(BuildMode)/lib
Reid Spencer0dbf1012004-11-18 20:04:39 +0000181ToolDir := $(BUILD_OBJ_ROOT)/$(BuildMode)/bin
Reid Spencer7e9e0b02004-11-18 10:03:46 +0000182ExmplDir := $(BUILD_OBJ_ROOT)/$(BuildMode)/examples
183LLVMLibDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/lib
Reid Spencer0dbf1012004-11-18 20:04:39 +0000184LLVMToolDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/bin
Reid Spencer7e9e0b02004-11-18 10:03:46 +0000185LExmplDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/examples
John Criswell3ef61af2003-06-30 21:59:07 +0000186
Reid Spencer81cd0492004-10-23 20:04:14 +0000187#--------------------------------------------------------------------
Reid Spencerf206bd72004-10-22 21:01:56 +0000188# Full Paths To Compiled Tools and Utilities
Reid Spencer81cd0492004-10-23 20:04:14 +0000189#--------------------------------------------------------------------
Reid Spencerf88808a2004-10-30 09:19:36 +0000190EchoCmd := $(ECHO) llvm[$(MAKELEVEL)]:
191Echo := @$(EchoCmd)
192ifndef LIBTOOL
Reid Spencerf206bd72004-10-22 21:01:56 +0000193LIBTOOL := $(LLVM_OBJ_ROOT)/mklib
Reid Spencerf88808a2004-10-30 09:19:36 +0000194endif
195ifndef LLVMAS
196LLVMAS := $(LLVMToolDir)/llvm-as$(EXEEXT)
197endif
198ifndef BURG
199BURG := $(LLVMToolDir)/burg$(EXEEXT)
200endif
201ifndef TBLGEN
202TBLGEN := $(LLVMToolDir)/tblgen$(EXEEXT)
203endif
Chris Lattner0ea40c92004-11-29 19:47:58 +0000204ifndef GCCAS
205GCCAS := $(LLVMToolDir)/gccas$(EXEEXT)
206endif
Reid Spencerf88808a2004-10-30 09:19:36 +0000207ifndef GCCLD
208GCCLD := $(LLVMToolDir)/gccld$(EXEEXT)
209endif
210ifndef LLVMGCC
211LLVMGCC := PATH=$(LLVMToolDir):$(PATH) $(LLVMGCCDIR)/bin/gcc
212endif
213ifndef LLVMGXX
214LLVMGXX := PATH=$(LLVMToolDir):$(PATH) $(LLVMGCCDIR)/bin/g++
215endif
Dinakar Dhurjati41f77482003-05-29 16:18:20 +0000216
Reid Spencerf206bd72004-10-22 21:01:56 +0000217# Need a better way to compute this.
Reid Spencerf88808a2004-10-30 09:19:36 +0000218LLVMGCCLibDir := $(dir $(shell $(LLVMGCC) -print-file-name=libgcc.a))/
Dinakar Dhurjati41f77482003-05-29 16:18:20 +0000219
Reid Spencer81cd0492004-10-23 20:04:14 +0000220#--------------------------------------------------------------------
Reid Spencerf206bd72004-10-22 21:01:56 +0000221# Adjust to user's request
Reid Spencer81cd0492004-10-23 20:04:14 +0000222#--------------------------------------------------------------------
Dinakar Dhurjati41f77482003-05-29 16:18:20 +0000223
Reid Spencerf88808a2004-10-30 09:19:36 +0000224# Adjust LIBTOOL flags for shared libraries, or not.
John Criswell3601f372003-07-31 20:58:51 +0000225ifndef SHARED_LIBRARY
Reid Spencerf88808a2004-10-30 09:19:36 +0000226 LibTool.Flags += --tag=disable-shared
Reid Spencerf206bd72004-10-22 21:01:56 +0000227else
Reid Spencerf88808a2004-10-30 09:19:36 +0000228 LD.Flags += -rpath $(LibDir)
John Criswell3601f372003-07-31 20:58:51 +0000229endif
230
Reid Spencerf8b4a8e2004-11-08 17:32:12 +0000231ifdef TOOL_VERBOSE
232 C.Flags += -v
233 CXX.Flags += -v
234 LD.Flags += -v
Reid Spencerf8b4a8e2004-11-08 17:32:12 +0000235 VERBOSE := 1
Reid Spencer32f7e422004-12-02 09:28:21 +0000236else
Reid Spencerf8b4a8e2004-11-08 17:32:12 +0000237endif
238
Reid Spencer81cd0492004-10-23 20:04:14 +0000239# Adjust settings for verbose mode
Chris Lattnerc2bd7cf2003-03-14 20:25:22 +0000240ifndef VERBOSE
Reid Spencerf88808a2004-10-30 09:19:36 +0000241 Verb := @
242 LibTool.Flags += --silent
243 AR.Flags += >/dev/null 2>/dev/null
244 ConfigureScriptFLAGS += >$(BUILD_OBJ_DIR)/configure.out 2>&1
Reid Spencer100080c2004-10-25 08:27:37 +0000245else
Reid Spencerf88808a2004-10-30 09:19:36 +0000246 ConfigureScriptFLAGS :=
Misha Brukman1326a7c2002-09-12 16:05:39 +0000247endif
248
Vikram S. Adved141c282002-09-18 11:55:13 +0000249# By default, strip symbol information from executable
Chris Lattnerc2bd7cf2003-03-14 20:25:22 +0000250ifndef KEEP_SYMBOLS
Reid Spencerf88808a2004-10-30 09:19:36 +0000251 Strip := $(PLATFORMSTRIPOPTS)
252 StripWarnMsg := "(without symbols)"
Vikram S. Adved141c282002-09-18 11:55:13 +0000253endif
254
Reid Spencer81cd0492004-10-23 20:04:14 +0000255# Adjust linker flags for building an executable
Reid Spencerf206bd72004-10-22 21:01:56 +0000256ifdef TOOLNAME
Reid Spencer7e9e0b02004-11-18 10:03:46 +0000257ifdef EXAMPLE_TOOL
258 LD.Flags += -rpath $(ExmplDir) -export-dynamic
259else
Reid Spencerf88808a2004-10-30 09:19:36 +0000260 LD.Flags += -rpath $(ToolDir) -export-dynamic
Dinakar Dhurjati3ac83a92003-10-29 14:28:35 +0000261endif
Reid Spencer7e9e0b02004-11-18 10:03:46 +0000262endif
Dinakar Dhurjati3ac83a92003-10-29 14:28:35 +0000263
Reid Spencer81cd0492004-10-23 20:04:14 +0000264#----------------------------------------------------------
Reid Spencerf206bd72004-10-22 21:01:56 +0000265# Options To Invoke Tools
Reid Spencer81cd0492004-10-23 20:04:14 +0000266#----------------------------------------------------------
Reid Spencerf206bd72004-10-22 21:01:56 +0000267
268CompileCommonOpts := -Wall -W -Wwrite-strings -Wno-unused
269
Reid Spencerf88808a2004-10-30 09:19:36 +0000270LD.Flags += -L$(LibDir) -L$(LLVMLibDir)
271CPP.Flags += -I$(BUILD_OBJ_DIR) \
Reid Spencer100080c2004-10-25 08:27:37 +0000272 -I$(BUILD_SRC_DIR) \
273 -I$(BUILD_SRC_ROOT)/include \
274 -I$(BUILD_OBJ_ROOT)/include \
275 -I$(LLVM_OBJ_ROOT)/include \
276 -I$(LLVM_SRC_ROOT)/include \
277 -D_GNU_SOURCE -D__STDC_LIMIT_MACROS
Reid Spencerf206bd72004-10-22 21:01:56 +0000278
Reid Spencerf88808a2004-10-30 09:19:36 +0000279Compile.C = $(CC) $(CPP.Flags) $(CompileCommonOpts) -c $(C.Flags)
280LTCompile.C = $(LIBTOOL) $(LibTool.Flags) --mode=compile $(Compile.C)
281BCCompile.C = $(LLVMGCC) $(CPP.Flags) $(CompileCommonOpts) $(C.Flags) -c
282Compile.CXX = $(CXX) $(CPP.Flags) $(CompileCommonOpts) $(CXX.Flags) -c
283LTCompile.CXX = $(LIBTOOL) $(LibTool.Flags) --mode=compile $(Compile.CXX)
284BCCompile.CXX = $(LLVMGXX) $(CPP.Flags) $(CompileCommonOpts) $(CXX.Flags) -c
285Link = $(LIBTOOL) $(LibTool.Flags) --mode=link $(CXX) $(CPP.Flags) \
286 $(CompileCommonOpts) $(LD.Flags) $(Strip)
287Relink = $(LIBTOOL) $(LibTool.Flags) --mode=link $(CXX) $(CPP.Flags) \
Reid Spencer9c7bfc92004-10-28 09:15:28 +0000288 $(CompileCommonOpts)
Reid Spencerf88808a2004-10-30 09:19:36 +0000289LTInstall = $(LIBTOOL) $(LibTool.Flags) --mode=install $(INSTALL)
Reid Spencer81cd0492004-10-23 20:04:14 +0000290Burg = $(BURG) -I $(BUILD_SRC_DIR)
291TableGen = $(TBLGEN) -I $(BUILD_SRC_DIR)
Reid Spencerf88808a2004-10-30 09:19:36 +0000292Archive = $(AR) $(AR.Flags)
Reid Spencer32f7e422004-12-02 09:28:21 +0000293LArchive = $(LLVMToolDir)/llvm-ar rcsf
Reid Spencerf206bd72004-10-22 21:01:56 +0000294ifdef RANLIB
Reid Spencer81cd0492004-10-23 20:04:14 +0000295Ranlib = $(RANLIB)
Reid Spencerf206bd72004-10-22 21:01:56 +0000296else
Reid Spencer81cd0492004-10-23 20:04:14 +0000297Ranlib = ranlib
John Criswell3ef61af2003-06-30 21:59:07 +0000298endif
299
Chris Lattner2f7c9632001-06-06 20:29:01 +0000300#----------------------------------------------------------
Reid Spencer81cd0492004-10-23 20:04:14 +0000301# Get the list of source files
302#----------------------------------------------------------
303ifndef SOURCES
Reid Spencerf88808a2004-10-30 09:19:36 +0000304 Sources := $(notdir $(wildcard $(BUILD_SRC_DIR)/*.cpp \
305 $(BUILD_SRC_DIR)/*.cc $(BUILD_SRC_DIR)/*.c $(BUILD_SRC_DIR)/*.y \
306 $(BUILD_SRC_DIR)/*.l))
307else
308 Sources := $(SOURCES)
Reid Spencerf206bd72004-10-22 21:01:56 +0000309endif
310
311ifdef BUILT_SOURCES
Reid Spencerf88808a2004-10-30 09:19:36 +0000312Sources += $(filter %.cpp %.c %.cc %.y %.l,$(BUILT_SOURCES))
Vikram S. Adve53738842002-10-14 16:40:04 +0000313endif
Vikram S. Advefe346892001-07-15 13:16:47 +0000314
Reid Spencer81cd0492004-10-23 20:04:14 +0000315#----------------------------------------------------------
316# Types of objects that can be built from sources
317#----------------------------------------------------------
Reid Spencerf88808a2004-10-30 09:19:36 +0000318BaseNameSources := $(sort $(basename $(Sources)))
319ObjectsO := $(BaseNameSources:%=$(ObjDir)/%.o)
320ObjectsLO := $(BaseNameSources:%=$(ObjDir)/%.lo)
321ObjectsBC := $(BaseNameSources:%=$(ObjDir)/%.bc)
Reid Spencer81cd0492004-10-23 20:04:14 +0000322
323###############################################################################
324# DIRECTORIES: Handle recursive descent of directory structure
325###############################################################################
John Criswell3601f372003-07-31 20:58:51 +0000326
Chris Lattner2f7c9632001-06-06 20:29:01 +0000327#---------------------------------------------------------
Reid Spencer9c7bfc92004-10-28 09:15:28 +0000328# Provide rules to make install dirs. This must be early
329# in the file so they get built before dependencies
330#---------------------------------------------------------
331
332$(bindir):
Reid Spencerf88808a2004-10-30 09:19:36 +0000333 $(Verb) $(MKDIR) $(bindir)
Chris Lattner615e7fb2004-11-01 06:14:59 +0000334
Reid Spencer9c7bfc92004-10-28 09:15:28 +0000335$(libdir):
Reid Spencerf88808a2004-10-30 09:19:36 +0000336 $(Verb) $(MKDIR) $(libdir)
Reid Spencer9c7bfc92004-10-28 09:15:28 +0000337
338$(bytecode_libdir):
Reid Spencerf88808a2004-10-30 09:19:36 +0000339 $(Verb) $(MKDIR) $(bytecode_libdir)
Reid Spencer9c7bfc92004-10-28 09:15:28 +0000340
341$(sysconfdir):
Reid Spencerf88808a2004-10-30 09:19:36 +0000342 $(Verb) $(MKDIR) $(sysconfdir)
Reid Spencer9c7bfc92004-10-28 09:15:28 +0000343
Reid Spencerf88808a2004-10-30 09:19:36 +0000344# To create other directories, as needed, and timestamp their creation
345%/.dir:
346 $(Verb) $(MKDIR) $* > /dev/null
Reid Spencerfc66af42004-11-29 05:00:33 +0000347 $(Verb) $(DATE) > $@
Reid Spencerf88808a2004-10-30 09:19:36 +0000348
Reid Spencer7e9e0b02004-11-18 10:03:46 +0000349.PRECIOUS: $(ObjDir)/.dir $(LibDir)/.dir $(ToolDir)/.dir $(ExmplDir)/.dir
350.PRECIOUS: $(LLVMLibDir)/.dir $(LLVMToolDir)/.dir $(LLVMExmplDir)/.dir
Reid Spencer9c7bfc92004-10-28 09:15:28 +0000351
352#---------------------------------------------------------
Reid Spencer81cd0492004-10-23 20:04:14 +0000353# Handle the DIRS options for sequential construction
Chris Lattner2f7c9632001-06-06 20:29:01 +0000354#---------------------------------------------------------
355
Reid Spencerf88808a2004-10-30 09:19:36 +0000356SubDirs :=
Anand Shukla8c2a0ee2002-09-18 04:29:30 +0000357ifdef DIRS
Reid Spencerf88808a2004-10-30 09:19:36 +0000358SubDirs += $(DIRS)
359$(RecursiveTargets)::
360 $(Verb) for dir in $(DIRS); do \
Reid Spencerf206bd72004-10-22 21:01:56 +0000361 if [ ! -f $$dir/Makefile ]; then \
362 $(MKDIR) $$dir; \
363 cp $(BUILD_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
364 fi; \
Reid Spencer100080c2004-10-25 08:27:37 +0000365 ($(MAKE) -C $$dir $@ ) || exit 1; \
Chris Lattner539a23c2002-09-17 23:35:02 +0000366 done
Anand Shukla8c2a0ee2002-09-18 04:29:30 +0000367endif
Chris Lattnerf3dd5f52002-09-18 03:22:27 +0000368
Reid Spencer81cd0492004-10-23 20:04:14 +0000369#---------------------------------------------------------
370# Handle the EXPERIMENTAL_DIRS options ensuring success
371# after each directory is built.
372#---------------------------------------------------------
373ifdef EXPERIMENTAL_DIRS
Reid Spencerf88808a2004-10-30 09:19:36 +0000374$(RecursiveTargets)::
375 $(Verb) for dir in $(EXPERIMENTAL_DIRS); do \
Reid Spencer81cd0492004-10-23 20:04:14 +0000376 if [ ! -f $$dir/Makefile ]; then \
377 $(MKDIR) $$dir; \
378 cp $(BUILD_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
379 fi; \
Reid Spencer100080c2004-10-25 08:27:37 +0000380 ($(MAKE) -C $$dir $@ ) || exit 0; \
Reid Spencer81cd0492004-10-23 20:04:14 +0000381 done
382endif
Chris Lattnerf3dd5f52002-09-18 03:22:27 +0000383
Reid Spencer81cd0492004-10-23 20:04:14 +0000384#---------------------------------------------------------
385# Handle the PARALLEL_DIRS options for parallel construction
386#---------------------------------------------------------
387ifdef PARALLEL_DIRS
388
Reid Spencerf88808a2004-10-30 09:19:36 +0000389SubDirs += $(PARALLEL_DIRS)
390
Reid Spencer81cd0492004-10-23 20:04:14 +0000391# Unfortunately, this list must be maintained if new
392# recursive targets are added.
Reid Spencerf88808a2004-10-30 09:19:36 +0000393all :: $(addsuffix /.makeall ,$(PARALLEL_DIRS))
394clean :: $(addsuffix /.makeclean ,$(PARALLEL_DIRS))
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000395clean-all:: $(addsuffix /.makeclean-all,$(PARALLEL_DIRS))
Reid Spencerf88808a2004-10-30 09:19:36 +0000396check :: $(addsuffix /.makecheck ,$(PARALLEL_DIRS))
397install :: $(addsuffix /.makeinstall ,$(PARALLEL_DIRS))
Reid Spencer81cd0492004-10-23 20:04:14 +0000398uninstall:: $(addsuffix /.makeuninstall,$(PARALLEL_DIRS))
399
Reid Spencerf88808a2004-10-30 09:19:36 +0000400Parallel_Targets := $(foreach T,$(RecursiveTargets),%/.make$(T))
Reid Spencer81cd0492004-10-23 20:04:14 +0000401
402$(Parallel_Targets) :
Reid Spencerf88808a2004-10-30 09:19:36 +0000403 $(Verb) if [ ! -f $(@D)/Makefile ]; then \
Reid Spencerf206bd72004-10-22 21:01:56 +0000404 $(MKDIR) $(@D); \
405 cp $(BUILD_SRC_DIR)/$(@D)/Makefile $(@D)/Makefile; \
John Criswell6df35dd2003-11-25 19:32:22 +0000406 fi; \
Reid Spencer100080c2004-10-25 08:27:37 +0000407 $(MAKE) -C $(@D) $(subst $(@D)/.make,,$@)
Chris Lattner2f7c9632001-06-06 20:29:01 +0000408endif
409
Reid Spencer81cd0492004-10-23 20:04:14 +0000410#---------------------------------------------------------
411# Handle the OPTIONAL_DIRS options for directores that may
412# or may not exist.
413#---------------------------------------------------------
John Criswell8224df92003-06-27 16:58:44 +0000414ifdef OPTIONAL_DIRS
Reid Spencer100080c2004-10-25 08:27:37 +0000415
Reid Spencerf88808a2004-10-30 09:19:36 +0000416SubDirs += $(OPTIONAL_DIRS)
Reid Spencer100080c2004-10-25 08:27:37 +0000417
Reid Spencerf88808a2004-10-30 09:19:36 +0000418$(RecursiveTargets)::
419 $(Verb) for dir in $(OPTIONAL_DIRS); do \
Reid Spencerf206bd72004-10-22 21:01:56 +0000420 if [ -d $(BUILD_SRC_DIR)/$$dir ]; then\
421 if [ ! -f $$dir/Makefile ]; then \
422 $(MKDIR) $$dir; \
423 cp $(BUILD_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
424 fi; \
Reid Spencer100080c2004-10-25 08:27:37 +0000425 ($(MAKE) -C$$dir $@ ) || exit 1; \
Reid Spencerf206bd72004-10-22 21:01:56 +0000426 fi \
John Criswell8224df92003-06-27 16:58:44 +0000427 done
428endif
429
Reid Spencercc51e7b2004-08-20 09:20:05 +0000430#---------------------------------------------------------
431# Handle the CONFIG_FILES options
432#---------------------------------------------------------
433ifdef CONFIG_FILES
Reid Spencercc51e7b2004-08-20 09:20:05 +0000434
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000435install-local:: $(sysconfdir) $(CONFIG_FILES)
Reid Spencerf88808a2004-10-30 09:19:36 +0000436 $(Echo) Installing Configuration Files To $(sysconfdir)
437 $(Verb)for file in $(CONFIG_FILES); do \
Reid Spencer39d6a612004-11-23 05:59:53 +0000438 if test -f $(BUILD_OBJ_DIR)/$${file} ; then \
439 $(INSTALL) $(BUILD_OBJ_DIR)/$${file} $(sysconfdir) ; \
440 elif test -f $(BUILD_SRC_DIR)/$${file} ; then \
441 $(INSTALL) $(BUILD_SRC_DIR)/$${file} $(sysconfdir) ; \
442 else \
443 $(ECHO) Error: cannot find config file $${file}. ; \
444 fi \
Reid Spencercc51e7b2004-08-20 09:20:05 +0000445 done
Reid Spencer81cd0492004-10-23 20:04:14 +0000446
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000447uninstall-local::
Reid Spencerf88808a2004-10-30 09:19:36 +0000448 $(Echo) Uninstalling Configuration Files From $(sysconfdir)
449 $(Verb)for file in $(CONFIG_FILES); do \
Reid Spencer100080c2004-10-25 08:27:37 +0000450 $(RM) -f $(sysconfdir)/$${file} ; \
Reid Spencer12a3a052004-10-24 07:53:21 +0000451 done
452
Reid Spencercc51e7b2004-08-20 09:20:05 +0000453endif
454
Reid Spencer81cd0492004-10-23 20:04:14 +0000455###############################################################################
456# Library Build Rules: Four ways to build a library
457###############################################################################
Chris Lattner2f7c9632001-06-06 20:29:01 +0000458
Brian Gaekeecc92bf2004-01-22 22:53:48 +0000459
Reid Spencer81cd0492004-10-23 20:04:14 +0000460# if we're building a library ...
Chris Lattner2f7c9632001-06-06 20:29:01 +0000461ifdef LIBRARYNAME
Vikram S. Advefe346892001-07-15 13:16:47 +0000462
Chris Lattner0100eab2002-09-16 22:36:42 +0000463# Make sure there isn't any extranous whitespace on the LIBRARYNAME option
Chris Lattnere6e193ca2002-09-16 22:34:56 +0000464LIBRARYNAME := $(strip $(LIBRARYNAME))
Reid Spencerf88808a2004-10-30 09:19:36 +0000465LibName.LA := $(LibDir)/lib$(LIBRARYNAME).la
466LibName.A := $(LibDir)/lib$(LIBRARYNAME).a
467LibName.O := $(LibDir)/$(LIBRARYNAME).o
Reid Spencer32f7e422004-12-02 09:28:21 +0000468LibName.BCA:= $(LibDir)/lib$(LIBRARYNAME).bca
Chris Lattnere6e193ca2002-09-16 22:34:56 +0000469
Reid Spencer81cd0492004-10-23 20:04:14 +0000470#---------------------------------------------------------
471# Shared Library Targets:
472# If the user asked for a shared library to be built
473# with the SHARED_LIBRARY variable, then we provide
474# targets for building them.
475#---------------------------------------------------------
Reid Spencerf206bd72004-10-22 21:01:56 +0000476ifdef SHARED_LIBRARY
477
Reid Spencerf88808a2004-10-30 09:19:36 +0000478all-local:: $(LibName.LA)
Reid Spencerf206bd72004-10-22 21:01:56 +0000479
Reid Spencerf88808a2004-10-30 09:19:36 +0000480$(LibName.LA): $(BUILT_SOURCES) $(ObjectsLO) $(LibDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000481 $(Echo) Linking $(BuildMode) Shared Library $(LIBRARYNAME)$(SHLIBEXT)
Reid Spencerf88808a2004-10-30 09:19:36 +0000482 $(Verb) $(Link) -o $@ $(ObjectsLO)
483 $(Verb) $(LTInstall) $@ $(LibDir)
Reid Spencer81cd0492004-10-23 20:04:14 +0000484
485clean-local::
Reid Spencerf88808a2004-10-30 09:19:36 +0000486ifneq ($(strip $(LibName.LA)),)
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000487 -$(Verb) $(RM) -f $(LibName.LA)
Reid Spencer12a3a052004-10-24 07:53:21 +0000488endif
Reid Spencerf206bd72004-10-22 21:01:56 +0000489
Reid Spencer12a3a052004-10-24 07:53:21 +0000490DestSharedLib = $(libdir)/lib$(LIBRARYNAME)$(SHLIBEXT)
Reid Spencerf206bd72004-10-22 21:01:56 +0000491
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000492install-local:: $(DestSharedLib)
Reid Spencer12a3a052004-10-24 07:53:21 +0000493
Reid Spencerf88808a2004-10-30 09:19:36 +0000494$(DestSharedLib): $(libdir) $(LibName.LA)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000495 $(Echo) Installing $(BuildMode) Shared Library $(DestSharedLib)
Reid Spencerf88808a2004-10-30 09:19:36 +0000496 $(Verb) $(LTInstall) $(LibName.LA) $(DestSharedLib)
497 $(Verb) $(LIBTOOL) --finish $(libdir)
Reid Spencer12a3a052004-10-24 07:53:21 +0000498
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000499uninstall-local::
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000500 $(Echo) Uninstalling $(BuildMode) Shared Library $(DestSharedLib)
Reid Spenceraee67e62004-11-12 02:27:36 +0000501 -$(Verb) $(RM) -f $(libdir)/lib$(LIBRARYNAME).*
Reid Spencer12a3a052004-10-24 07:53:21 +0000502
Reid Spencerf206bd72004-10-22 21:01:56 +0000503endif
504
Reid Spencer81cd0492004-10-23 20:04:14 +0000505#---------------------------------------------------------
506# Bytecode Library Targets:
507# If the user asked for a bytecode library to be built
508# with the BYTECODE_LIBRARY variable, then we provide
509# targets for building them.
510#---------------------------------------------------------
Reid Spencerf206bd72004-10-22 21:01:56 +0000511ifdef BYTECODE_LIBRARY
512
Reid Spencer2b1b83a2004-12-03 06:04:35 +0000513# make the C and C++ compilers strip debug info out of bytecode libraries.
514BCCompile.C += -Wa,-strip-debug
515BCCompile.CXX += -Wa,-strip-debug
516
Reid Spencer32f7e422004-12-02 09:28:21 +0000517all-local:: $(LibName.BCA)
518
519ifdef EXPORTED_SYMBOL_FILE
520BCLinkLib = $(LLVMGCC) -shared -nostdlib -Xlinker \
521 -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
522
523$(LibName.BCA): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(GCCLD)
524 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@) \
525 "(internalize)"
Chris Lattnere3d98f12004-12-02 21:23:43 +0000526 $(Verb) $(BCLinkLib) -o $(ObjDir)/$(LIBRARYNAME).o $(ObjectsBC)
Reid Spencer32f7e422004-12-02 09:28:21 +0000527 $(Verb) $(LArchive) $@ $(ObjDir)/$(LIBRARYNAME).o
Reid Spencerf206bd72004-10-22 21:01:56 +0000528else
Reid Spencer32f7e422004-12-02 09:28:21 +0000529$(LibName.BCA): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(GCCLD)
530 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@)
531 $(Verb) $(LArchive) $@ $(ObjectsBC)
532
Reid Spencerf206bd72004-10-22 21:01:56 +0000533endif
534
Reid Spencer81cd0492004-10-23 20:04:14 +0000535clean-local::
Reid Spencer32f7e422004-12-02 09:28:21 +0000536ifneq ($(strip $(LibName.BCA)),)
537 -$(Verb) $(RM) -f $(LibName.BCA)
Reid Spencer12a3a052004-10-24 07:53:21 +0000538endif
Reid Spencerf206bd72004-10-22 21:01:56 +0000539
Reid Spencer32f7e422004-12-02 09:28:21 +0000540DestBytecodeLib = $(bytecode_libdir)/lib$(LIBRARYNAME).a
541
542install-bytecode: $(DestBytecodeLib)
Reid Spencer8da1b5d2004-10-26 07:09:33 +0000543
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000544install-local:: $(DestBytecodeLib)
Chris Lattner0c4f4fe2003-08-15 02:18:35 +0000545
Reid Spencer32f7e422004-12-02 09:28:21 +0000546$(DestBytecodeLib): $(bytecode_libdir) $(LibName.BCA)
547 $(Echo) Installing $(BuildMode) Bytecode Archive $(DestBytecodeLib)
548 $(Verb) $(INSTALL) $(LibName.BCA) $@
Reid Spencer12a3a052004-10-24 07:53:21 +0000549
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000550uninstall-local::
Reid Spencer32f7e422004-12-02 09:28:21 +0000551 $(Echo) Uninstalling $(BuildMode) Bytecode Archive $(DestBytecodeLib)
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000552 -$(Verb) $(RM) -f $(DestBytecodeLib)
Reid Spencerf206bd72004-10-22 21:01:56 +0000553
554endif
Vikram S. Adve15bd3ad2002-08-02 18:34:12 +0000555
Reid Spencerf88808a2004-10-30 09:19:36 +0000556#---------------------------------------------------------
557# ReLinked Library Targets:
558# If the user didn't explicitly forbid building a
559# relinked then we provide targets for building them.
560#---------------------------------------------------------
Chris Lattner76d98ba2002-07-23 17:56:16 +0000561ifndef DONT_BUILD_RELINKED
Reid Spencerf206bd72004-10-22 21:01:56 +0000562
Reid Spencerf88808a2004-10-30 09:19:36 +0000563all-local:: $(LibName.O)
564
565$(LibName.O): $(BUILT_SOURCES) $(ObjectsO) $(LibDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000566 $(Echo) Linking $(BuildMode) Object Library $(notdir $@)
Reid Spencerf88808a2004-10-30 09:19:36 +0000567 $(Verb) $(Relink) -o $@ $(ObjectsO)
Reid Spencerf206bd72004-10-22 21:01:56 +0000568
Reid Spencer81cd0492004-10-23 20:04:14 +0000569clean-local::
Reid Spencerf88808a2004-10-30 09:19:36 +0000570ifneq ($(strip $(LibName.O)),)
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000571 -$(Verb) $(RM) -f $(LibName.O)
Reid Spencer12a3a052004-10-24 07:53:21 +0000572endif
573
574DestRelinkedLib = $(libdir)/$(LIBRARYNAME).o
575
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000576install-local:: $(DestRelinkedLib)
Reid Spencer12a3a052004-10-24 07:53:21 +0000577
Reid Spencerf88808a2004-10-30 09:19:36 +0000578$(DestRelinkedLib): $(libdir) $(LibName.O)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000579 $(Echo) Installing $(BuildMode) Object Library $(DestRelinkedLib)
Reid Spencerf88808a2004-10-30 09:19:36 +0000580 $(Verb) $(LTInstall) $(LibName.O) $(DestRelinkedLib)
Reid Spencer12a3a052004-10-24 07:53:21 +0000581
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000582uninstall-local::
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000583 $(Echo) Uninstalling $(BuildMode) Object Library $(DestRelinkedLib)
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000584 -$(Verb) $(RM) -f $(DestRelinkedLib)
Reid Spencerf206bd72004-10-22 21:01:56 +0000585
Chris Lattner76d98ba2002-07-23 17:56:16 +0000586endif
Chris Lattnerc2bd7cf2003-03-14 20:25:22 +0000587
Reid Spencerf88808a2004-10-30 09:19:36 +0000588#---------------------------------------------------------
589# Archive Library Targets:
590# If the user wanted a regular archive library built,
591# then we provide targets for building them.
592#---------------------------------------------------------
Chris Lattner76d98ba2002-07-23 17:56:16 +0000593ifdef BUILD_ARCHIVE
Chris Lattner76d98ba2002-07-23 17:56:16 +0000594
Reid Spencerf88808a2004-10-30 09:19:36 +0000595all-local:: $(LibName.A)
596
597$(LibName.A): $(BUILT_SOURCES) $(ObjectsO) $(LibDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000598 $(Echo) Building $(BuildMode) Archive Library $(notdir $@)
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000599 -$(Verb) $(RM) -f $@
Reid Spencerf88808a2004-10-30 09:19:36 +0000600 $(Verb) $(Archive) $@ $(ObjectsO)
601 $(Verb) $(Ranlib) $@
Vikram S. Adve20aa62f2002-09-20 14:03:13 +0000602
Reid Spencer81cd0492004-10-23 20:04:14 +0000603clean-local::
Reid Spencerf88808a2004-10-30 09:19:36 +0000604ifneq ($(strip $(LibName.A)),)
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000605 -$(Verb) $(RM) -f $(LibName.A)
Chris Lattner2f7c9632001-06-06 20:29:01 +0000606endif
607
Reid Spencer12a3a052004-10-24 07:53:21 +0000608DestArchiveLib := $(libdir)/lib$(LIBRARYNAME).a
609
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000610install-local:: $(DestArchiveLib)
Reid Spencer12a3a052004-10-24 07:53:21 +0000611
Reid Spencerf88808a2004-10-30 09:19:36 +0000612$(DestArchiveLib): $(libdir) $(LibName.A)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000613 $(Echo) Installing $(BuildMode) Archive Library $(DestArchiveLib)
Reid Spencerf88808a2004-10-30 09:19:36 +0000614 $(Verb) $(MKDIR) $(libdir)
615 $(Verb) $(LTInstall) $(LibName.A) $(DestArchiveLib)
Reid Spencer12a3a052004-10-24 07:53:21 +0000616
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000617uninstall-local::
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000618 $(Echo) Uninstalling $(BuildMode) Archive Library $(DestArchiveLib)
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000619 -$(Verb) $(RM) -f $(DestArchiveLib)
Reid Spencer12a3a052004-10-24 07:53:21 +0000620
621endif
622
623# endif LIBRARYNAME
Reid Spencerf206bd72004-10-22 21:01:56 +0000624endif
625
Reid Spencerdcba7782004-10-24 08:21:04 +0000626###############################################################################
627# Tool Build Rules: Build executable tool based on TOOLNAME option
628###############################################################################
629
Chris Lattner07c7c192001-09-07 22:57:58 +0000630ifdef TOOLNAME
631
Reid Spencerf88808a2004-10-30 09:19:36 +0000632#---------------------------------------------------------
Reid Spenceraf4495a2004-11-29 07:17:07 +0000633# Handle the special "JIT" value for LLVM_LIBS which is a
634# shorthand for a bunch of libraries that get the correct
635# JIT support for a tool that runs JIT.
636#---------------------------------------------------------
637ifeq ($(LLVMLIBS),JIT)
638
639# Make sure we can get our own symbols in the tool
640Link += -dlopen self
641
642# Generic JIT libraries
643JIT_LIBS := LLVMInterpreter LLVMJIT LLVMCodeGen LLVMExecutionEngine
644
645# You can enable the X86 JIT on a non-X86 host by setting the flag
646# ENABLE_X86_JIT on the make command line. If not, it will still be
647# enabled automagically on an X86 host.
648ifeq ($(ARCH), x86)
649 ENABLE_X86_JIT = 1
650endif
651
652# What the X86 JIT requires
653ifdef ENABLE_X86_JIT
654 JIT_LIBS += LLVMX86 LLVMSelectionDAG
655endif
656
657# You can enable the SparcV9 JIT on a non-SparcV9 host by setting the flag
658# ENABLE_SPARCV9_JIT on the make command line. If not, it will still be
659# enabled automagically on an SparcV9 host.
660ifeq ($(ARCH), Sparc)
661 ENABLE_SPARCV9_JIT = 1
662endif
663
664# What the Sparc JIT requires
665ifdef ENABLE_SPARCV9_JIT
666 JIT_LIBS += LLVMSparcV9 LLVMSparcV9ModuloSched LLVMSparcV9InstrSched \
667 LLVMSparcV9LiveVar LLVMInstrumentation.a LLVMProfilePaths \
668 LLVMBCWriter LLVMTransforms.a LLVMipo.a LLVMipa.a \
669 LLVMDataStructure.a LLVMSparcV9RegAlloc
670endif
671
672# You can enable the PowerPC JIT on a non-PowerPC host by setting the flag
673# ENABLE_PPC_JIT on the make command line. If not, it will still be
674# enabled automagically on an PowerPC host.
675ifeq ($(ARCH), PowerPC)
676 ENABLE_PPC_JIT = 1
677endif
678
679# What the PowerPC JIT requires
680ifdef ENABLE_PPC_JIT
681 JIT_LIBS += LLVMPowerPC
682endif
683
684LLVMLIBS := $(JIT_LIBS) LLVMScalarOpts LLVMAnalysis.a LLVMTransformUtils.a \
685 LLVMBCReader LLVMCore LLVMSupport.a LLVMTarget.a LLVMbzip2 \
686 LLVMSystem.a $(PLATFORMLIBDL)
687endif
688
689#---------------------------------------------------------
Reid Spencerf88808a2004-10-30 09:19:36 +0000690# Set up variables for building a tool.
691#---------------------------------------------------------
Reid Spencer7e9e0b02004-11-18 10:03:46 +0000692ifdef EXAMPLE_TOOL
693ToolBuildPath := $(ExmplDir)/$(TOOLNAME)$(EXEEXT)
694else
Reid Spencerf88808a2004-10-30 09:19:36 +0000695ToolBuildPath := $(ToolDir)/$(TOOLNAME)$(EXEEXT)
Reid Spencer7e9e0b02004-11-18 10:03:46 +0000696endif
Reid Spencerf88808a2004-10-30 09:19:36 +0000697ProjLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS)))
698ProjLibsOptions := $(patsubst %.o, $(LibDir)/%.o, $(ProjLibsOptions))
699LLVMLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(LLVMLIBS)))
700LLVMLibsOptions := $(patsubst %.o, $(LLVMLibDir)/%.o, $(LLVMLibsOptions))
701ProjUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(USEDLIBS)))
702LLVMUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(LLVMLIBS)))
703ProjLibsPaths := $(addprefix $(LibDir)/,$(ProjUsedLibs))
704LLVMLibsPaths := $(addprefix $(LLVMLibDir)/,$(LLVMUsedLibs))
Chris Lattner07c7c192001-09-07 22:57:58 +0000705
Reid Spencerf88808a2004-10-30 09:19:36 +0000706#---------------------------------------------------------
Reid Spencerf88808a2004-10-30 09:19:36 +0000707# Tell make that we need to rebuild subdirectories before
708# we can link the tool. This affects things like LLI which
709# has library subdirectories.
710#---------------------------------------------------------
711$(ToolBuildPath): $(addsuffix /.makeall, $(PARALLEL_DIRS))
Chris Lattner3ecb7762003-01-22 16:13:31 +0000712
Reid Spencerf88808a2004-10-30 09:19:36 +0000713#---------------------------------------------------------
714# Provide targets for building the tools
715#---------------------------------------------------------
716all-local:: $(ToolBuildPath)
John Criswell8224df92003-06-27 16:58:44 +0000717
Reid Spencer81cd0492004-10-23 20:04:14 +0000718clean-local::
Reid Spencerf88808a2004-10-30 09:19:36 +0000719ifneq ($(strip $(ToolBuildPath)),)
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000720 -$(Verb) $(RM) -f $(ToolBuildPath)
Reid Spencer12a3a052004-10-24 07:53:21 +0000721endif
Chris Lattner07c7c192001-09-07 22:57:58 +0000722
Reid Spencer7e9e0b02004-11-18 10:03:46 +0000723ifdef EXAMPLE_TOOL
724$(ToolBuildPath): $(ExmplDir)/.dir
725else
726$(ToolBuildPath): $(ToolDir)/.dir
727endif
728
729$(ToolBuildPath): $(BUILT_SOURCES) $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000730 $(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg)
Reid Spencerf88808a2004-10-30 09:19:36 +0000731 $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
732 $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000733 $(Echo) ======= Finished Linking $(BuildMode) Executable $(TOOLNAME) $(StripWarnMsg)
Reid Spencer12a3a052004-10-24 07:53:21 +0000734
735DestTool = $(bindir)/$(TOOLNAME)
736
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000737install-local:: $(DestTool)
Reid Spencer8da1b5d2004-10-26 07:09:33 +0000738
Reid Spencerf88808a2004-10-30 09:19:36 +0000739$(DestTool): $(bindir) $(ToolBuildPath)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000740 $(Echo) Installing $(BuildMode) $(DestTool)
Reid Spencerf88808a2004-10-30 09:19:36 +0000741 $(Verb) $(INSTALL) $(ToolBuildPath) $(DestTool)
Reid Spencer12a3a052004-10-24 07:53:21 +0000742
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000743uninstall-local::
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000744 $(Echo) Uninstalling $(BuildMode) $(DestTool)
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000745 -$(Verb) $(RM) -f $(DestTool)
Reid Spencer12a3a052004-10-24 07:53:21 +0000746
Reid Spencerf206bd72004-10-22 21:01:56 +0000747endif
Chris Lattner07c7c192001-09-07 22:57:58 +0000748
Reid Spencerf88808a2004-10-30 09:19:36 +0000749###############################################################################
750# Object Build Rules: Build object files based on sources
751###############################################################################
752
753# Provide rule sets for when dependency generation is enabled
Reid Spencerf206bd72004-10-22 21:01:56 +0000754ifndef DISABLE_AUTO_DEPENDENCIES
Vikram S. Adve20aa62f2002-09-20 14:03:13 +0000755
Reid Spencerf88808a2004-10-30 09:19:36 +0000756#---------------------------------------------------------
757# Create .lo files in the ObjDir directory from the .cpp and .c files...
758#---------------------------------------------------------
Reid Spencer81cd0492004-10-23 20:04:14 +0000759ifdef SHARED_LIBRARY
760
Reid Spencerf88808a2004-10-30 09:19:36 +0000761$(ObjDir)/%.lo $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000762 $(Echo) "Compiling $*.cpp for $(BuildMode) build (PIC)"
Reid Spencerf88808a2004-10-30 09:19:36 +0000763 $(Verb) if $(LTCompile.CXX) -MD -MT $@ -MP -MF $(ObjDir)/$*.LACXXd $< -o $@ ; \
764 then $(MV) -f "$(ObjDir)/$*.LACXXd" "$(ObjDir)/$*.d"; \
765 else $(RM) -f "$(ObjDir)/$*.LACXXd"; exit 1; fi
Reid Spencer81cd0492004-10-23 20:04:14 +0000766
Reid Spencerf88808a2004-10-30 09:19:36 +0000767$(ObjDir)/%.lo $(ObjDir)/%.o: %.c $(ObjDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000768 $(Echo) "Compiling $*.c for $(BuildMode) build (PIC)"
Reid Spencerf88808a2004-10-30 09:19:36 +0000769 $(Verb) if $(LTCompile.C) -MD -MT $@ -MP -MF $(ObjDir)/$*.LACd $< -o $@ ; \
770 then $(MV) -f "$(ObjDir)/$*.LACd" "$(ObjDir)/$*.d"; \
771 else $(RM) -f "$(ObjDir)/$*.LACd"; exit 1; fi
Reid Spencer81cd0492004-10-23 20:04:14 +0000772
Reid Spencerf88808a2004-10-30 09:19:36 +0000773#---------------------------------------------------------
774# Create .o files in the ObjDir directory from the .cpp and .c files...
775#---------------------------------------------------------
Reid Spencer81cd0492004-10-23 20:04:14 +0000776else
Reid Spencerf206bd72004-10-22 21:01:56 +0000777
Reid Spencerf88808a2004-10-30 09:19:36 +0000778$(ObjDir)/%.o: %.cpp $(ObjDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000779 $(Echo) "Compiling $*.cpp for $(BuildMode) build"
Reid Spencerf88808a2004-10-30 09:19:36 +0000780 $(Verb) if $(Compile.CXX) -MD -MT $@ -MP -MF $(ObjDir)/$*.CXXd $< -o $@ ; \
781 then $(MV) -f "$(ObjDir)/$*.CXXd" "$(ObjDir)/$*.d"; \
782 else $(RM) -f "$(ObjDir)/$*.CXXd"; exit 1; fi
Reid Spencerf206bd72004-10-22 21:01:56 +0000783
Reid Spencerf88808a2004-10-30 09:19:36 +0000784$(ObjDir)/%.o: %.c $(ObjDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000785 $(Echo) "Compiling $*.c for $(BuildMode) build"
Reid Spencerf88808a2004-10-30 09:19:36 +0000786 $(Verb) if $(Compile.C) -MD -MT $@ -MP -MF $(ObjDir)/$*.Cd $< -o $@ ; \
787 then $(MV) -f "$(ObjDir)/$*.Cd" "$(ObjDir)/$*.d"; \
788 else $(RM) -f "$(ObjDir)/$*.Cd"; exit 1; fi
Reid Spencer81cd0492004-10-23 20:04:14 +0000789
790endif
Reid Spencerf206bd72004-10-22 21:01:56 +0000791
Reid Spencerf88808a2004-10-30 09:19:36 +0000792#---------------------------------------------------------
793# Create .bc files in the ObjDir directory from .cpp and .c files...
794#---------------------------------------------------------
Chris Lattner0ea40c92004-11-29 19:47:58 +0000795$(ObjDir)/%.bc: %.cpp $(ObjDir)/.dir $(GCCAS)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000796 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
Reid Spencerf88808a2004-10-30 09:19:36 +0000797 $(Verb) if $(BCCompile.CXX) -MD -MT $@ -MP -MF "$(ObjDir)/$*.BCCXXd" $< -o $@ ; \
798 then $(MV) -f "$(ObjDir)/$*.BCCXXd" "$(ObjDir)/$*.d"; \
799 else $(RM) -f "$(ObjDir)/$*.BCCXXd"; exit 1; fi
Reid Spencerf206bd72004-10-22 21:01:56 +0000800
Chris Lattner0ea40c92004-11-29 19:47:58 +0000801$(ObjDir)/%.bc: %.c $(ObjDir)/.dir $(GCCAS)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000802 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
Reid Spencerf88808a2004-10-30 09:19:36 +0000803 $(Verb) if $(BCCompile.C) -MD -MT $@ -MP -MF "$(ObjDir)/$*.BCCd" $< -o $@ ; \
804 then $(MV) -f "$(ObjDir)/$*.BCCd" "$(ObjDir)/$*.d"; \
805 else $(RM) -f "$(ObjDir)/$*.BCCd"; exit 1; fi
Reid Spencerf206bd72004-10-22 21:01:56 +0000806
Reid Spencerf88808a2004-10-30 09:19:36 +0000807# Provide alternate rule sets if dependencies are disabled
Reid Spencerf206bd72004-10-22 21:01:56 +0000808else
809
Reid Spencer81cd0492004-10-23 20:04:14 +0000810ifdef SHARED_LIBRARY
811
Reid Spencerf88808a2004-10-30 09:19:36 +0000812$(ObjDir)/%.lo $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000813 $(Echo) "Compiling $*.cpp for $(BuildMode) build (PIC)"
Reid Spencer81cd0492004-10-23 20:04:14 +0000814 $(LTCompile.CXX) $< -o $@
815
Reid Spencerf88808a2004-10-30 09:19:36 +0000816$(ObjDir)/%.lo $(ObjDir)/%.o: %.c $(ObjDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000817 $(Echo) "Compiling $*.cpp for $(BuildMode) build (PIC)"
Reid Spencer81cd0492004-10-23 20:04:14 +0000818 $(LTCompile.C) $< -o $@
819
820else
Reid Spencerf206bd72004-10-22 21:01:56 +0000821
Reid Spencerf88808a2004-10-30 09:19:36 +0000822$(ObjDir)/%.o: %.cpp $(ObjDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000823 $(Echo) "Compiling $*.cpp for $(BuildMode) build"
Reid Spencer81cd0492004-10-23 20:04:14 +0000824 $(Compile.CXX) $< -o $@
Reid Spencerf206bd72004-10-22 21:01:56 +0000825
Reid Spencerf88808a2004-10-30 09:19:36 +0000826$(ObjDir)/%.o: %.c $(ObjDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000827 $(Echo) "Compiling $*.cpp for $(BuildMode) build"
Reid Spencer81cd0492004-10-23 20:04:14 +0000828 $(Compile.C) $< -o $@
829endif
Reid Spencerf206bd72004-10-22 21:01:56 +0000830
Chris Lattner0ea40c92004-11-29 19:47:58 +0000831$(ObjDir)/%.bc: %.cpp $(ObjDir)/.dir $(GCCAS)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000832 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
Reid Spencer991f66a2004-10-31 18:52:15 +0000833 $(BCCompile.CXX) $< -o $@
Reid Spencerf206bd72004-10-22 21:01:56 +0000834
Chris Lattner0ea40c92004-11-29 19:47:58 +0000835$(ObjDir)/%.bc: %.c $(ObjDir)/.dir $(GCCAS)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000836 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
Reid Spencer991f66a2004-10-31 18:52:15 +0000837 $(BCCompile.C) $< -o $@
Brian Gaeke0f148bc2003-12-10 00:26:28 +0000838
Chris Lattner07c7c192001-09-07 22:57:58 +0000839endif
840
Reid Spencerf88808a2004-10-30 09:19:36 +0000841#---------------------------------------------------------
842# Provide rule to build .bc files from .ll sources,
843# regardless of dependencies
844#---------------------------------------------------------
845$(ObjDir)/%.bc: %.ll $(ObjDir)/.dir $(LLVMAS)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000846 $(Echo) "Compiling $*.ll for $(BuildMode) build"
Reid Spencerf88808a2004-10-30 09:19:36 +0000847 $(Verb) $(LLVMAS) $< -f -o $@
848
849###############################################################################
850# TABLEGEN: Provide rules for running tblgen to produce *.inc files
851###############################################################################
Chris Lattner0c4f4fe2003-08-15 02:18:35 +0000852
Reid Spencerf206bd72004-10-22 21:01:56 +0000853ifdef TARGET
854
Reid Spencerf88808a2004-10-30 09:19:36 +0000855TDFiles := $(strip $(wildcard $(BUILD_SRC_DIR)/*.td) $(LLVM_SRC_ROOT)/lib/Target/Target.td)
856INCFiles := $(filter %.inc,$(BUILT_SOURCES))
Reid Spencerf206bd72004-10-22 21:01:56 +0000857
Reid Spencerf88808a2004-10-30 09:19:36 +0000858$(INCFiles) : $(TBLGEN) $(TDFiles)
Reid Spencerf206bd72004-10-22 21:01:56 +0000859
Reid Spencer94105c72004-10-27 04:34:35 +0000860%GenRegisterNames.inc : %.td
Reid Spencerf88808a2004-10-30 09:19:36 +0000861 $(Echo) "Building $(<F) register names with tblgen"
862 $(Verb) $(TableGen) -gen-register-enums -o $@ $<
Reid Spencerf206bd72004-10-22 21:01:56 +0000863
Reid Spencer94105c72004-10-27 04:34:35 +0000864%GenRegisterInfo.h.inc : %.td
Reid Spencerf88808a2004-10-30 09:19:36 +0000865 $(Echo) "Building $(<F) register information header with tblgen"
866 $(Verb) $(TableGen) -gen-register-desc-header -o $@ $<
Reid Spencerf206bd72004-10-22 21:01:56 +0000867
868%GenRegisterInfo.inc : %.td
Reid Spencerf88808a2004-10-30 09:19:36 +0000869 $(Echo) "Building $(<F) register info implementation with tblgen"
870 $(Verb) $(TableGen) -gen-register-desc -o $@ $<
Reid Spencerf206bd72004-10-22 21:01:56 +0000871
872%GenInstrNames.inc : %.td
Reid Spencerf88808a2004-10-30 09:19:36 +0000873 $(Echo) "Building $(<F) instruction names with tblgen"
874 $(Verb) $(TableGen) -gen-instr-enums -o $@ $<
Reid Spencerf206bd72004-10-22 21:01:56 +0000875
876%GenInstrInfo.inc : %.td
Reid Spencerf88808a2004-10-30 09:19:36 +0000877 $(Echo) "Building $(<F) instruction information with tblgen"
878 $(Verb) $(TableGen) -gen-instr-desc -o $@ $<
Reid Spencerf206bd72004-10-22 21:01:56 +0000879
880%GenAsmWriter.inc : %.td
Reid Spencerf88808a2004-10-30 09:19:36 +0000881 $(Echo) "Building $(<F) assembly writer with tblgen"
882 $(Verb) $(TableGen) -gen-asm-writer -o $@ $<
Reid Spencerf206bd72004-10-22 21:01:56 +0000883
884%GenATTAsmWriter.inc : %.td
Reid Spencerf88808a2004-10-30 09:19:36 +0000885 $(Echo) "Building $(<F) AT&T assembly writer with tblgen"
886 $(Verb) $(TableGen) -gen-asm-writer -o $@ $<
Reid Spencerf206bd72004-10-22 21:01:56 +0000887
888%GenIntelAsmWriter.inc : %.td
Reid Spencerf88808a2004-10-30 09:19:36 +0000889 $(Echo) "Building $(<F) Intel assembly writer with tblgen"
890 $(Verb) $(TableGen) -gen-asm-writer -asmwriternum=1 -o $@ $<
Reid Spencerf206bd72004-10-22 21:01:56 +0000891
892%GenInstrSelector.inc: %.td
Reid Spencerf88808a2004-10-30 09:19:36 +0000893 $(Echo) "Building $(<F) instruction selector with tblgen"
894 $(Verb) $(TableGen) -gen-instr-selector -o $@ $<
Reid Spencerf206bd72004-10-22 21:01:56 +0000895
896%GenCodeEmitter.inc:: %.td
Reid Spencerf88808a2004-10-30 09:19:36 +0000897 $(Echo) "Building $(<F) code emitter with tblgen"
898 $(Verb) $(TableGen) -gen-emitter -o $@ $<
Reid Spencerf206bd72004-10-22 21:01:56 +0000899
Reid Spencer81cd0492004-10-23 20:04:14 +0000900clean-local::
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000901 -$(Verb) $(RM) -f $(INCFiles)
Reid Spencerf206bd72004-10-22 21:01:56 +0000902
903endif
Chris Lattner0c4f4fe2003-08-15 02:18:35 +0000904
Reid Spencerf88808a2004-10-30 09:19:36 +0000905###############################################################################
906# LEX AND YACC: Provide rules for generating sources with lex and yacc
907###############################################################################
Chris Lattnerdb644dd2003-01-16 22:44:19 +0000908
Reid Spencerf88808a2004-10-30 09:19:36 +0000909#---------------------------------------------------------
910# Provide rules for generating a .cpp source file from
911# (f)lex input sources.
912#---------------------------------------------------------
913
Reid Spencer9d0c1e02004-11-02 16:36:03 +0000914LexFiles := $(filter %.l,$(Sources))
Reid Spencerf88808a2004-10-30 09:19:36 +0000915
Reid Spencer9d0c1e02004-11-02 16:36:03 +0000916ifneq ($(LexFiles),)
917
918LexOutput := $(strip $(patsubst %.l,%.cpp,$(LexFiles)))
Reid Spencerf88808a2004-10-30 09:19:36 +0000919
920.PRECIOUS: $(LexOutput)
921
922# Note the extra sed filtering here, used to cut down on the warnings emited
923# by GCC. The last line is a gross hack to work around flex aparently not
924# being able to resize the buffer on a large token input. Currently, for
925# uninitialized string buffers in LLVM we can generate very long tokens, so
926# this is a hack around it.
Chris Lattner92fc9b02003-08-15 20:00:47 +0000927# FIXME. (f.e. char Buffer[10000] )
Chris Lattner2f7c9632001-06-06 20:29:01 +0000928%.cpp: %.l
Reid Spencerf88808a2004-10-30 09:19:36 +0000929 $(Echo) Flexing $<
930 $(Verb) $(FLEX) -t $< | \
Reid Spencerf206bd72004-10-22 21:01:56 +0000931 $(SED) 's/void yyunput/inline void yyunput/' | \
932 $(SED) 's/void \*yy_flex_realloc/inline void *yy_flex_realloc/' | \
933 $(SED) 's/#define YY_BUF_SIZE 16384/#define YY_BUF_SIZE (16384*64)/' \
Reid Spencerb7f710a2004-10-28 00:41:43 +0000934 > $@
Chris Lattner2f7c9632001-06-06 20:29:01 +0000935
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000936clean-local::
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000937 -$(Verb) $(RM) -f $(LexOutput)
Reid Spencer9d0c1e02004-11-02 16:36:03 +0000938 $(Verb) $(RM) -f $(LexOutput)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000939
Reid Spencerf88808a2004-10-30 09:19:36 +0000940endif
941
942#---------------------------------------------------------
943# Provide rules for generating a .cpp and .h source files
944# from yacc (bison) input sources.
945#---------------------------------------------------------
946
Reid Spencer9d0c1e02004-11-02 16:36:03 +0000947YaccFiles := $(filter %.y,$(Sources))
948ifneq ($(YaccFiles),)
949YaccOutput := $(addprefix $(patsubst %.y,%,$(YaccFiles)),.h .cpp .output)
Reid Spencerf88808a2004-10-30 09:19:36 +0000950
951.PRECIOUS: $(YaccOutput)
952
953# Cancel built-in rules for yacc
954%.c: %.y
955%.cpp: %.y
956%.h: %.y
957
Chris Lattner2f7c9632001-06-06 20:29:01 +0000958# Rule for building the bison parsers...
Chris Lattner2f7c9632001-06-06 20:29:01 +0000959%.cpp %.h : %.y
Reid Spencerf88808a2004-10-30 09:19:36 +0000960 $(Echo) "Bisoning $*.y"
961 $(Verb) $(BISON) -v -d -p $(<F:%Parser.y=%) -o $*.tab.c $<
962 $(Verb) $(MV) -f $*.tab.c $*.cpp
963 $(Verb) $(MV) -f $*.tab.h $*.h
Chris Lattner2f7c9632001-06-06 20:29:01 +0000964
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000965clean-local::
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000966 -$(Verb) $(RM) -f $(YaccOutput)
Reid Spencer9d0c1e02004-11-02 16:36:03 +0000967 $(Verb) $(RM) -f $(YaccOutput)
Reid Spencerf88808a2004-10-30 09:19:36 +0000968endif
Chris Lattner2f7c9632001-06-06 20:29:01 +0000969
Reid Spencerf88808a2004-10-30 09:19:36 +0000970###############################################################################
971# OTHER RULES: Other rules needed
972###############################################################################
Reid Spencerf206bd72004-10-22 21:01:56 +0000973
Chris Lattner23d47392003-01-16 21:06:18 +0000974# To create postscript files from dot files...
John Criswell4ffb8442003-10-02 19:02:02 +0000975ifneq ($(DOT),false)
Chris Lattner23d47392003-01-16 21:06:18 +0000976%.ps: %.dot
Reid Spencerf206bd72004-10-22 21:01:56 +0000977 $(DOT) -Tps < $< > $@
John Criswell3ef61af2003-06-30 21:59:07 +0000978else
979%.ps: %.dot
Reid Spencerf88808a2004-10-30 09:19:36 +0000980 $(Echo) "Cannot build $@: The program dot is not installed"
John Criswell3ef61af2003-06-30 21:59:07 +0000981endif
Chris Lattner23d47392003-01-16 21:06:18 +0000982
John Criswell0a6e6aa2003-09-06 14:44:17 +0000983# This rules ensures that header files that are removed still have a rule for
984# which they can be "generated." This allows make to ignore them and
985# reproduce the dependency lists.
John Criswella8391af2003-09-18 18:37:08 +0000986%.h:: ;
John Criswell0a6e6aa2003-09-06 14:44:17 +0000987
Reid Spencerf88808a2004-10-30 09:19:36 +0000988# Define clean-local to clean the current directory. Note that this uses a
989# very conservative approach ensuring that empty variables do not cause
990# errors or disastrous removal.
Reid Spencer81cd0492004-10-23 20:04:14 +0000991clean-local::
Reid Spencerf88808a2004-10-30 09:19:36 +0000992ifneq ($(strip $(ObjDir)),)
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000993 -$(Verb) $(RM) -rf $(ObjDir)
Reid Spencer12a3a052004-10-24 07:53:21 +0000994endif
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000995 -$(Verb) $(RM) -f core core.[0-9][0-9]* *.o *.d *~ *.flc
Brian Gaeke8625f682004-01-21 19:53:11 +0000996ifneq ($(strip $(SHLIBEXT)),) # Extra paranoia - make real sure SHLIBEXT is set
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000997 -$(Verb) $(RM) -f *$(SHLIBEXT)
Brian Gaeke8625f682004-01-21 19:53:11 +0000998endif
John Criswell3ef61af2003-06-30 21:59:07 +0000999
Reid Spencer9d0c1e02004-11-02 16:36:03 +00001000clean-all-local::
Reid Spencer651dd3ad2004-11-02 16:56:15 +00001001 -$(Verb) $(RM) -rf Debug Release Profile
Reid Spencer9d0c1e02004-11-02 16:36:03 +00001002
Reid Spencerf88808a2004-10-30 09:19:36 +00001003# Build tags database for Emacs/Xemacs:
Reid Spenceraee67e62004-11-12 02:27:36 +00001004tags:: TAGS CTAGS
1005
Reid Spencerf88808a2004-10-30 09:19:36 +00001006TAGS:
Reid Spenceraee67e62004-11-12 02:27:36 +00001007 find $(BUILD_SRC_ROOT)/include $(BUILD_SRC_ROOT)/lib \
1008 $(BUILD_SRC_ROOT)/tools $(BUILD_SRC_ROOT)/examples \
1009 $(BUILD_OBJ_ROOT)/include $(BUILD_OBJ_ROOT)/lib \
1010 $(BUILD_OBJ_ROOT)/tools $(BUILD_OBJ_ROOT)/examples \
1011 -name '*.cpp' -o -name '*.h' | \
Reid Spencerf88808a2004-10-30 09:19:36 +00001012 $(ETAGS) $(ETAGSFLAGS) -
1013
Reid Spenceraee67e62004-11-12 02:27:36 +00001014CTAGS:
1015 find $(BUILD_SRC_ROOT)/include $(BUILD_SRC_ROOT)/lib \
1016 $(BUILD_SRC_ROOT)/tools $(BUILD_SRC_ROOT)/examples \
1017 $(BUILD_OBJ_ROOT)/include $(BUILD_OBJ_ROOT)/lib \
1018 $(BUILD_OBJ_ROOT)/tools $(BUILD_OBJ_ROOT)/examples \
1019 \( -name '*.cpp' -o -name '*.h' \) -print | \
1020 ctags -ImtT -o $(BUILD_OBJ_ROOT)/CTAGS -L -
1021
1022
Reid Spencer81cd0492004-10-23 20:04:14 +00001023###############################################################################
1024# DEPENDENCIES: Include the dependency files if we should
1025###############################################################################
Chris Lattnere9d7d702003-08-22 14:10:16 +00001026ifndef DISABLE_AUTO_DEPENDENCIES
1027
Reid Spencer81cd0492004-10-23 20:04:14 +00001028# If its not one of the cleaning targets
Reid Spencerf88808a2004-10-30 09:19:36 +00001029ifneq ($strip($(filter-out clean clean-local dist-clean,$(MAKECMDGOALS))),)
Reid Spencerf206bd72004-10-22 21:01:56 +00001030
Reid Spencer81cd0492004-10-23 20:04:14 +00001031# Get the list of dependency files
Reid Spencerf88808a2004-10-30 09:19:36 +00001032DependFiles := $(basename $(filter %.cpp %.c %.cc, $(Sources)))
Reid Spencerb5b92fb2004-11-01 07:50:27 +00001033DependFiles := $(patsubst %,$(BUILD_OBJ_DIR)/$(BuildMode)/%.d,$(DependFiles))
Misha Brukmanb891ffb2003-11-09 21:36:19 +00001034
Reid Spencer81cd0492004-10-23 20:04:14 +00001035-include /dev/null $(DependFiles)
1036
John Criswell48ecca62003-08-12 18:51:51 +00001037endif
Chris Lattner598222b2003-08-18 17:27:40 +00001038
Reid Spencerf88808a2004-10-30 09:19:36 +00001039endif
Reid Spencerf206bd72004-10-22 21:01:56 +00001040
Reid Spencer100080c2004-10-25 08:27:37 +00001041###############################################################################
Reid Spencerf88808a2004-10-30 09:19:36 +00001042# DISTRIBUTION: Handle construction of a distribution tarball
Reid Spencer100080c2004-10-25 08:27:37 +00001043###############################################################################
1044
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001045#------------------------------------------------------------------------
1046# Define distribution related variables
1047#------------------------------------------------------------------------
Reid Spencer100080c2004-10-25 08:27:37 +00001048DistName := $(LLVM_TARBALL_NAME)
1049DistDir := $(BUILD_OBJ_ROOT)/$(DistName)
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001050TopDistDir := $(BUILD_OBJ_ROOT)/$(DistName)
Reid Spencer100080c2004-10-25 08:27:37 +00001051DistTarGZip := $(BUILD_OBJ_ROOT)/$(DistName).tar.gz
1052DistZip := $(BUILD_OBJ_ROOT)/$(DistName).zip
1053DistTarBZ2 := $(BUILD_OBJ_ROOT)/$(DistName).tar.bz2
1054DistAlways := CREDITS.TXT LICENSE.TXT README.txt README AUTHORS COPYING \
1055 ChangeLog INSTALL NEWS Makefile Makefile.common Makefile.rules \
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001056 Makefile.config.in configure autoconf
1057DistOther := $(notdir $(wildcard \
1058 $(BUILD_SRC_DIR)/*.h \
1059 $(BUILD_SRC_DIR)/*.td \
1060 $(BUILD_SRC_DIR)/*.def \
1061 $(BUILD_SRC_DIR)/*.ll \
1062 $(BUILD_SRC_DIR)/*.in))
Reid Spencerf88808a2004-10-30 09:19:36 +00001063DistSubDirs := $(SubDirs)
Reid Spencerfc66af42004-11-29 05:00:33 +00001064DistSources = $(Sources) $(EXTRA_DIST)
1065DistFiles = $(DistAlways) $(DistSources) $(DistOther)
Reid Spencer100080c2004-10-25 08:27:37 +00001066
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001067#------------------------------------------------------------------------
1068# We MUST build distribution with OBJ_DIR != SRC_DIR
1069#------------------------------------------------------------------------
1070ifeq ($(BUILD_SRC_DIR),$(BUILD_OBJ_DIR))
1071dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
Reid Spencerf88808a2004-10-30 09:19:36 +00001072 $(Echo) ERROR: Target $@ only available with OBJ_DIR != SRC_DIR
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001073
1074DistCheckTop :=
1075else
1076
1077DistCheckTop := check
Reid Spencerf88808a2004-10-30 09:19:36 +00001078
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001079#------------------------------------------------------------------------
1080# Prevent catastrophic remove
1081#------------------------------------------------------------------------
1082ifeq ($(LLVM_TARBALL_NAME),)
1083$(error LLVM_TARBALL_NAME is empty. Please rerun configure)
1084endif
1085
1086#------------------------------------------------------------------------
1087# Prevent attempt to run dist targets from anywhere but the top level
1088#------------------------------------------------------------------------
1089ifneq ($(LEVEL),.)
1090
1091dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
Reid Spencerf88808a2004-10-30 09:19:36 +00001092 $(Echo) ERROR: You must run $@ from $(BUILD_OBJ_ROOT)
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001093
1094else
1095
1096#------------------------------------------------------------------------
1097# Provide the top level targets
1098#------------------------------------------------------------------------
1099
Reid Spencerf88808a2004-10-30 09:19:36 +00001100dist-gzip:: $(DistTarGZip)
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001101
1102$(DistTarGZip) : distdir
Reid Spencerf88808a2004-10-30 09:19:36 +00001103 $(Echo) Packing gzipped distribution tar file.
Reid Spencerfc66af42004-11-29 05:00:33 +00001104 $(Verb) cd $(BUILD_OBJ_ROOT) ; $(TAR) chf - "$(DistName)" | \
1105 $(GZIP) -c > "$(DistTarGZip)"
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001106
Reid Spencerf88808a2004-10-30 09:19:36 +00001107dist-bzip2:: $(DistTarBZ2)
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001108
1109$(DistTarBZ2) : distdir
Reid Spencerf88808a2004-10-30 09:19:36 +00001110 $(Echo) Packing bzipped distribution tar file.
Reid Spencerfc66af42004-11-29 05:00:33 +00001111 $(Verb) cd $(BUILD_OBJ_ROOT) ; $(TAR) chf - $(DistName) | \
1112 $(BZIP2) -c >$(DistTarBZ2)
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001113
Reid Spencerf88808a2004-10-30 09:19:36 +00001114dist-zip:: $(DistZip)
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001115
1116$(DistZip) : distdir
Reid Spencerf88808a2004-10-30 09:19:36 +00001117 $(Echo) Packing zipped distribution file.
1118 $(Verb) rm -f $(DistZip)
1119 $(Verb) cd $(BUILD_OBJ_ROOT) ; $(ZIP) -rq $(DistZip) $(DistName)
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001120
1121dist :: $(DistTarGZip) $(DistTarBZ2) $(DistZip)
Reid Spencerf88808a2004-10-30 09:19:36 +00001122 $(Echo) ===== DISTRIBUTION PACKAGING SUCESSFUL =====
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001123
1124DistCheckDir := $(LLVM_OBJ_ROOT)/_distcheckdir
1125
Reid Spencer77a46d22004-10-26 22:26:33 +00001126dist-check:: $(DistCheckTop) $(DistTarGZip)
Reid Spencerf88808a2004-10-30 09:19:36 +00001127 $(Echo) Checking distribution tar file.
1128 $(Verb) if test -d $(DistCheckDir) ; then \
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001129 $(RM) -rf $(DistCheckDir) ; \
1130 fi
Reid Spencerf88808a2004-10-30 09:19:36 +00001131 $(Verb) $(MKDIR) $(DistCheckDir)
1132 $(Verb) cd $(DistCheckDir) && \
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001133 $(MKDIR) $(DistCheckDir)/build && \
1134 $(MKDIR) $(DistCheckDir)/install && \
1135 gunzip -c $(DistTarGZip) | $(TAR) xf - && \
1136 cd build && \
1137 ../$(DistName)/configure --prefix="$(DistCheckDir)/install" \
1138 --srcdir=../$(DistName) --with-llvmgccdir="$(LLVMGCCDIR)" && \
1139 $(MAKE) check && \
1140 $(MAKE) install && \
1141 $(MAKE) uninstall && \
1142 $(MAKE) dist && \
1143 $(MAKE) clean && \
1144 $(MAKE) dist-clean && \
Reid Spencerf88808a2004-10-30 09:19:36 +00001145 $(EchoCmd) ===== $(DistTarGZip) Ready For Distribution =====
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001146
1147dist-clean::
Reid Spencerf88808a2004-10-30 09:19:36 +00001148 $(Echo) Cleaning distribution files
Reid Spencer651dd3ad2004-11-02 16:56:15 +00001149 -$(Verb) $(RM) -rf $(DistTarGZip) $(DistTarBZ2) $(DistZip) $(DistName) $(DistCheckDir)
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001150
1151endif
1152
1153#------------------------------------------------------------------------
1154# Provide the recursive distdir target for building the distribution directory
1155#------------------------------------------------------------------------
Reid Spencer77a46d22004-10-26 22:26:33 +00001156distdir : $(DistSources)
Reid Spencerf88808a2004-10-30 09:19:36 +00001157 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001158 if test -d "$(DistDir)" ; then \
1159 find $(DistDir) -type d ! -perm -200 -exec chmod u+w {} ';' || \
1160 exit 1 ; \
1161 fi ; \
Reid Spencerf88808a2004-10-30 09:19:36 +00001162 $(EchoCmd) Removing $(DistDir) ; \
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001163 $(RM) -rf $(DistDir); \
1164 fi
Reid Spencerfc66af42004-11-29 05:00:33 +00001165 $(Echo) Building Distribution Directory $(DistDir)
Reid Spencerf88808a2004-10-30 09:19:36 +00001166 $(Verb) $(MKDIR) $(DistDir)
1167 $(Verb) srcdirstrip=`echo "$(BUILD_SRC_DIR)" | sed 's|.|.|g'`; \
Reid Spencer100080c2004-10-25 08:27:37 +00001168 srcrootstrip=`echo "$(BUILD_SRC_ROOT)" | sed 's|.|.|g'`; \
1169 for file in $(DistFiles) ; do \
1170 case "$$file" in \
1171 $(BUILD_SRC_DIR)/*) file=`echo "$$file" | sed "s#^$$srcdirstrip/##"`;; \
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001172 $(BUILD_SRC_ROOT)/*) file=`echo "$$file" | sed "s#^$$srcrootstrip/#$(BUILD_OBJ_ROOT)/#"`;; \
Reid Spencer100080c2004-10-25 08:27:37 +00001173 esac; \
1174 if test -f "$$file" || test -d "$$file" ; then \
1175 from_dir=. ; \
1176 else \
1177 from_dir=$(BUILD_SRC_DIR); \
1178 fi; \
1179 to_dir=`echo "$$file" | sed -e 's#/[^/]*$$##'`; \
1180 if test "$$to_dir" != "$$file" && test "$$to_dir" != "."; then \
1181 to_dir="$(DistDir)/$$dir"; \
1182 $(MKDIR) "$$to_dir" ; \
1183 else \
1184 to_dir="$(DistDir)"; \
1185 fi; \
1186 mid_dir=`echo "$$file" | sed -n -e 's#^\(.*\)/[^/]*$$#\1#p'`; \
1187 if test -n "$$mid_dir" ; then \
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001188 $(MKDIR) "$$to_dir/$$mid_dir" || exit 1; \
Reid Spencer100080c2004-10-25 08:27:37 +00001189 fi ; \
1190 if test -d "$$from_dir/$$file"; then \
1191 if test -d "$(BUILD_SRC_DIR)/$$file" && \
1192 test "$$from_dir" != "$(BUILD_SRC_DIR)" ; then \
1193 cp -pR "$(BUILD_SRC_DIR)/$$file" "$$to_dir" || exit 1; \
1194 fi; \
1195 cp -pR $$from_dir/$$file $$to_dir || exit 1; \
1196 elif test -f "$$from_dir/$$file" ; then \
1197 cp -p "$$from_dir/$$file" "$(DistDir)/$$file" || exit 1; \
1198 elif test -L "$$from_dir/$$file" ; then \
1199 cp -pd "$$from_dir/$$file" $(DistDir)/$$file || exit 1; \
1200 elif echo "$(DistAlways)" | grep -v "$$file" >/dev/null ; then \
Reid Spencerf88808a2004-10-30 09:19:36 +00001201 $(EchoCmd) "===== WARNING: Distribution Source $$from_dir/$$file Not Found!" ; \
1202 elif test "$(Verb)" != '@' ; then \
1203 $(EchoCmd) "Skipping non-existent $$from_dir/$$file" ; \
Reid Spencer100080c2004-10-25 08:27:37 +00001204 fi; \
1205 done
Reid Spencerf88808a2004-10-30 09:19:36 +00001206 $(Verb) for subdir in $(DistSubDirs) ; do \
Reid Spencer100080c2004-10-25 08:27:37 +00001207 if test "$$subdir" \!= "." ; then \
Reid Spencer100080c2004-10-25 08:27:37 +00001208 new_distdir="$(DistDir)/$$subdir" ; \
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001209 test -d "$$new_distdir" || $(MKDIR) "$$new_distdir" || exit 1; \
1210 ( cd $$subdir && $(MAKE) DistDir="$$new_distdir" distdir ) || exit 1; \
Reid Spencer100080c2004-10-25 08:27:37 +00001211 fi; \
1212 done
Reid Spencerf88808a2004-10-30 09:19:36 +00001213 $(Verb) $(MAKE) DistDir="$(DistDir)" dist-hook || exit 1
1214 -$(Verb) find $(DistDir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
Reid Spencer100080c2004-10-25 08:27:37 +00001215 ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
1216 ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
1217 ! -type d ! -perm -444 -exec $(SHELL) $(INSTALL_SH) -c -m a+r {} {} \; \
1218 || chmod -R a+r $(DistDir)
1219
Reid Spencerf88808a2004-10-30 09:19:36 +00001220# This is invoked by distdir target, define it as a no-op to avoid errors if not
1221# defined by user.
Reid Spencer100080c2004-10-25 08:27:37 +00001222dist-hook::
1223
Reid Spencer23a70372004-10-22 23:06:30 +00001224endif
Reid Spencerf206bd72004-10-22 21:01:56 +00001225
1226###############################################################################
Reid Spencer12a3a052004-10-24 07:53:21 +00001227# TOP LEVEL - targets only to apply at the top level directory
1228###############################################################################
1229
1230ifeq ($(LEVEL),.)
1231
1232#------------------------------------------------------------------------
Reid Spencer12a3a052004-10-24 07:53:21 +00001233# Install support for project's include files:
1234#------------------------------------------------------------------------
1235install-local::
Reid Spencerf88808a2004-10-30 09:19:36 +00001236 $(Echo) Installing include files
1237 $(Verb) $(MKDIR) $(includedir)
1238 $(Verb) if [ -d "$(BUILD_SRC_ROOT)/include" ] ; then \
Reid Spencer12a3a052004-10-24 07:53:21 +00001239 cd $(BUILD_SRC_ROOT)/include && \
1240 find . -path '*/Internal' -prune -o '(' -type f \
1241 '!' '(' -name '*~' -o -name '.cvsignore' -o -name '.#*' ')' \
1242 -print ')' | grep -v CVS | pax -rwdvpe $(includedir) ; \
1243 fi
1244
1245uninstall-local::
Reid Spencerf88808a2004-10-30 09:19:36 +00001246 $(Echo) Uninstalling include files
1247 $(Verb) if [ -d "$(BUILD_SRC_ROOT)/include" ] ; then \
Reid Spencer12a3a052004-10-24 07:53:21 +00001248 cd $(BUILD_SRC_ROOT)/include && \
1249 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f \
1250 '!' '(' -name '*~' -o -name '.cvsignore' -o -name '.#*' ')' \
1251 -print ')' | grep -v CVS | sed 's#^#$(includedir)/#'` ; \
1252 fi
1253
Reid Spencer12a3a052004-10-24 07:53:21 +00001254endif
1255
Reid Spencerf206bd72004-10-22 21:01:56 +00001256#------------------------------------------------------------------------
1257# Print out the directories used for building
Reid Spencerf88808a2004-10-30 09:19:36 +00001258#------------------------------------------------------------------------
Reid Spencer81cd0492004-10-23 20:04:14 +00001259printvars::
Reid Spencerb5b92fb2004-11-01 07:50:27 +00001260 $(Echo) "BuildMode : " '$(BuildMode)'
Reid Spencerf88808a2004-10-30 09:19:36 +00001261 $(Echo) "BUILD_SRC_ROOT : " '$(BUILD_SRC_ROOT)'
1262 $(Echo) "BUILD_SRC_DIR : " '$(BUILD_SRC_DIR)'
1263 $(Echo) "BUILD_OBJ_ROOT : " '$(BUILD_OBJ_ROOT)'
1264 $(Echo) "BUILD_OBJ_DIR : " '$(BUILD_OBJ_DIR)'
1265 $(Echo) "LLVM_SRC_ROOT : " '$(LLVM_SRC_ROOT)'
1266 $(Echo) "LLVM_OBJ_ROOT : " '$(LLVM_OBJ_ROOT)'
1267 $(Echo) "libdir : " '$(libdir)'
1268 $(Echo) "bindir : " '$(bindir)'
1269 $(Echo) "sysconfdir : " '$(sysconfdir)'
1270 $(Echo) "bytecode_libdir: " '$(bytecode_libdir)'
1271 $(Echo) "UserTargets : " '$(UserTargets)'
1272 $(Echo) "ObjMakefiles : " '$(ObjMakefiles)'
1273 $(Echo) "SrcMakefiles : " '$(SrcMakefiles)'
1274 $(Echo) "ObjDir : " '$(ObjDir)'
1275 $(Echo) "LibDir : " '$(LibDir)'
1276 $(Echo) "ToolDir : " '$(ToolDir)'
Reid Spencer7e9e0b02004-11-18 10:03:46 +00001277 $(Echo) "ExmplDir : " '$(ExmplDir)'
Reid Spencerf88808a2004-10-30 09:19:36 +00001278 $(Echo) "TDFiles : " '$(TDFiles)'
1279 $(Echo) "INCFiles : " '$(INCFiles)'
1280 $(Echo) "Compile.CXX : " '$(Compile.CXX)'
1281 $(Echo) "Compile.C : " '$(Compile.C)'
1282 $(Echo) "Archive : " '$(Archive)'
Reid Spencer9d0c1e02004-11-02 16:36:03 +00001283 $(Echo) "YaccFiles : " '$(YaccFiles)'
1284 $(Echo) "LexFiles : " '$(LexFiles)'