blob: b76394ca34137700f0844cc63f18ceb036039bd9 [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 Spencerd4bd3752004-12-03 20:08:48 +000022RecursiveTargets := all clean clean-all check install uninstall install-bytecode
Reid Spencer9d0c1e02004-11-02 16:36:03 +000023LocalTargets := all-local clean-local clean-all-local check-local \
Reid Spencerd4bd3752004-12-03 20:08:48 +000024 install-local printvars uninstall-local \
25 install-bytecode-local
Reid Spencerf88808a2004-10-30 09:19:36 +000026TopLevelTargets := dist dist-check dist-clean tags dist-gzip dist-bzip2 \
27 dist-zip
28UserTargets := $(RecursiveTargets) $(LocalTargets) $(TopLevelTargets)
29InternalTargets := preconditions distdir dist-hook
Reid Spencer81cd0492004-10-23 20:04:14 +000030
Reid Spencerf88808a2004-10-30 09:19:36 +000031################################################################################
Reid Spencer77a46d22004-10-26 22:26:33 +000032# INITIALIZATION: Basic things the makefile needs
Reid Spencerf88808a2004-10-30 09:19:36 +000033################################################################################
34
35#--------------------------------------------------------------------
36# Set the VPATH so that we can find source files.
37#--------------------------------------------------------------------
38VPATH=$(BUILD_SRC_DIR)
Reid Spencer77a46d22004-10-26 22:26:33 +000039
40#--------------------------------------------------------------------
41# Reset the list of suffixes we know how to build
42#--------------------------------------------------------------------
43.SUFFIXES:
Reid Spencerf88808a2004-10-30 09:19:36 +000044.SUFFIXES: .c .cpp .h .hpp .y .l .lo .o .a .bc .td .ps .dot
45.SUFFIXES: $(SHLIBEXT) $(SUFFIXES)
Reid Spencer77a46d22004-10-26 22:26:33 +000046
Reid Spencer81cd0492004-10-23 20:04:14 +000047#--------------------------------------------------------------------
48# Mark all of these targets as phony to avoid implicit rule search
49#--------------------------------------------------------------------
Reid Spencerf88808a2004-10-30 09:19:36 +000050.PHONY: $(UserTargets) $(InternalTargets)
Reid Spencer81cd0492004-10-23 20:04:14 +000051
52#--------------------------------------------------------------------
Reid Spencer77a46d22004-10-26 22:26:33 +000053# Make sure all the user-target rules are double colon rules and
54# they are defined first.
Reid Spencer81cd0492004-10-23 20:04:14 +000055#--------------------------------------------------------------------
56
Reid Spencerf88808a2004-10-30 09:19:36 +000057$(UserTargets)::
Reid Spencer100080c2004-10-25 08:27:37 +000058
Reid Spencer77a46d22004-10-26 22:26:33 +000059################################################################################
60# PRECONDITIONS: that which must be built/checked first
61################################################################################
62
Reid Spencerd4bd3752004-12-03 20:08:48 +000063SrcMakefiles := $(filter %Makefile %Makefile.tests,\
Reid Spencer91234ff2004-11-17 19:08:44 +000064 $(wildcard $(BUILD_SRC_DIR)/Makefile*))
Reid Spencerf88808a2004-10-30 09:19:36 +000065ObjMakefiles := $(subst $(BUILD_SRC_DIR),$(BUILD_OBJ_DIR),$(SrcMakefiles))
66ConfigureScript := $(LLVM_SRC_ROOT)/configure
67ConfigStatusScript := $(LLVM_OBJ_ROOT)/config.status
68MakefileConfigIn := $(LLVM_SRC_ROOT)/Makefile.config.in
69MakefileConfig := $(LLVM_OBJ_ROOT)/Makefile.config
70PreConditions := $(ConfigStatusScript) $(MakefileConfig) $(ObjMakefiles)
Reid Spencer77a46d22004-10-26 22:26:33 +000071
Reid Spencerf88808a2004-10-30 09:19:36 +000072preconditions : $(PreConditions)
Reid Spencer77a46d22004-10-26 22:26:33 +000073
74#------------------------------------------------------------------------
75# Make sure the BUILT_SOURCES are built first
76#------------------------------------------------------------------------
Reid Spencerf88808a2004-10-30 09:19:36 +000077$(filter-out clean clean-local,UserTargets):: $(BUILT_SOURCES)
Reid Spencer77a46d22004-10-26 22:26:33 +000078
79clean-local::
80ifneq ($(strip $(BUILT_SOURCES)),)
Reid Spencer651dd3ad2004-11-02 16:56:15 +000081 -$(Verb) $(RM) -f $(BUILT_SOURCES)
Reid Spencer77a46d22004-10-26 22:26:33 +000082endif
83
Reid Spencerf88808a2004-10-30 09:19:36 +000084$(BUILT_SOURCES) : $(ObjMakefiles)
Reid Spencerb7f710a2004-10-28 00:41:43 +000085
Reid Spencer77a46d22004-10-26 22:26:33 +000086#------------------------------------------------------------------------
87# Make sure we're not using a stale configuration
88#------------------------------------------------------------------------
Reid Spencerf88808a2004-10-30 09:19:36 +000089.PRECIOUS: $(ConfigStatusScript)
90$(ConfigStatusScript): $(ConfigureScript)
91 $(Echo) Reconfiguring with $<
Reid Spencer50f34872004-11-29 12:37:44 +000092 $(Verb) cd $(BUILD_OBJ_ROOT) && \
93 $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
94 $(ConfigStatusScript)
Reid Spencer77a46d22004-10-26 22:26:33 +000095
96#------------------------------------------------------------------------
97# Make sure the configuration makefile is up to date
98#------------------------------------------------------------------------
Reid Spencerf88808a2004-10-30 09:19:36 +000099$(MakefileConfig): $(MakefileConfigIn) $(ConfigStatusScript)
100 $(Echo) Regenerating $@
101 $(Verb) cd $(LLVM_OBJ_ROOT) ; $(ConfigStatusScript) Makefile.config
Reid Spencer77a46d22004-10-26 22:26:33 +0000102
103#------------------------------------------------------------------------
104# If the Makefile in the source tree has been updated, copy it over into the
105# build tree. But, only do this if the source and object makefiles differ
106#------------------------------------------------------------------------
107ifneq ($(BUILD_OBJ_DIR),$(BUILD_SRC_DIR))
108
Reid Spencer91234ff2004-11-17 19:08:44 +0000109Makefile: $(BUILD_SRC_DIR)/Makefile
Reid Spencerf88808a2004-10-30 09:19:36 +0000110 $(Echo) "Updating Makefile"
111 $(Verb) $(MKDIR) $(@D)
112 $(Verb) cp -f $< $@
Reid Spencer77a46d22004-10-26 22:26:33 +0000113
114# Copy the Makefile.* files unless we're in the root directory which avoids
115# the copying of Makefile.config.in or other things that should be explicitly
116# taken care of.
Reid Spencer77a46d22004-10-26 22:26:33 +0000117$(BUILD_OBJ_DIR)/Makefile% : $(BUILD_SRC_DIR)/Makefile%
Reid Spencerd94bb332004-10-26 23:10:00 +0000118 @case '$?' in \
119 *Makefile.rules) ;; \
120 *.in) ;; \
Reid Spencerf88808a2004-10-30 09:19:36 +0000121 *) $(Echo) "Updating $(@F)" ; \
Reid Spencerd94bb332004-10-26 23:10:00 +0000122 $(MKDIR) $(@D) ; \
123 cp -f $< $@ ;; \
124 esac
125
Reid Spencer77a46d22004-10-26 22:26:33 +0000126endif
127
128#------------------------------------------------------------------------
129# Set up the basic dependencies
130#------------------------------------------------------------------------
Reid Spencerf88808a2004-10-30 09:19:36 +0000131$(UserTargets):: $(PreConditions)
Reid Spencer77a46d22004-10-26 22:26:33 +0000132
133all:: all-local
Reid Spencer81cd0492004-10-23 20:04:14 +0000134check:: check-local
135clean:: clean-local
Reid Spencer9d0c1e02004-11-02 16:36:03 +0000136clean-all:: clean-local clean-all-local
Reid Spencer77a46d22004-10-26 22:26:33 +0000137install:: install-local
138uninstall:: uninstall-local
139check-local:: all-local
140install-local:: all-local
Reid Spencerd4bd3752004-12-03 20:08:48 +0000141install-bytecode:: install-bytecode-local
Reid Spencer81cd0492004-10-23 20:04:14 +0000142
143###############################################################################
144# VARIABLES: Set up various variables based on configuration data
145###############################################################################
146
147#--------------------------------------------------------------------
148# Variables derived from configuration we are building
Chris Lattner2f7c9632001-06-06 20:29:01 +0000149#--------------------------------------------------------------------
150
Chris Lattnerc2bd7cf2003-03-14 20:25:22 +0000151ifdef ENABLE_PROFILING
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000152 BuildMode := Profile
Reid Spencerf88808a2004-10-30 09:19:36 +0000153 CXX.Flags := -O3 -DNDEBUG -felide-constructors -finline-functions -pg
154 C.Flags := -O3 -DNDEBUG -pg
155 LD.Flags := -O3 -DNDEBUG -pg
Chris Lattnerc2bd7cf2003-03-14 20:25:22 +0000156else
157 ifdef ENABLE_OPTIMIZED
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000158 BuildMode := Release
Reid Spencerf88808a2004-10-30 09:19:36 +0000159 CXX.Flags := -O3 -DNDEBUG -finline-functions -felide-constructors -fomit-frame-pointer
160 C.Flags := -O3 -DNDEBUG -fomit-frame-pointer
161 LD.Flags := -O3 -DNDEBUG
Chris Lattnerc2bd7cf2003-03-14 20:25:22 +0000162 else
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000163 BuildMode := Debug
Reid Spencerf88808a2004-10-30 09:19:36 +0000164 CXX.Flags := -g -D_DEBUG
165 C.Flags := -g -D_DEBUG
166 LD.Flags := -g -D_DEBUG
Reid Spencerf206bd72004-10-22 21:01:56 +0000167 KEEP_SYMBOLS := 1
Chris Lattnerc2bd7cf2003-03-14 20:25:22 +0000168 endif
169endif
170
Reid Spencerf88808a2004-10-30 09:19:36 +0000171CXX.Flags += $(CXXFLAGS)
172C.Flags += $(CFLAGS)
173CPP.Flags += $(CPPFLAGS)
174LD.Flags += $(LDFLAGS)
175AR.Flags := cru
176LibTool.Flags := --tag=CXX
Reid Spencer81cd0492004-10-23 20:04:14 +0000177
178#--------------------------------------------------------------------
Reid Spencerf206bd72004-10-22 21:01:56 +0000179# Directory locations
Reid Spencer81cd0492004-10-23 20:04:14 +0000180#--------------------------------------------------------------------
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000181ObjDir := $(BUILD_OBJ_DIR)/$(BuildMode)
Reid Spencer7e9e0b02004-11-18 10:03:46 +0000182LibDir := $(BUILD_OBJ_ROOT)/$(BuildMode)/lib
Reid Spencer0dbf1012004-11-18 20:04:39 +0000183ToolDir := $(BUILD_OBJ_ROOT)/$(BuildMode)/bin
Reid Spencer7e9e0b02004-11-18 10:03:46 +0000184ExmplDir := $(BUILD_OBJ_ROOT)/$(BuildMode)/examples
185LLVMLibDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/lib
Reid Spencer0dbf1012004-11-18 20:04:39 +0000186LLVMToolDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/bin
Reid Spencer7e9e0b02004-11-18 10:03:46 +0000187LExmplDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/examples
John Criswell3ef61af2003-06-30 21:59:07 +0000188
Reid Spencer81cd0492004-10-23 20:04:14 +0000189#--------------------------------------------------------------------
Reid Spencerf206bd72004-10-22 21:01:56 +0000190# Full Paths To Compiled Tools and Utilities
Reid Spencer81cd0492004-10-23 20:04:14 +0000191#--------------------------------------------------------------------
Reid Spencerf88808a2004-10-30 09:19:36 +0000192EchoCmd := $(ECHO) llvm[$(MAKELEVEL)]:
193Echo := @$(EchoCmd)
194ifndef LIBTOOL
Reid Spencerf206bd72004-10-22 21:01:56 +0000195LIBTOOL := $(LLVM_OBJ_ROOT)/mklib
Reid Spencerf88808a2004-10-30 09:19:36 +0000196endif
197ifndef LLVMAS
198LLVMAS := $(LLVMToolDir)/llvm-as$(EXEEXT)
199endif
200ifndef BURG
201BURG := $(LLVMToolDir)/burg$(EXEEXT)
202endif
203ifndef TBLGEN
204TBLGEN := $(LLVMToolDir)/tblgen$(EXEEXT)
205endif
Chris Lattner0ea40c92004-11-29 19:47:58 +0000206ifndef GCCAS
207GCCAS := $(LLVMToolDir)/gccas$(EXEEXT)
208endif
Reid Spencerf88808a2004-10-30 09:19:36 +0000209ifndef GCCLD
210GCCLD := $(LLVMToolDir)/gccld$(EXEEXT)
211endif
212ifndef LLVMGCC
213LLVMGCC := PATH=$(LLVMToolDir):$(PATH) $(LLVMGCCDIR)/bin/gcc
214endif
215ifndef LLVMGXX
216LLVMGXX := PATH=$(LLVMToolDir):$(PATH) $(LLVMGCCDIR)/bin/g++
217endif
Dinakar Dhurjati41f77482003-05-29 16:18:20 +0000218
Reid Spencerf206bd72004-10-22 21:01:56 +0000219# Need a better way to compute this.
Reid Spencerf88808a2004-10-30 09:19:36 +0000220LLVMGCCLibDir := $(dir $(shell $(LLVMGCC) -print-file-name=libgcc.a))/
Dinakar Dhurjati41f77482003-05-29 16:18:20 +0000221
Reid Spencer81cd0492004-10-23 20:04:14 +0000222#--------------------------------------------------------------------
Reid Spencerf206bd72004-10-22 21:01:56 +0000223# Adjust to user's request
Reid Spencer81cd0492004-10-23 20:04:14 +0000224#--------------------------------------------------------------------
Dinakar Dhurjati41f77482003-05-29 16:18:20 +0000225
Reid Spencerf88808a2004-10-30 09:19:36 +0000226# Adjust LIBTOOL flags for shared libraries, or not.
John Criswell3601f372003-07-31 20:58:51 +0000227ifndef SHARED_LIBRARY
Reid Spencerf88808a2004-10-30 09:19:36 +0000228 LibTool.Flags += --tag=disable-shared
Reid Spencerf206bd72004-10-22 21:01:56 +0000229else
Reid Spencerf88808a2004-10-30 09:19:36 +0000230 LD.Flags += -rpath $(LibDir)
John Criswell3601f372003-07-31 20:58:51 +0000231endif
232
Reid Spencerf8b4a8e2004-11-08 17:32:12 +0000233ifdef TOOL_VERBOSE
234 C.Flags += -v
235 CXX.Flags += -v
236 LD.Flags += -v
Reid Spencerf8b4a8e2004-11-08 17:32:12 +0000237 VERBOSE := 1
Reid Spencer32f7e422004-12-02 09:28:21 +0000238else
Reid Spencerf8b4a8e2004-11-08 17:32:12 +0000239endif
240
Reid Spencer81cd0492004-10-23 20:04:14 +0000241# Adjust settings for verbose mode
Chris Lattnerc2bd7cf2003-03-14 20:25:22 +0000242ifndef VERBOSE
Reid Spencerf88808a2004-10-30 09:19:36 +0000243 Verb := @
244 LibTool.Flags += --silent
245 AR.Flags += >/dev/null 2>/dev/null
246 ConfigureScriptFLAGS += >$(BUILD_OBJ_DIR)/configure.out 2>&1
Reid Spencer100080c2004-10-25 08:27:37 +0000247else
Reid Spencerf88808a2004-10-30 09:19:36 +0000248 ConfigureScriptFLAGS :=
Misha Brukman1326a7c2002-09-12 16:05:39 +0000249endif
250
Vikram S. Adved141c282002-09-18 11:55:13 +0000251# By default, strip symbol information from executable
Chris Lattnerc2bd7cf2003-03-14 20:25:22 +0000252ifndef KEEP_SYMBOLS
Reid Spencerf88808a2004-10-30 09:19:36 +0000253 Strip := $(PLATFORMSTRIPOPTS)
254 StripWarnMsg := "(without symbols)"
Vikram S. Adved141c282002-09-18 11:55:13 +0000255endif
256
Reid Spencer81cd0492004-10-23 20:04:14 +0000257# Adjust linker flags for building an executable
Reid Spencerf206bd72004-10-22 21:01:56 +0000258ifdef TOOLNAME
Reid Spencer7e9e0b02004-11-18 10:03:46 +0000259ifdef EXAMPLE_TOOL
260 LD.Flags += -rpath $(ExmplDir) -export-dynamic
261else
Reid Spencerf88808a2004-10-30 09:19:36 +0000262 LD.Flags += -rpath $(ToolDir) -export-dynamic
Dinakar Dhurjati3ac83a92003-10-29 14:28:35 +0000263endif
Reid Spencer7e9e0b02004-11-18 10:03:46 +0000264endif
Dinakar Dhurjati3ac83a92003-10-29 14:28:35 +0000265
Reid Spencer81cd0492004-10-23 20:04:14 +0000266#----------------------------------------------------------
Reid Spencerf206bd72004-10-22 21:01:56 +0000267# Options To Invoke Tools
Reid Spencer81cd0492004-10-23 20:04:14 +0000268#----------------------------------------------------------
Reid Spencerf206bd72004-10-22 21:01:56 +0000269
270CompileCommonOpts := -Wall -W -Wwrite-strings -Wno-unused
271
Reid Spencerf88808a2004-10-30 09:19:36 +0000272LD.Flags += -L$(LibDir) -L$(LLVMLibDir)
273CPP.Flags += -I$(BUILD_OBJ_DIR) \
Reid Spencer100080c2004-10-25 08:27:37 +0000274 -I$(BUILD_SRC_DIR) \
275 -I$(BUILD_SRC_ROOT)/include \
276 -I$(BUILD_OBJ_ROOT)/include \
277 -I$(LLVM_OBJ_ROOT)/include \
278 -I$(LLVM_SRC_ROOT)/include \
279 -D_GNU_SOURCE -D__STDC_LIMIT_MACROS
Reid Spencerf206bd72004-10-22 21:01:56 +0000280
Reid Spencerf88808a2004-10-30 09:19:36 +0000281Compile.C = $(CC) $(CPP.Flags) $(CompileCommonOpts) -c $(C.Flags)
282LTCompile.C = $(LIBTOOL) $(LibTool.Flags) --mode=compile $(Compile.C)
283BCCompile.C = $(LLVMGCC) $(CPP.Flags) $(CompileCommonOpts) $(C.Flags) -c
284Compile.CXX = $(CXX) $(CPP.Flags) $(CompileCommonOpts) $(CXX.Flags) -c
285LTCompile.CXX = $(LIBTOOL) $(LibTool.Flags) --mode=compile $(Compile.CXX)
286BCCompile.CXX = $(LLVMGXX) $(CPP.Flags) $(CompileCommonOpts) $(CXX.Flags) -c
287Link = $(LIBTOOL) $(LibTool.Flags) --mode=link $(CXX) $(CPP.Flags) \
288 $(CompileCommonOpts) $(LD.Flags) $(Strip)
289Relink = $(LIBTOOL) $(LibTool.Flags) --mode=link $(CXX) $(CPP.Flags) \
Reid Spencer9c7bfc92004-10-28 09:15:28 +0000290 $(CompileCommonOpts)
Reid Spencerf88808a2004-10-30 09:19:36 +0000291LTInstall = $(LIBTOOL) $(LibTool.Flags) --mode=install $(INSTALL)
Reid Spencer81cd0492004-10-23 20:04:14 +0000292Burg = $(BURG) -I $(BUILD_SRC_DIR)
293TableGen = $(TBLGEN) -I $(BUILD_SRC_DIR)
Reid Spencerf88808a2004-10-30 09:19:36 +0000294Archive = $(AR) $(AR.Flags)
Reid Spencer32f7e422004-12-02 09:28:21 +0000295LArchive = $(LLVMToolDir)/llvm-ar rcsf
Reid Spencerf206bd72004-10-22 21:01:56 +0000296ifdef RANLIB
Reid Spencer81cd0492004-10-23 20:04:14 +0000297Ranlib = $(RANLIB)
Reid Spencerf206bd72004-10-22 21:01:56 +0000298else
Reid Spencer81cd0492004-10-23 20:04:14 +0000299Ranlib = ranlib
John Criswell3ef61af2003-06-30 21:59:07 +0000300endif
301
Chris Lattner2f7c9632001-06-06 20:29:01 +0000302#----------------------------------------------------------
Reid Spencer81cd0492004-10-23 20:04:14 +0000303# Get the list of source files
304#----------------------------------------------------------
305ifndef SOURCES
Reid Spencerf88808a2004-10-30 09:19:36 +0000306 Sources := $(notdir $(wildcard $(BUILD_SRC_DIR)/*.cpp \
307 $(BUILD_SRC_DIR)/*.cc $(BUILD_SRC_DIR)/*.c $(BUILD_SRC_DIR)/*.y \
308 $(BUILD_SRC_DIR)/*.l))
309else
310 Sources := $(SOURCES)
Reid Spencerf206bd72004-10-22 21:01:56 +0000311endif
312
313ifdef BUILT_SOURCES
Reid Spencerf88808a2004-10-30 09:19:36 +0000314Sources += $(filter %.cpp %.c %.cc %.y %.l,$(BUILT_SOURCES))
Vikram S. Adve53738842002-10-14 16:40:04 +0000315endif
Vikram S. Advefe346892001-07-15 13:16:47 +0000316
Reid Spencer81cd0492004-10-23 20:04:14 +0000317#----------------------------------------------------------
318# Types of objects that can be built from sources
319#----------------------------------------------------------
Reid Spencerf88808a2004-10-30 09:19:36 +0000320BaseNameSources := $(sort $(basename $(Sources)))
321ObjectsO := $(BaseNameSources:%=$(ObjDir)/%.o)
322ObjectsLO := $(BaseNameSources:%=$(ObjDir)/%.lo)
323ObjectsBC := $(BaseNameSources:%=$(ObjDir)/%.bc)
Reid Spencer81cd0492004-10-23 20:04:14 +0000324
325###############################################################################
326# DIRECTORIES: Handle recursive descent of directory structure
327###############################################################################
John Criswell3601f372003-07-31 20:58:51 +0000328
Chris Lattner2f7c9632001-06-06 20:29:01 +0000329#---------------------------------------------------------
Reid Spencer9c7bfc92004-10-28 09:15:28 +0000330# Provide rules to make install dirs. This must be early
331# in the file so they get built before dependencies
332#---------------------------------------------------------
333
334$(bindir):
Reid Spencerf88808a2004-10-30 09:19:36 +0000335 $(Verb) $(MKDIR) $(bindir)
Chris Lattner615e7fb2004-11-01 06:14:59 +0000336
Reid Spencer9c7bfc92004-10-28 09:15:28 +0000337$(libdir):
Reid Spencerf88808a2004-10-30 09:19:36 +0000338 $(Verb) $(MKDIR) $(libdir)
Reid Spencer9c7bfc92004-10-28 09:15:28 +0000339
340$(bytecode_libdir):
Reid Spencerf88808a2004-10-30 09:19:36 +0000341 $(Verb) $(MKDIR) $(bytecode_libdir)
Reid Spencer9c7bfc92004-10-28 09:15:28 +0000342
343$(sysconfdir):
Reid Spencerf88808a2004-10-30 09:19:36 +0000344 $(Verb) $(MKDIR) $(sysconfdir)
Reid Spencer9c7bfc92004-10-28 09:15:28 +0000345
Reid Spencerf88808a2004-10-30 09:19:36 +0000346# To create other directories, as needed, and timestamp their creation
347%/.dir:
348 $(Verb) $(MKDIR) $* > /dev/null
Reid Spencerfc66af42004-11-29 05:00:33 +0000349 $(Verb) $(DATE) > $@
Reid Spencerf88808a2004-10-30 09:19:36 +0000350
Reid Spencer7e9e0b02004-11-18 10:03:46 +0000351.PRECIOUS: $(ObjDir)/.dir $(LibDir)/.dir $(ToolDir)/.dir $(ExmplDir)/.dir
352.PRECIOUS: $(LLVMLibDir)/.dir $(LLVMToolDir)/.dir $(LLVMExmplDir)/.dir
Reid Spencer9c7bfc92004-10-28 09:15:28 +0000353
354#---------------------------------------------------------
Reid Spencer81cd0492004-10-23 20:04:14 +0000355# Handle the DIRS options for sequential construction
Chris Lattner2f7c9632001-06-06 20:29:01 +0000356#---------------------------------------------------------
357
Reid Spencerf88808a2004-10-30 09:19:36 +0000358SubDirs :=
Anand Shukla8c2a0ee2002-09-18 04:29:30 +0000359ifdef DIRS
Reid Spencerf88808a2004-10-30 09:19:36 +0000360SubDirs += $(DIRS)
361$(RecursiveTargets)::
362 $(Verb) for dir in $(DIRS); do \
Reid Spencerf206bd72004-10-22 21:01:56 +0000363 if [ ! -f $$dir/Makefile ]; then \
364 $(MKDIR) $$dir; \
365 cp $(BUILD_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
366 fi; \
Reid Spencer100080c2004-10-25 08:27:37 +0000367 ($(MAKE) -C $$dir $@ ) || exit 1; \
Chris Lattner539a23c2002-09-17 23:35:02 +0000368 done
Anand Shukla8c2a0ee2002-09-18 04:29:30 +0000369endif
Chris Lattnerf3dd5f52002-09-18 03:22:27 +0000370
Reid Spencer81cd0492004-10-23 20:04:14 +0000371#---------------------------------------------------------
372# Handle the EXPERIMENTAL_DIRS options ensuring success
373# after each directory is built.
374#---------------------------------------------------------
375ifdef EXPERIMENTAL_DIRS
Reid Spencerf88808a2004-10-30 09:19:36 +0000376$(RecursiveTargets)::
377 $(Verb) for dir in $(EXPERIMENTAL_DIRS); do \
Reid Spencer81cd0492004-10-23 20:04:14 +0000378 if [ ! -f $$dir/Makefile ]; then \
379 $(MKDIR) $$dir; \
380 cp $(BUILD_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
381 fi; \
Reid Spencer100080c2004-10-25 08:27:37 +0000382 ($(MAKE) -C $$dir $@ ) || exit 0; \
Reid Spencer81cd0492004-10-23 20:04:14 +0000383 done
384endif
Chris Lattnerf3dd5f52002-09-18 03:22:27 +0000385
Reid Spencer81cd0492004-10-23 20:04:14 +0000386#---------------------------------------------------------
387# Handle the PARALLEL_DIRS options for parallel construction
388#---------------------------------------------------------
389ifdef PARALLEL_DIRS
390
Reid Spencerf88808a2004-10-30 09:19:36 +0000391SubDirs += $(PARALLEL_DIRS)
392
Reid Spencerd4bd3752004-12-03 20:08:48 +0000393# Unfortunately, this list must be maintained if new recursive targets are added
Reid Spencerf88808a2004-10-30 09:19:36 +0000394all :: $(addsuffix /.makeall ,$(PARALLEL_DIRS))
395clean :: $(addsuffix /.makeclean ,$(PARALLEL_DIRS))
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000396clean-all:: $(addsuffix /.makeclean-all,$(PARALLEL_DIRS))
Reid Spencerf88808a2004-10-30 09:19:36 +0000397check :: $(addsuffix /.makecheck ,$(PARALLEL_DIRS))
398install :: $(addsuffix /.makeinstall ,$(PARALLEL_DIRS))
Reid Spencer81cd0492004-10-23 20:04:14 +0000399uninstall:: $(addsuffix /.makeuninstall,$(PARALLEL_DIRS))
Reid Spencerd4bd3752004-12-03 20:08:48 +0000400install-bytecode :: $(addsuffix /.makeinstall-bytecode,$(PARALLEL_DIRS))
Reid Spencer81cd0492004-10-23 20:04:14 +0000401
Reid Spencerf88808a2004-10-30 09:19:36 +0000402Parallel_Targets := $(foreach T,$(RecursiveTargets),%/.make$(T))
Reid Spencer81cd0492004-10-23 20:04:14 +0000403
404$(Parallel_Targets) :
Reid Spencerf88808a2004-10-30 09:19:36 +0000405 $(Verb) if [ ! -f $(@D)/Makefile ]; then \
Reid Spencerf206bd72004-10-22 21:01:56 +0000406 $(MKDIR) $(@D); \
407 cp $(BUILD_SRC_DIR)/$(@D)/Makefile $(@D)/Makefile; \
John Criswell6df35dd2003-11-25 19:32:22 +0000408 fi; \
Reid Spencer100080c2004-10-25 08:27:37 +0000409 $(MAKE) -C $(@D) $(subst $(@D)/.make,,$@)
Chris Lattner2f7c9632001-06-06 20:29:01 +0000410endif
411
Reid Spencer81cd0492004-10-23 20:04:14 +0000412#---------------------------------------------------------
413# Handle the OPTIONAL_DIRS options for directores that may
414# or may not exist.
415#---------------------------------------------------------
John Criswell8224df92003-06-27 16:58:44 +0000416ifdef OPTIONAL_DIRS
Reid Spencer100080c2004-10-25 08:27:37 +0000417
Reid Spencerf88808a2004-10-30 09:19:36 +0000418SubDirs += $(OPTIONAL_DIRS)
Reid Spencer100080c2004-10-25 08:27:37 +0000419
Reid Spencerf88808a2004-10-30 09:19:36 +0000420$(RecursiveTargets)::
421 $(Verb) for dir in $(OPTIONAL_DIRS); do \
Reid Spencerf206bd72004-10-22 21:01:56 +0000422 if [ -d $(BUILD_SRC_DIR)/$$dir ]; then\
423 if [ ! -f $$dir/Makefile ]; then \
424 $(MKDIR) $$dir; \
425 cp $(BUILD_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
426 fi; \
Reid Spencer100080c2004-10-25 08:27:37 +0000427 ($(MAKE) -C$$dir $@ ) || exit 1; \
Reid Spencerf206bd72004-10-22 21:01:56 +0000428 fi \
John Criswell8224df92003-06-27 16:58:44 +0000429 done
430endif
431
Reid Spencercc51e7b2004-08-20 09:20:05 +0000432#---------------------------------------------------------
433# Handle the CONFIG_FILES options
434#---------------------------------------------------------
435ifdef CONFIG_FILES
Reid Spencercc51e7b2004-08-20 09:20:05 +0000436
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000437install-local:: $(sysconfdir) $(CONFIG_FILES)
Reid Spencerf88808a2004-10-30 09:19:36 +0000438 $(Echo) Installing Configuration Files To $(sysconfdir)
439 $(Verb)for file in $(CONFIG_FILES); do \
Reid Spencer39d6a612004-11-23 05:59:53 +0000440 if test -f $(BUILD_OBJ_DIR)/$${file} ; then \
441 $(INSTALL) $(BUILD_OBJ_DIR)/$${file} $(sysconfdir) ; \
442 elif test -f $(BUILD_SRC_DIR)/$${file} ; then \
443 $(INSTALL) $(BUILD_SRC_DIR)/$${file} $(sysconfdir) ; \
444 else \
445 $(ECHO) Error: cannot find config file $${file}. ; \
446 fi \
Reid Spencercc51e7b2004-08-20 09:20:05 +0000447 done
Reid Spencer81cd0492004-10-23 20:04:14 +0000448
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000449uninstall-local::
Reid Spencerf88808a2004-10-30 09:19:36 +0000450 $(Echo) Uninstalling Configuration Files From $(sysconfdir)
451 $(Verb)for file in $(CONFIG_FILES); do \
Reid Spencer100080c2004-10-25 08:27:37 +0000452 $(RM) -f $(sysconfdir)/$${file} ; \
Reid Spencer12a3a052004-10-24 07:53:21 +0000453 done
454
Reid Spencercc51e7b2004-08-20 09:20:05 +0000455endif
456
Reid Spencer81cd0492004-10-23 20:04:14 +0000457###############################################################################
458# Library Build Rules: Four ways to build a library
459###############################################################################
Chris Lattner2f7c9632001-06-06 20:29:01 +0000460
Brian Gaekeecc92bf2004-01-22 22:53:48 +0000461
Reid Spencer81cd0492004-10-23 20:04:14 +0000462# if we're building a library ...
Chris Lattner2f7c9632001-06-06 20:29:01 +0000463ifdef LIBRARYNAME
Vikram S. Advefe346892001-07-15 13:16:47 +0000464
Chris Lattner0100eab2002-09-16 22:36:42 +0000465# Make sure there isn't any extranous whitespace on the LIBRARYNAME option
Chris Lattnere6e193ca2002-09-16 22:34:56 +0000466LIBRARYNAME := $(strip $(LIBRARYNAME))
Reid Spencerf88808a2004-10-30 09:19:36 +0000467LibName.LA := $(LibDir)/lib$(LIBRARYNAME).la
468LibName.A := $(LibDir)/lib$(LIBRARYNAME).a
469LibName.O := $(LibDir)/$(LIBRARYNAME).o
Reid Spencer32f7e422004-12-02 09:28:21 +0000470LibName.BCA:= $(LibDir)/lib$(LIBRARYNAME).bca
Chris Lattnere6e193ca2002-09-16 22:34:56 +0000471
Reid Spencer81cd0492004-10-23 20:04:14 +0000472#---------------------------------------------------------
473# Shared Library Targets:
474# If the user asked for a shared library to be built
475# with the SHARED_LIBRARY variable, then we provide
476# targets for building them.
477#---------------------------------------------------------
Reid Spencerf206bd72004-10-22 21:01:56 +0000478ifdef SHARED_LIBRARY
479
Reid Spencerf88808a2004-10-30 09:19:36 +0000480all-local:: $(LibName.LA)
Reid Spencerf206bd72004-10-22 21:01:56 +0000481
Reid Spencerf88808a2004-10-30 09:19:36 +0000482$(LibName.LA): $(BUILT_SOURCES) $(ObjectsLO) $(LibDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000483 $(Echo) Linking $(BuildMode) Shared Library $(LIBRARYNAME)$(SHLIBEXT)
Reid Spencerf88808a2004-10-30 09:19:36 +0000484 $(Verb) $(Link) -o $@ $(ObjectsLO)
485 $(Verb) $(LTInstall) $@ $(LibDir)
Reid Spencer81cd0492004-10-23 20:04:14 +0000486
487clean-local::
Reid Spencerf88808a2004-10-30 09:19:36 +0000488ifneq ($(strip $(LibName.LA)),)
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000489 -$(Verb) $(RM) -f $(LibName.LA)
Reid Spencer12a3a052004-10-24 07:53:21 +0000490endif
Reid Spencerf206bd72004-10-22 21:01:56 +0000491
Reid Spencer12a3a052004-10-24 07:53:21 +0000492DestSharedLib = $(libdir)/lib$(LIBRARYNAME)$(SHLIBEXT)
Reid Spencerf206bd72004-10-22 21:01:56 +0000493
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000494install-local:: $(DestSharedLib)
Reid Spencer12a3a052004-10-24 07:53:21 +0000495
Reid Spencerf88808a2004-10-30 09:19:36 +0000496$(DestSharedLib): $(libdir) $(LibName.LA)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000497 $(Echo) Installing $(BuildMode) Shared Library $(DestSharedLib)
Reid Spencerf88808a2004-10-30 09:19:36 +0000498 $(Verb) $(LTInstall) $(LibName.LA) $(DestSharedLib)
499 $(Verb) $(LIBTOOL) --finish $(libdir)
Reid Spencer12a3a052004-10-24 07:53:21 +0000500
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000501uninstall-local::
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000502 $(Echo) Uninstalling $(BuildMode) Shared Library $(DestSharedLib)
Reid Spenceraee67e62004-11-12 02:27:36 +0000503 -$(Verb) $(RM) -f $(libdir)/lib$(LIBRARYNAME).*
Reid Spencer12a3a052004-10-24 07:53:21 +0000504
Reid Spencerf206bd72004-10-22 21:01:56 +0000505endif
506
Reid Spencer81cd0492004-10-23 20:04:14 +0000507#---------------------------------------------------------
508# Bytecode Library Targets:
509# If the user asked for a bytecode library to be built
510# with the BYTECODE_LIBRARY variable, then we provide
511# targets for building them.
512#---------------------------------------------------------
Reid Spencerf206bd72004-10-22 21:01:56 +0000513ifdef BYTECODE_LIBRARY
514
Reid Spencer2b1b83a2004-12-03 06:04:35 +0000515# make the C and C++ compilers strip debug info out of bytecode libraries.
516BCCompile.C += -Wa,-strip-debug
517BCCompile.CXX += -Wa,-strip-debug
518
Reid Spencer32f7e422004-12-02 09:28:21 +0000519all-local:: $(LibName.BCA)
520
521ifdef EXPORTED_SYMBOL_FILE
522BCLinkLib = $(LLVMGCC) -shared -nostdlib -Xlinker \
523 -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
524
525$(LibName.BCA): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(GCCLD)
526 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@) \
527 "(internalize)"
Chris Lattnere3d98f12004-12-02 21:23:43 +0000528 $(Verb) $(BCLinkLib) -o $(ObjDir)/$(LIBRARYNAME).o $(ObjectsBC)
Reid Spencer32f7e422004-12-02 09:28:21 +0000529 $(Verb) $(LArchive) $@ $(ObjDir)/$(LIBRARYNAME).o
Reid Spencerf206bd72004-10-22 21:01:56 +0000530else
Reid Spencer32f7e422004-12-02 09:28:21 +0000531$(LibName.BCA): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(GCCLD)
532 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@)
533 $(Verb) $(LArchive) $@ $(ObjectsBC)
534
Reid Spencerf206bd72004-10-22 21:01:56 +0000535endif
536
Reid Spencer81cd0492004-10-23 20:04:14 +0000537clean-local::
Reid Spencer32f7e422004-12-02 09:28:21 +0000538ifneq ($(strip $(LibName.BCA)),)
539 -$(Verb) $(RM) -f $(LibName.BCA)
Reid Spencer12a3a052004-10-24 07:53:21 +0000540endif
Reid Spencerf206bd72004-10-22 21:01:56 +0000541
Reid Spencer32f7e422004-12-02 09:28:21 +0000542DestBytecodeLib = $(bytecode_libdir)/lib$(LIBRARYNAME).a
543
Reid Spencerd4bd3752004-12-03 20:08:48 +0000544install-bytecode-local:: $(DestBytecodeLib)
Reid Spencer8da1b5d2004-10-26 07:09:33 +0000545
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000546install-local:: $(DestBytecodeLib)
Chris Lattner0c4f4fe2003-08-15 02:18:35 +0000547
Reid Spencer32f7e422004-12-02 09:28:21 +0000548$(DestBytecodeLib): $(bytecode_libdir) $(LibName.BCA)
549 $(Echo) Installing $(BuildMode) Bytecode Archive $(DestBytecodeLib)
550 $(Verb) $(INSTALL) $(LibName.BCA) $@
Reid Spencer12a3a052004-10-24 07:53:21 +0000551
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000552uninstall-local::
Reid Spencer32f7e422004-12-02 09:28:21 +0000553 $(Echo) Uninstalling $(BuildMode) Bytecode Archive $(DestBytecodeLib)
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000554 -$(Verb) $(RM) -f $(DestBytecodeLib)
Reid Spencerf206bd72004-10-22 21:01:56 +0000555
556endif
Vikram S. Adve15bd3ad2002-08-02 18:34:12 +0000557
Reid Spencerf88808a2004-10-30 09:19:36 +0000558#---------------------------------------------------------
559# ReLinked Library Targets:
560# If the user didn't explicitly forbid building a
561# relinked then we provide targets for building them.
562#---------------------------------------------------------
Chris Lattner76d98ba2002-07-23 17:56:16 +0000563ifndef DONT_BUILD_RELINKED
Reid Spencerf206bd72004-10-22 21:01:56 +0000564
Reid Spencerf88808a2004-10-30 09:19:36 +0000565all-local:: $(LibName.O)
566
567$(LibName.O): $(BUILT_SOURCES) $(ObjectsO) $(LibDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000568 $(Echo) Linking $(BuildMode) Object Library $(notdir $@)
Reid Spencerf88808a2004-10-30 09:19:36 +0000569 $(Verb) $(Relink) -o $@ $(ObjectsO)
Reid Spencerf206bd72004-10-22 21:01:56 +0000570
Reid Spencer81cd0492004-10-23 20:04:14 +0000571clean-local::
Reid Spencerf88808a2004-10-30 09:19:36 +0000572ifneq ($(strip $(LibName.O)),)
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000573 -$(Verb) $(RM) -f $(LibName.O)
Reid Spencer12a3a052004-10-24 07:53:21 +0000574endif
575
576DestRelinkedLib = $(libdir)/$(LIBRARYNAME).o
577
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000578install-local:: $(DestRelinkedLib)
Reid Spencer12a3a052004-10-24 07:53:21 +0000579
Reid Spencerf88808a2004-10-30 09:19:36 +0000580$(DestRelinkedLib): $(libdir) $(LibName.O)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000581 $(Echo) Installing $(BuildMode) Object Library $(DestRelinkedLib)
Reid Spencerf88808a2004-10-30 09:19:36 +0000582 $(Verb) $(LTInstall) $(LibName.O) $(DestRelinkedLib)
Reid Spencer12a3a052004-10-24 07:53:21 +0000583
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000584uninstall-local::
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000585 $(Echo) Uninstalling $(BuildMode) Object Library $(DestRelinkedLib)
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000586 -$(Verb) $(RM) -f $(DestRelinkedLib)
Reid Spencerf206bd72004-10-22 21:01:56 +0000587
Chris Lattner76d98ba2002-07-23 17:56:16 +0000588endif
Chris Lattnerc2bd7cf2003-03-14 20:25:22 +0000589
Reid Spencerf88808a2004-10-30 09:19:36 +0000590#---------------------------------------------------------
591# Archive Library Targets:
592# If the user wanted a regular archive library built,
593# then we provide targets for building them.
594#---------------------------------------------------------
Chris Lattner76d98ba2002-07-23 17:56:16 +0000595ifdef BUILD_ARCHIVE
Chris Lattner76d98ba2002-07-23 17:56:16 +0000596
Reid Spencerf88808a2004-10-30 09:19:36 +0000597all-local:: $(LibName.A)
598
599$(LibName.A): $(BUILT_SOURCES) $(ObjectsO) $(LibDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000600 $(Echo) Building $(BuildMode) Archive Library $(notdir $@)
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000601 -$(Verb) $(RM) -f $@
Reid Spencerf88808a2004-10-30 09:19:36 +0000602 $(Verb) $(Archive) $@ $(ObjectsO)
603 $(Verb) $(Ranlib) $@
Vikram S. Adve20aa62f2002-09-20 14:03:13 +0000604
Reid Spencer81cd0492004-10-23 20:04:14 +0000605clean-local::
Reid Spencerf88808a2004-10-30 09:19:36 +0000606ifneq ($(strip $(LibName.A)),)
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000607 -$(Verb) $(RM) -f $(LibName.A)
Chris Lattner2f7c9632001-06-06 20:29:01 +0000608endif
609
Reid Spencer12a3a052004-10-24 07:53:21 +0000610DestArchiveLib := $(libdir)/lib$(LIBRARYNAME).a
611
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000612install-local:: $(DestArchiveLib)
Reid Spencer12a3a052004-10-24 07:53:21 +0000613
Reid Spencerf88808a2004-10-30 09:19:36 +0000614$(DestArchiveLib): $(libdir) $(LibName.A)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000615 $(Echo) Installing $(BuildMode) Archive Library $(DestArchiveLib)
Reid Spencerf88808a2004-10-30 09:19:36 +0000616 $(Verb) $(MKDIR) $(libdir)
617 $(Verb) $(LTInstall) $(LibName.A) $(DestArchiveLib)
Reid Spencer12a3a052004-10-24 07:53:21 +0000618
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000619uninstall-local::
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000620 $(Echo) Uninstalling $(BuildMode) Archive Library $(DestArchiveLib)
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000621 -$(Verb) $(RM) -f $(DestArchiveLib)
Reid Spencer12a3a052004-10-24 07:53:21 +0000622
623endif
624
625# endif LIBRARYNAME
Reid Spencerf206bd72004-10-22 21:01:56 +0000626endif
627
Reid Spencerdcba7782004-10-24 08:21:04 +0000628###############################################################################
629# Tool Build Rules: Build executable tool based on TOOLNAME option
630###############################################################################
631
Chris Lattner07c7c192001-09-07 22:57:58 +0000632ifdef TOOLNAME
633
Reid Spencerf88808a2004-10-30 09:19:36 +0000634#---------------------------------------------------------
Reid Spenceraf4495a2004-11-29 07:17:07 +0000635# Handle the special "JIT" value for LLVM_LIBS which is a
636# shorthand for a bunch of libraries that get the correct
637# JIT support for a tool that runs JIT.
638#---------------------------------------------------------
639ifeq ($(LLVMLIBS),JIT)
640
641# Make sure we can get our own symbols in the tool
642Link += -dlopen self
643
644# Generic JIT libraries
645JIT_LIBS := LLVMInterpreter LLVMJIT LLVMCodeGen LLVMExecutionEngine
646
647# You can enable the X86 JIT on a non-X86 host by setting the flag
648# ENABLE_X86_JIT on the make command line. If not, it will still be
649# enabled automagically on an X86 host.
650ifeq ($(ARCH), x86)
651 ENABLE_X86_JIT = 1
652endif
653
654# What the X86 JIT requires
655ifdef ENABLE_X86_JIT
656 JIT_LIBS += LLVMX86 LLVMSelectionDAG
657endif
658
659# You can enable the SparcV9 JIT on a non-SparcV9 host by setting the flag
660# ENABLE_SPARCV9_JIT on the make command line. If not, it will still be
661# enabled automagically on an SparcV9 host.
662ifeq ($(ARCH), Sparc)
663 ENABLE_SPARCV9_JIT = 1
664endif
665
666# What the Sparc JIT requires
667ifdef ENABLE_SPARCV9_JIT
668 JIT_LIBS += LLVMSparcV9 LLVMSparcV9ModuloSched LLVMSparcV9InstrSched \
669 LLVMSparcV9LiveVar LLVMInstrumentation.a LLVMProfilePaths \
670 LLVMBCWriter LLVMTransforms.a LLVMipo.a LLVMipa.a \
671 LLVMDataStructure.a LLVMSparcV9RegAlloc
672endif
673
674# You can enable the PowerPC JIT on a non-PowerPC host by setting the flag
675# ENABLE_PPC_JIT on the make command line. If not, it will still be
676# enabled automagically on an PowerPC host.
677ifeq ($(ARCH), PowerPC)
678 ENABLE_PPC_JIT = 1
679endif
680
681# What the PowerPC JIT requires
682ifdef ENABLE_PPC_JIT
683 JIT_LIBS += LLVMPowerPC
684endif
685
686LLVMLIBS := $(JIT_LIBS) LLVMScalarOpts LLVMAnalysis.a LLVMTransformUtils.a \
687 LLVMBCReader LLVMCore LLVMSupport.a LLVMTarget.a LLVMbzip2 \
688 LLVMSystem.a $(PLATFORMLIBDL)
689endif
690
691#---------------------------------------------------------
Reid Spencerf88808a2004-10-30 09:19:36 +0000692# Set up variables for building a tool.
693#---------------------------------------------------------
Reid Spencer7e9e0b02004-11-18 10:03:46 +0000694ifdef EXAMPLE_TOOL
695ToolBuildPath := $(ExmplDir)/$(TOOLNAME)$(EXEEXT)
696else
Reid Spencerf88808a2004-10-30 09:19:36 +0000697ToolBuildPath := $(ToolDir)/$(TOOLNAME)$(EXEEXT)
Reid Spencer7e9e0b02004-11-18 10:03:46 +0000698endif
Reid Spencerf88808a2004-10-30 09:19:36 +0000699ProjLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS)))
700ProjLibsOptions := $(patsubst %.o, $(LibDir)/%.o, $(ProjLibsOptions))
701LLVMLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(LLVMLIBS)))
702LLVMLibsOptions := $(patsubst %.o, $(LLVMLibDir)/%.o, $(LLVMLibsOptions))
703ProjUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(USEDLIBS)))
704LLVMUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(LLVMLIBS)))
705ProjLibsPaths := $(addprefix $(LibDir)/,$(ProjUsedLibs))
706LLVMLibsPaths := $(addprefix $(LLVMLibDir)/,$(LLVMUsedLibs))
Chris Lattner07c7c192001-09-07 22:57:58 +0000707
Reid Spencerf88808a2004-10-30 09:19:36 +0000708#---------------------------------------------------------
Reid Spencerf88808a2004-10-30 09:19:36 +0000709# Tell make that we need to rebuild subdirectories before
710# we can link the tool. This affects things like LLI which
711# has library subdirectories.
712#---------------------------------------------------------
713$(ToolBuildPath): $(addsuffix /.makeall, $(PARALLEL_DIRS))
Chris Lattner3ecb7762003-01-22 16:13:31 +0000714
Reid Spencerf88808a2004-10-30 09:19:36 +0000715#---------------------------------------------------------
716# Provide targets for building the tools
717#---------------------------------------------------------
718all-local:: $(ToolBuildPath)
John Criswell8224df92003-06-27 16:58:44 +0000719
Reid Spencer81cd0492004-10-23 20:04:14 +0000720clean-local::
Reid Spencerf88808a2004-10-30 09:19:36 +0000721ifneq ($(strip $(ToolBuildPath)),)
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000722 -$(Verb) $(RM) -f $(ToolBuildPath)
Reid Spencer12a3a052004-10-24 07:53:21 +0000723endif
Chris Lattner07c7c192001-09-07 22:57:58 +0000724
Reid Spencer7e9e0b02004-11-18 10:03:46 +0000725ifdef EXAMPLE_TOOL
726$(ToolBuildPath): $(ExmplDir)/.dir
727else
728$(ToolBuildPath): $(ToolDir)/.dir
729endif
730
731$(ToolBuildPath): $(BUILT_SOURCES) $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000732 $(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg)
Reid Spencerf88808a2004-10-30 09:19:36 +0000733 $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
734 $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000735 $(Echo) ======= Finished Linking $(BuildMode) Executable $(TOOLNAME) $(StripWarnMsg)
Reid Spencer12a3a052004-10-24 07:53:21 +0000736
737DestTool = $(bindir)/$(TOOLNAME)
738
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000739install-local:: $(DestTool)
Reid Spencer8da1b5d2004-10-26 07:09:33 +0000740
Reid Spencerf88808a2004-10-30 09:19:36 +0000741$(DestTool): $(bindir) $(ToolBuildPath)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000742 $(Echo) Installing $(BuildMode) $(DestTool)
Reid Spencerf88808a2004-10-30 09:19:36 +0000743 $(Verb) $(INSTALL) $(ToolBuildPath) $(DestTool)
Reid Spencer12a3a052004-10-24 07:53:21 +0000744
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000745uninstall-local::
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000746 $(Echo) Uninstalling $(BuildMode) $(DestTool)
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000747 -$(Verb) $(RM) -f $(DestTool)
Reid Spencer12a3a052004-10-24 07:53:21 +0000748
Reid Spencerf206bd72004-10-22 21:01:56 +0000749endif
Chris Lattner07c7c192001-09-07 22:57:58 +0000750
Reid Spencerf88808a2004-10-30 09:19:36 +0000751###############################################################################
752# Object Build Rules: Build object files based on sources
753###############################################################################
754
755# Provide rule sets for when dependency generation is enabled
Reid Spencerf206bd72004-10-22 21:01:56 +0000756ifndef DISABLE_AUTO_DEPENDENCIES
Vikram S. Adve20aa62f2002-09-20 14:03:13 +0000757
Reid Spencerf88808a2004-10-30 09:19:36 +0000758#---------------------------------------------------------
759# Create .lo files in the ObjDir directory from the .cpp and .c files...
760#---------------------------------------------------------
Reid Spencer81cd0492004-10-23 20:04:14 +0000761ifdef SHARED_LIBRARY
762
Reid Spencerf88808a2004-10-30 09:19:36 +0000763$(ObjDir)/%.lo $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000764 $(Echo) "Compiling $*.cpp for $(BuildMode) build (PIC)"
Reid Spencerf88808a2004-10-30 09:19:36 +0000765 $(Verb) if $(LTCompile.CXX) -MD -MT $@ -MP -MF $(ObjDir)/$*.LACXXd $< -o $@ ; \
766 then $(MV) -f "$(ObjDir)/$*.LACXXd" "$(ObjDir)/$*.d"; \
767 else $(RM) -f "$(ObjDir)/$*.LACXXd"; exit 1; fi
Reid Spencer81cd0492004-10-23 20:04:14 +0000768
Reid Spencerf88808a2004-10-30 09:19:36 +0000769$(ObjDir)/%.lo $(ObjDir)/%.o: %.c $(ObjDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000770 $(Echo) "Compiling $*.c for $(BuildMode) build (PIC)"
Reid Spencerf88808a2004-10-30 09:19:36 +0000771 $(Verb) if $(LTCompile.C) -MD -MT $@ -MP -MF $(ObjDir)/$*.LACd $< -o $@ ; \
772 then $(MV) -f "$(ObjDir)/$*.LACd" "$(ObjDir)/$*.d"; \
773 else $(RM) -f "$(ObjDir)/$*.LACd"; exit 1; fi
Reid Spencer81cd0492004-10-23 20:04:14 +0000774
Reid Spencerf88808a2004-10-30 09:19:36 +0000775#---------------------------------------------------------
776# Create .o files in the ObjDir directory from the .cpp and .c files...
777#---------------------------------------------------------
Reid Spencer81cd0492004-10-23 20:04:14 +0000778else
Reid Spencerf206bd72004-10-22 21:01:56 +0000779
Reid Spencerf88808a2004-10-30 09:19:36 +0000780$(ObjDir)/%.o: %.cpp $(ObjDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000781 $(Echo) "Compiling $*.cpp for $(BuildMode) build"
Reid Spencerf88808a2004-10-30 09:19:36 +0000782 $(Verb) if $(Compile.CXX) -MD -MT $@ -MP -MF $(ObjDir)/$*.CXXd $< -o $@ ; \
783 then $(MV) -f "$(ObjDir)/$*.CXXd" "$(ObjDir)/$*.d"; \
784 else $(RM) -f "$(ObjDir)/$*.CXXd"; exit 1; fi
Reid Spencerf206bd72004-10-22 21:01:56 +0000785
Reid Spencerf88808a2004-10-30 09:19:36 +0000786$(ObjDir)/%.o: %.c $(ObjDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000787 $(Echo) "Compiling $*.c for $(BuildMode) build"
Reid Spencerf88808a2004-10-30 09:19:36 +0000788 $(Verb) if $(Compile.C) -MD -MT $@ -MP -MF $(ObjDir)/$*.Cd $< -o $@ ; \
789 then $(MV) -f "$(ObjDir)/$*.Cd" "$(ObjDir)/$*.d"; \
790 else $(RM) -f "$(ObjDir)/$*.Cd"; exit 1; fi
Reid Spencer81cd0492004-10-23 20:04:14 +0000791
792endif
Reid Spencerf206bd72004-10-22 21:01:56 +0000793
Reid Spencerf88808a2004-10-30 09:19:36 +0000794#---------------------------------------------------------
795# Create .bc files in the ObjDir directory from .cpp and .c files...
796#---------------------------------------------------------
Chris Lattner0ea40c92004-11-29 19:47:58 +0000797$(ObjDir)/%.bc: %.cpp $(ObjDir)/.dir $(GCCAS)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000798 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
Reid Spencerf88808a2004-10-30 09:19:36 +0000799 $(Verb) if $(BCCompile.CXX) -MD -MT $@ -MP -MF "$(ObjDir)/$*.BCCXXd" $< -o $@ ; \
800 then $(MV) -f "$(ObjDir)/$*.BCCXXd" "$(ObjDir)/$*.d"; \
801 else $(RM) -f "$(ObjDir)/$*.BCCXXd"; exit 1; fi
Reid Spencerf206bd72004-10-22 21:01:56 +0000802
Chris Lattner0ea40c92004-11-29 19:47:58 +0000803$(ObjDir)/%.bc: %.c $(ObjDir)/.dir $(GCCAS)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000804 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
Reid Spencerf88808a2004-10-30 09:19:36 +0000805 $(Verb) if $(BCCompile.C) -MD -MT $@ -MP -MF "$(ObjDir)/$*.BCCd" $< -o $@ ; \
806 then $(MV) -f "$(ObjDir)/$*.BCCd" "$(ObjDir)/$*.d"; \
807 else $(RM) -f "$(ObjDir)/$*.BCCd"; exit 1; fi
Reid Spencerf206bd72004-10-22 21:01:56 +0000808
Reid Spencerf88808a2004-10-30 09:19:36 +0000809# Provide alternate rule sets if dependencies are disabled
Reid Spencerf206bd72004-10-22 21:01:56 +0000810else
811
Reid Spencer81cd0492004-10-23 20:04:14 +0000812ifdef SHARED_LIBRARY
813
Reid Spencerf88808a2004-10-30 09:19:36 +0000814$(ObjDir)/%.lo $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000815 $(Echo) "Compiling $*.cpp for $(BuildMode) build (PIC)"
Reid Spencer81cd0492004-10-23 20:04:14 +0000816 $(LTCompile.CXX) $< -o $@
817
Reid Spencerf88808a2004-10-30 09:19:36 +0000818$(ObjDir)/%.lo $(ObjDir)/%.o: %.c $(ObjDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000819 $(Echo) "Compiling $*.cpp for $(BuildMode) build (PIC)"
Reid Spencer81cd0492004-10-23 20:04:14 +0000820 $(LTCompile.C) $< -o $@
821
822else
Reid Spencerf206bd72004-10-22 21:01:56 +0000823
Reid Spencerf88808a2004-10-30 09:19:36 +0000824$(ObjDir)/%.o: %.cpp $(ObjDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000825 $(Echo) "Compiling $*.cpp for $(BuildMode) build"
Reid Spencer81cd0492004-10-23 20:04:14 +0000826 $(Compile.CXX) $< -o $@
Reid Spencerf206bd72004-10-22 21:01:56 +0000827
Reid Spencerf88808a2004-10-30 09:19:36 +0000828$(ObjDir)/%.o: %.c $(ObjDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000829 $(Echo) "Compiling $*.cpp for $(BuildMode) build"
Reid Spencer81cd0492004-10-23 20:04:14 +0000830 $(Compile.C) $< -o $@
831endif
Reid Spencerf206bd72004-10-22 21:01:56 +0000832
Chris Lattner0ea40c92004-11-29 19:47:58 +0000833$(ObjDir)/%.bc: %.cpp $(ObjDir)/.dir $(GCCAS)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000834 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
Reid Spencer991f66a2004-10-31 18:52:15 +0000835 $(BCCompile.CXX) $< -o $@
Reid Spencerf206bd72004-10-22 21:01:56 +0000836
Chris Lattner0ea40c92004-11-29 19:47:58 +0000837$(ObjDir)/%.bc: %.c $(ObjDir)/.dir $(GCCAS)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000838 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
Reid Spencer991f66a2004-10-31 18:52:15 +0000839 $(BCCompile.C) $< -o $@
Brian Gaeke0f148bc2003-12-10 00:26:28 +0000840
Chris Lattner07c7c192001-09-07 22:57:58 +0000841endif
842
Reid Spencerf88808a2004-10-30 09:19:36 +0000843#---------------------------------------------------------
844# Provide rule to build .bc files from .ll sources,
845# regardless of dependencies
846#---------------------------------------------------------
847$(ObjDir)/%.bc: %.ll $(ObjDir)/.dir $(LLVMAS)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000848 $(Echo) "Compiling $*.ll for $(BuildMode) build"
Reid Spencerf88808a2004-10-30 09:19:36 +0000849 $(Verb) $(LLVMAS) $< -f -o $@
850
851###############################################################################
852# TABLEGEN: Provide rules for running tblgen to produce *.inc files
853###############################################################################
Chris Lattner0c4f4fe2003-08-15 02:18:35 +0000854
Reid Spencerf206bd72004-10-22 21:01:56 +0000855ifdef TARGET
856
Reid Spencerf88808a2004-10-30 09:19:36 +0000857TDFiles := $(strip $(wildcard $(BUILD_SRC_DIR)/*.td) $(LLVM_SRC_ROOT)/lib/Target/Target.td)
858INCFiles := $(filter %.inc,$(BUILT_SOURCES))
Reid Spencerf206bd72004-10-22 21:01:56 +0000859
Reid Spencerf88808a2004-10-30 09:19:36 +0000860$(INCFiles) : $(TBLGEN) $(TDFiles)
Reid Spencerf206bd72004-10-22 21:01:56 +0000861
Reid Spencer94105c72004-10-27 04:34:35 +0000862%GenRegisterNames.inc : %.td
Reid Spencerf88808a2004-10-30 09:19:36 +0000863 $(Echo) "Building $(<F) register names with tblgen"
864 $(Verb) $(TableGen) -gen-register-enums -o $@ $<
Reid Spencerf206bd72004-10-22 21:01:56 +0000865
Reid Spencer94105c72004-10-27 04:34:35 +0000866%GenRegisterInfo.h.inc : %.td
Reid Spencerf88808a2004-10-30 09:19:36 +0000867 $(Echo) "Building $(<F) register information header with tblgen"
868 $(Verb) $(TableGen) -gen-register-desc-header -o $@ $<
Reid Spencerf206bd72004-10-22 21:01:56 +0000869
870%GenRegisterInfo.inc : %.td
Reid Spencerf88808a2004-10-30 09:19:36 +0000871 $(Echo) "Building $(<F) register info implementation with tblgen"
872 $(Verb) $(TableGen) -gen-register-desc -o $@ $<
Reid Spencerf206bd72004-10-22 21:01:56 +0000873
874%GenInstrNames.inc : %.td
Reid Spencerf88808a2004-10-30 09:19:36 +0000875 $(Echo) "Building $(<F) instruction names with tblgen"
876 $(Verb) $(TableGen) -gen-instr-enums -o $@ $<
Reid Spencerf206bd72004-10-22 21:01:56 +0000877
878%GenInstrInfo.inc : %.td
Reid Spencerf88808a2004-10-30 09:19:36 +0000879 $(Echo) "Building $(<F) instruction information with tblgen"
880 $(Verb) $(TableGen) -gen-instr-desc -o $@ $<
Reid Spencerf206bd72004-10-22 21:01:56 +0000881
882%GenAsmWriter.inc : %.td
Reid Spencerf88808a2004-10-30 09:19:36 +0000883 $(Echo) "Building $(<F) assembly writer with tblgen"
884 $(Verb) $(TableGen) -gen-asm-writer -o $@ $<
Reid Spencerf206bd72004-10-22 21:01:56 +0000885
886%GenATTAsmWriter.inc : %.td
Reid Spencerf88808a2004-10-30 09:19:36 +0000887 $(Echo) "Building $(<F) AT&T assembly writer with tblgen"
888 $(Verb) $(TableGen) -gen-asm-writer -o $@ $<
Reid Spencerf206bd72004-10-22 21:01:56 +0000889
890%GenIntelAsmWriter.inc : %.td
Reid Spencerf88808a2004-10-30 09:19:36 +0000891 $(Echo) "Building $(<F) Intel assembly writer with tblgen"
892 $(Verb) $(TableGen) -gen-asm-writer -asmwriternum=1 -o $@ $<
Reid Spencerf206bd72004-10-22 21:01:56 +0000893
894%GenInstrSelector.inc: %.td
Reid Spencerf88808a2004-10-30 09:19:36 +0000895 $(Echo) "Building $(<F) instruction selector with tblgen"
896 $(Verb) $(TableGen) -gen-instr-selector -o $@ $<
Reid Spencerf206bd72004-10-22 21:01:56 +0000897
898%GenCodeEmitter.inc:: %.td
Reid Spencerf88808a2004-10-30 09:19:36 +0000899 $(Echo) "Building $(<F) code emitter with tblgen"
900 $(Verb) $(TableGen) -gen-emitter -o $@ $<
Reid Spencerf206bd72004-10-22 21:01:56 +0000901
Reid Spencer81cd0492004-10-23 20:04:14 +0000902clean-local::
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000903 -$(Verb) $(RM) -f $(INCFiles)
Reid Spencerf206bd72004-10-22 21:01:56 +0000904
905endif
Chris Lattner0c4f4fe2003-08-15 02:18:35 +0000906
Reid Spencerf88808a2004-10-30 09:19:36 +0000907###############################################################################
908# LEX AND YACC: Provide rules for generating sources with lex and yacc
909###############################################################################
Chris Lattnerdb644dd2003-01-16 22:44:19 +0000910
Reid Spencerf88808a2004-10-30 09:19:36 +0000911#---------------------------------------------------------
912# Provide rules for generating a .cpp source file from
913# (f)lex input sources.
914#---------------------------------------------------------
915
Reid Spencer9d0c1e02004-11-02 16:36:03 +0000916LexFiles := $(filter %.l,$(Sources))
Reid Spencerf88808a2004-10-30 09:19:36 +0000917
Reid Spencer9d0c1e02004-11-02 16:36:03 +0000918ifneq ($(LexFiles),)
919
920LexOutput := $(strip $(patsubst %.l,%.cpp,$(LexFiles)))
Reid Spencerf88808a2004-10-30 09:19:36 +0000921
922.PRECIOUS: $(LexOutput)
923
924# Note the extra sed filtering here, used to cut down on the warnings emited
925# by GCC. The last line is a gross hack to work around flex aparently not
926# being able to resize the buffer on a large token input. Currently, for
927# uninitialized string buffers in LLVM we can generate very long tokens, so
928# this is a hack around it.
Chris Lattner92fc9b02003-08-15 20:00:47 +0000929# FIXME. (f.e. char Buffer[10000] )
Chris Lattner2f7c9632001-06-06 20:29:01 +0000930%.cpp: %.l
Reid Spencerf88808a2004-10-30 09:19:36 +0000931 $(Echo) Flexing $<
932 $(Verb) $(FLEX) -t $< | \
Reid Spencerf206bd72004-10-22 21:01:56 +0000933 $(SED) 's/void yyunput/inline void yyunput/' | \
934 $(SED) 's/void \*yy_flex_realloc/inline void *yy_flex_realloc/' | \
935 $(SED) 's/#define YY_BUF_SIZE 16384/#define YY_BUF_SIZE (16384*64)/' \
Reid Spencerb7f710a2004-10-28 00:41:43 +0000936 > $@
Chris Lattner2f7c9632001-06-06 20:29:01 +0000937
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000938clean-local::
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000939 -$(Verb) $(RM) -f $(LexOutput)
Reid Spencer9d0c1e02004-11-02 16:36:03 +0000940 $(Verb) $(RM) -f $(LexOutput)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000941
Reid Spencerf88808a2004-10-30 09:19:36 +0000942endif
943
944#---------------------------------------------------------
945# Provide rules for generating a .cpp and .h source files
946# from yacc (bison) input sources.
947#---------------------------------------------------------
948
Reid Spencer9d0c1e02004-11-02 16:36:03 +0000949YaccFiles := $(filter %.y,$(Sources))
950ifneq ($(YaccFiles),)
951YaccOutput := $(addprefix $(patsubst %.y,%,$(YaccFiles)),.h .cpp .output)
Reid Spencerf88808a2004-10-30 09:19:36 +0000952
953.PRECIOUS: $(YaccOutput)
954
955# Cancel built-in rules for yacc
956%.c: %.y
957%.cpp: %.y
958%.h: %.y
959
Chris Lattner2f7c9632001-06-06 20:29:01 +0000960# Rule for building the bison parsers...
Chris Lattner2f7c9632001-06-06 20:29:01 +0000961%.cpp %.h : %.y
Reid Spencerf88808a2004-10-30 09:19:36 +0000962 $(Echo) "Bisoning $*.y"
963 $(Verb) $(BISON) -v -d -p $(<F:%Parser.y=%) -o $*.tab.c $<
964 $(Verb) $(MV) -f $*.tab.c $*.cpp
965 $(Verb) $(MV) -f $*.tab.h $*.h
Chris Lattner2f7c9632001-06-06 20:29:01 +0000966
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000967clean-local::
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000968 -$(Verb) $(RM) -f $(YaccOutput)
Reid Spencer9d0c1e02004-11-02 16:36:03 +0000969 $(Verb) $(RM) -f $(YaccOutput)
Reid Spencerf88808a2004-10-30 09:19:36 +0000970endif
Chris Lattner2f7c9632001-06-06 20:29:01 +0000971
Reid Spencerf88808a2004-10-30 09:19:36 +0000972###############################################################################
973# OTHER RULES: Other rules needed
974###############################################################################
Reid Spencerf206bd72004-10-22 21:01:56 +0000975
Chris Lattner23d47392003-01-16 21:06:18 +0000976# To create postscript files from dot files...
John Criswell4ffb8442003-10-02 19:02:02 +0000977ifneq ($(DOT),false)
Chris Lattner23d47392003-01-16 21:06:18 +0000978%.ps: %.dot
Reid Spencerf206bd72004-10-22 21:01:56 +0000979 $(DOT) -Tps < $< > $@
John Criswell3ef61af2003-06-30 21:59:07 +0000980else
981%.ps: %.dot
Reid Spencerf88808a2004-10-30 09:19:36 +0000982 $(Echo) "Cannot build $@: The program dot is not installed"
John Criswell3ef61af2003-06-30 21:59:07 +0000983endif
Chris Lattner23d47392003-01-16 21:06:18 +0000984
John Criswell0a6e6aa2003-09-06 14:44:17 +0000985# This rules ensures that header files that are removed still have a rule for
986# which they can be "generated." This allows make to ignore them and
987# reproduce the dependency lists.
John Criswella8391af2003-09-18 18:37:08 +0000988%.h:: ;
John Criswell0a6e6aa2003-09-06 14:44:17 +0000989
Reid Spencerf88808a2004-10-30 09:19:36 +0000990# Define clean-local to clean the current directory. Note that this uses a
991# very conservative approach ensuring that empty variables do not cause
992# errors or disastrous removal.
Reid Spencer81cd0492004-10-23 20:04:14 +0000993clean-local::
Reid Spencerf88808a2004-10-30 09:19:36 +0000994ifneq ($(strip $(ObjDir)),)
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000995 -$(Verb) $(RM) -rf $(ObjDir)
Reid Spencer12a3a052004-10-24 07:53:21 +0000996endif
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000997 -$(Verb) $(RM) -f core core.[0-9][0-9]* *.o *.d *~ *.flc
Brian Gaeke8625f682004-01-21 19:53:11 +0000998ifneq ($(strip $(SHLIBEXT)),) # Extra paranoia - make real sure SHLIBEXT is set
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000999 -$(Verb) $(RM) -f *$(SHLIBEXT)
Brian Gaeke8625f682004-01-21 19:53:11 +00001000endif
John Criswell3ef61af2003-06-30 21:59:07 +00001001
Reid Spencer9d0c1e02004-11-02 16:36:03 +00001002clean-all-local::
Reid Spencer651dd3ad2004-11-02 16:56:15 +00001003 -$(Verb) $(RM) -rf Debug Release Profile
Reid Spencer9d0c1e02004-11-02 16:36:03 +00001004
Reid Spencerf88808a2004-10-30 09:19:36 +00001005# Build tags database for Emacs/Xemacs:
Reid Spenceraee67e62004-11-12 02:27:36 +00001006tags:: TAGS CTAGS
1007
Reid Spencerf88808a2004-10-30 09:19:36 +00001008TAGS:
Reid Spenceraee67e62004-11-12 02:27:36 +00001009 find $(BUILD_SRC_ROOT)/include $(BUILD_SRC_ROOT)/lib \
1010 $(BUILD_SRC_ROOT)/tools $(BUILD_SRC_ROOT)/examples \
1011 $(BUILD_OBJ_ROOT)/include $(BUILD_OBJ_ROOT)/lib \
1012 $(BUILD_OBJ_ROOT)/tools $(BUILD_OBJ_ROOT)/examples \
1013 -name '*.cpp' -o -name '*.h' | \
Reid Spencerf88808a2004-10-30 09:19:36 +00001014 $(ETAGS) $(ETAGSFLAGS) -
1015
Reid Spenceraee67e62004-11-12 02:27:36 +00001016CTAGS:
1017 find $(BUILD_SRC_ROOT)/include $(BUILD_SRC_ROOT)/lib \
1018 $(BUILD_SRC_ROOT)/tools $(BUILD_SRC_ROOT)/examples \
1019 $(BUILD_OBJ_ROOT)/include $(BUILD_OBJ_ROOT)/lib \
1020 $(BUILD_OBJ_ROOT)/tools $(BUILD_OBJ_ROOT)/examples \
1021 \( -name '*.cpp' -o -name '*.h' \) -print | \
1022 ctags -ImtT -o $(BUILD_OBJ_ROOT)/CTAGS -L -
1023
1024
Reid Spencer81cd0492004-10-23 20:04:14 +00001025###############################################################################
1026# DEPENDENCIES: Include the dependency files if we should
1027###############################################################################
Chris Lattnere9d7d702003-08-22 14:10:16 +00001028ifndef DISABLE_AUTO_DEPENDENCIES
1029
Reid Spencer81cd0492004-10-23 20:04:14 +00001030# If its not one of the cleaning targets
Reid Spencerf88808a2004-10-30 09:19:36 +00001031ifneq ($strip($(filter-out clean clean-local dist-clean,$(MAKECMDGOALS))),)
Reid Spencerf206bd72004-10-22 21:01:56 +00001032
Reid Spencer81cd0492004-10-23 20:04:14 +00001033# Get the list of dependency files
Reid Spencerf88808a2004-10-30 09:19:36 +00001034DependFiles := $(basename $(filter %.cpp %.c %.cc, $(Sources)))
Reid Spencerb5b92fb2004-11-01 07:50:27 +00001035DependFiles := $(patsubst %,$(BUILD_OBJ_DIR)/$(BuildMode)/%.d,$(DependFiles))
Misha Brukmanb891ffb2003-11-09 21:36:19 +00001036
Reid Spencer81cd0492004-10-23 20:04:14 +00001037-include /dev/null $(DependFiles)
1038
John Criswell48ecca62003-08-12 18:51:51 +00001039endif
Chris Lattner598222b2003-08-18 17:27:40 +00001040
Reid Spencerf88808a2004-10-30 09:19:36 +00001041endif
Reid Spencerf206bd72004-10-22 21:01:56 +00001042
Reid Spencer100080c2004-10-25 08:27:37 +00001043###############################################################################
Reid Spencerf88808a2004-10-30 09:19:36 +00001044# DISTRIBUTION: Handle construction of a distribution tarball
Reid Spencer100080c2004-10-25 08:27:37 +00001045###############################################################################
1046
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001047#------------------------------------------------------------------------
1048# Define distribution related variables
1049#------------------------------------------------------------------------
Reid Spencer100080c2004-10-25 08:27:37 +00001050DistName := $(LLVM_TARBALL_NAME)
1051DistDir := $(BUILD_OBJ_ROOT)/$(DistName)
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001052TopDistDir := $(BUILD_OBJ_ROOT)/$(DistName)
Reid Spencer100080c2004-10-25 08:27:37 +00001053DistTarGZip := $(BUILD_OBJ_ROOT)/$(DistName).tar.gz
1054DistZip := $(BUILD_OBJ_ROOT)/$(DistName).zip
1055DistTarBZ2 := $(BUILD_OBJ_ROOT)/$(DistName).tar.bz2
1056DistAlways := CREDITS.TXT LICENSE.TXT README.txt README AUTHORS COPYING \
1057 ChangeLog INSTALL NEWS Makefile Makefile.common Makefile.rules \
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001058 Makefile.config.in configure autoconf
1059DistOther := $(notdir $(wildcard \
1060 $(BUILD_SRC_DIR)/*.h \
1061 $(BUILD_SRC_DIR)/*.td \
1062 $(BUILD_SRC_DIR)/*.def \
1063 $(BUILD_SRC_DIR)/*.ll \
1064 $(BUILD_SRC_DIR)/*.in))
Reid Spencerf88808a2004-10-30 09:19:36 +00001065DistSubDirs := $(SubDirs)
Reid Spencerfc66af42004-11-29 05:00:33 +00001066DistSources = $(Sources) $(EXTRA_DIST)
1067DistFiles = $(DistAlways) $(DistSources) $(DistOther)
Reid Spencer100080c2004-10-25 08:27:37 +00001068
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001069#------------------------------------------------------------------------
1070# We MUST build distribution with OBJ_DIR != SRC_DIR
1071#------------------------------------------------------------------------
1072ifeq ($(BUILD_SRC_DIR),$(BUILD_OBJ_DIR))
1073dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
Reid Spencerf88808a2004-10-30 09:19:36 +00001074 $(Echo) ERROR: Target $@ only available with OBJ_DIR != SRC_DIR
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001075
1076DistCheckTop :=
1077else
1078
1079DistCheckTop := check
Reid Spencerf88808a2004-10-30 09:19:36 +00001080
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001081#------------------------------------------------------------------------
1082# Prevent catastrophic remove
1083#------------------------------------------------------------------------
1084ifeq ($(LLVM_TARBALL_NAME),)
1085$(error LLVM_TARBALL_NAME is empty. Please rerun configure)
1086endif
1087
1088#------------------------------------------------------------------------
1089# Prevent attempt to run dist targets from anywhere but the top level
1090#------------------------------------------------------------------------
1091ifneq ($(LEVEL),.)
1092
1093dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
Reid Spencerf88808a2004-10-30 09:19:36 +00001094 $(Echo) ERROR: You must run $@ from $(BUILD_OBJ_ROOT)
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001095
1096else
1097
1098#------------------------------------------------------------------------
1099# Provide the top level targets
1100#------------------------------------------------------------------------
1101
Reid Spencerf88808a2004-10-30 09:19:36 +00001102dist-gzip:: $(DistTarGZip)
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001103
1104$(DistTarGZip) : distdir
Reid Spencerf88808a2004-10-30 09:19:36 +00001105 $(Echo) Packing gzipped distribution tar file.
Reid Spencerfc66af42004-11-29 05:00:33 +00001106 $(Verb) cd $(BUILD_OBJ_ROOT) ; $(TAR) chf - "$(DistName)" | \
1107 $(GZIP) -c > "$(DistTarGZip)"
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001108
Reid Spencerf88808a2004-10-30 09:19:36 +00001109dist-bzip2:: $(DistTarBZ2)
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001110
1111$(DistTarBZ2) : distdir
Reid Spencerf88808a2004-10-30 09:19:36 +00001112 $(Echo) Packing bzipped distribution tar file.
Reid Spencerfc66af42004-11-29 05:00:33 +00001113 $(Verb) cd $(BUILD_OBJ_ROOT) ; $(TAR) chf - $(DistName) | \
1114 $(BZIP2) -c >$(DistTarBZ2)
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001115
Reid Spencerf88808a2004-10-30 09:19:36 +00001116dist-zip:: $(DistZip)
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001117
1118$(DistZip) : distdir
Reid Spencerf88808a2004-10-30 09:19:36 +00001119 $(Echo) Packing zipped distribution file.
1120 $(Verb) rm -f $(DistZip)
1121 $(Verb) cd $(BUILD_OBJ_ROOT) ; $(ZIP) -rq $(DistZip) $(DistName)
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001122
1123dist :: $(DistTarGZip) $(DistTarBZ2) $(DistZip)
Reid Spencerf88808a2004-10-30 09:19:36 +00001124 $(Echo) ===== DISTRIBUTION PACKAGING SUCESSFUL =====
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001125
1126DistCheckDir := $(LLVM_OBJ_ROOT)/_distcheckdir
1127
Reid Spencer77a46d22004-10-26 22:26:33 +00001128dist-check:: $(DistCheckTop) $(DistTarGZip)
Reid Spencerf88808a2004-10-30 09:19:36 +00001129 $(Echo) Checking distribution tar file.
1130 $(Verb) if test -d $(DistCheckDir) ; then \
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001131 $(RM) -rf $(DistCheckDir) ; \
1132 fi
Reid Spencerf88808a2004-10-30 09:19:36 +00001133 $(Verb) $(MKDIR) $(DistCheckDir)
1134 $(Verb) cd $(DistCheckDir) && \
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001135 $(MKDIR) $(DistCheckDir)/build && \
1136 $(MKDIR) $(DistCheckDir)/install && \
1137 gunzip -c $(DistTarGZip) | $(TAR) xf - && \
1138 cd build && \
1139 ../$(DistName)/configure --prefix="$(DistCheckDir)/install" \
1140 --srcdir=../$(DistName) --with-llvmgccdir="$(LLVMGCCDIR)" && \
1141 $(MAKE) check && \
1142 $(MAKE) install && \
1143 $(MAKE) uninstall && \
1144 $(MAKE) dist && \
1145 $(MAKE) clean && \
1146 $(MAKE) dist-clean && \
Reid Spencerf88808a2004-10-30 09:19:36 +00001147 $(EchoCmd) ===== $(DistTarGZip) Ready For Distribution =====
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001148
1149dist-clean::
Reid Spencerf88808a2004-10-30 09:19:36 +00001150 $(Echo) Cleaning distribution files
Reid Spencer651dd3ad2004-11-02 16:56:15 +00001151 -$(Verb) $(RM) -rf $(DistTarGZip) $(DistTarBZ2) $(DistZip) $(DistName) $(DistCheckDir)
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001152
1153endif
1154
1155#------------------------------------------------------------------------
1156# Provide the recursive distdir target for building the distribution directory
1157#------------------------------------------------------------------------
Reid Spencer77a46d22004-10-26 22:26:33 +00001158distdir : $(DistSources)
Reid Spencerf88808a2004-10-30 09:19:36 +00001159 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001160 if test -d "$(DistDir)" ; then \
1161 find $(DistDir) -type d ! -perm -200 -exec chmod u+w {} ';' || \
1162 exit 1 ; \
1163 fi ; \
Reid Spencerf88808a2004-10-30 09:19:36 +00001164 $(EchoCmd) Removing $(DistDir) ; \
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001165 $(RM) -rf $(DistDir); \
1166 fi
Reid Spencerfc66af42004-11-29 05:00:33 +00001167 $(Echo) Building Distribution Directory $(DistDir)
Reid Spencerf88808a2004-10-30 09:19:36 +00001168 $(Verb) $(MKDIR) $(DistDir)
1169 $(Verb) srcdirstrip=`echo "$(BUILD_SRC_DIR)" | sed 's|.|.|g'`; \
Reid Spencer100080c2004-10-25 08:27:37 +00001170 srcrootstrip=`echo "$(BUILD_SRC_ROOT)" | sed 's|.|.|g'`; \
1171 for file in $(DistFiles) ; do \
1172 case "$$file" in \
1173 $(BUILD_SRC_DIR)/*) file=`echo "$$file" | sed "s#^$$srcdirstrip/##"`;; \
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001174 $(BUILD_SRC_ROOT)/*) file=`echo "$$file" | sed "s#^$$srcrootstrip/#$(BUILD_OBJ_ROOT)/#"`;; \
Reid Spencer100080c2004-10-25 08:27:37 +00001175 esac; \
1176 if test -f "$$file" || test -d "$$file" ; then \
1177 from_dir=. ; \
1178 else \
1179 from_dir=$(BUILD_SRC_DIR); \
1180 fi; \
1181 to_dir=`echo "$$file" | sed -e 's#/[^/]*$$##'`; \
1182 if test "$$to_dir" != "$$file" && test "$$to_dir" != "."; then \
1183 to_dir="$(DistDir)/$$dir"; \
1184 $(MKDIR) "$$to_dir" ; \
1185 else \
1186 to_dir="$(DistDir)"; \
1187 fi; \
1188 mid_dir=`echo "$$file" | sed -n -e 's#^\(.*\)/[^/]*$$#\1#p'`; \
1189 if test -n "$$mid_dir" ; then \
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001190 $(MKDIR) "$$to_dir/$$mid_dir" || exit 1; \
Reid Spencer100080c2004-10-25 08:27:37 +00001191 fi ; \
1192 if test -d "$$from_dir/$$file"; then \
1193 if test -d "$(BUILD_SRC_DIR)/$$file" && \
1194 test "$$from_dir" != "$(BUILD_SRC_DIR)" ; then \
1195 cp -pR "$(BUILD_SRC_DIR)/$$file" "$$to_dir" || exit 1; \
1196 fi; \
1197 cp -pR $$from_dir/$$file $$to_dir || exit 1; \
1198 elif test -f "$$from_dir/$$file" ; then \
1199 cp -p "$$from_dir/$$file" "$(DistDir)/$$file" || exit 1; \
1200 elif test -L "$$from_dir/$$file" ; then \
1201 cp -pd "$$from_dir/$$file" $(DistDir)/$$file || exit 1; \
1202 elif echo "$(DistAlways)" | grep -v "$$file" >/dev/null ; then \
Reid Spencerf88808a2004-10-30 09:19:36 +00001203 $(EchoCmd) "===== WARNING: Distribution Source $$from_dir/$$file Not Found!" ; \
1204 elif test "$(Verb)" != '@' ; then \
1205 $(EchoCmd) "Skipping non-existent $$from_dir/$$file" ; \
Reid Spencer100080c2004-10-25 08:27:37 +00001206 fi; \
1207 done
Reid Spencerf88808a2004-10-30 09:19:36 +00001208 $(Verb) for subdir in $(DistSubDirs) ; do \
Reid Spencer100080c2004-10-25 08:27:37 +00001209 if test "$$subdir" \!= "." ; then \
Reid Spencer100080c2004-10-25 08:27:37 +00001210 new_distdir="$(DistDir)/$$subdir" ; \
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001211 test -d "$$new_distdir" || $(MKDIR) "$$new_distdir" || exit 1; \
1212 ( cd $$subdir && $(MAKE) DistDir="$$new_distdir" distdir ) || exit 1; \
Reid Spencer100080c2004-10-25 08:27:37 +00001213 fi; \
1214 done
Reid Spencerf88808a2004-10-30 09:19:36 +00001215 $(Verb) $(MAKE) DistDir="$(DistDir)" dist-hook || exit 1
1216 -$(Verb) find $(DistDir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
Reid Spencer100080c2004-10-25 08:27:37 +00001217 ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
1218 ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
1219 ! -type d ! -perm -444 -exec $(SHELL) $(INSTALL_SH) -c -m a+r {} {} \; \
1220 || chmod -R a+r $(DistDir)
1221
Reid Spencerf88808a2004-10-30 09:19:36 +00001222# This is invoked by distdir target, define it as a no-op to avoid errors if not
1223# defined by user.
Reid Spencer100080c2004-10-25 08:27:37 +00001224dist-hook::
1225
Reid Spencer23a70372004-10-22 23:06:30 +00001226endif
Reid Spencerf206bd72004-10-22 21:01:56 +00001227
1228###############################################################################
Reid Spencer12a3a052004-10-24 07:53:21 +00001229# TOP LEVEL - targets only to apply at the top level directory
1230###############################################################################
1231
1232ifeq ($(LEVEL),.)
1233
1234#------------------------------------------------------------------------
Reid Spencer12a3a052004-10-24 07:53:21 +00001235# Install support for project's include files:
1236#------------------------------------------------------------------------
1237install-local::
Reid Spencerf88808a2004-10-30 09:19:36 +00001238 $(Echo) Installing include files
1239 $(Verb) $(MKDIR) $(includedir)
1240 $(Verb) if [ -d "$(BUILD_SRC_ROOT)/include" ] ; then \
Reid Spencer12a3a052004-10-24 07:53:21 +00001241 cd $(BUILD_SRC_ROOT)/include && \
1242 find . -path '*/Internal' -prune -o '(' -type f \
1243 '!' '(' -name '*~' -o -name '.cvsignore' -o -name '.#*' ')' \
1244 -print ')' | grep -v CVS | pax -rwdvpe $(includedir) ; \
1245 fi
1246
1247uninstall-local::
Reid Spencerf88808a2004-10-30 09:19:36 +00001248 $(Echo) Uninstalling include files
1249 $(Verb) if [ -d "$(BUILD_SRC_ROOT)/include" ] ; then \
Reid Spencer12a3a052004-10-24 07:53:21 +00001250 cd $(BUILD_SRC_ROOT)/include && \
1251 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f \
1252 '!' '(' -name '*~' -o -name '.cvsignore' -o -name '.#*' ')' \
1253 -print ')' | grep -v CVS | sed 's#^#$(includedir)/#'` ; \
1254 fi
1255
Reid Spencer12a3a052004-10-24 07:53:21 +00001256endif
1257
Reid Spencerf206bd72004-10-22 21:01:56 +00001258#------------------------------------------------------------------------
1259# Print out the directories used for building
Reid Spencerf88808a2004-10-30 09:19:36 +00001260#------------------------------------------------------------------------
Reid Spencer81cd0492004-10-23 20:04:14 +00001261printvars::
Reid Spencerb5b92fb2004-11-01 07:50:27 +00001262 $(Echo) "BuildMode : " '$(BuildMode)'
Reid Spencerf88808a2004-10-30 09:19:36 +00001263 $(Echo) "BUILD_SRC_ROOT : " '$(BUILD_SRC_ROOT)'
1264 $(Echo) "BUILD_SRC_DIR : " '$(BUILD_SRC_DIR)'
1265 $(Echo) "BUILD_OBJ_ROOT : " '$(BUILD_OBJ_ROOT)'
1266 $(Echo) "BUILD_OBJ_DIR : " '$(BUILD_OBJ_DIR)'
1267 $(Echo) "LLVM_SRC_ROOT : " '$(LLVM_SRC_ROOT)'
1268 $(Echo) "LLVM_OBJ_ROOT : " '$(LLVM_OBJ_ROOT)'
1269 $(Echo) "libdir : " '$(libdir)'
1270 $(Echo) "bindir : " '$(bindir)'
1271 $(Echo) "sysconfdir : " '$(sysconfdir)'
1272 $(Echo) "bytecode_libdir: " '$(bytecode_libdir)'
1273 $(Echo) "UserTargets : " '$(UserTargets)'
1274 $(Echo) "ObjMakefiles : " '$(ObjMakefiles)'
1275 $(Echo) "SrcMakefiles : " '$(SrcMakefiles)'
1276 $(Echo) "ObjDir : " '$(ObjDir)'
1277 $(Echo) "LibDir : " '$(LibDir)'
1278 $(Echo) "ToolDir : " '$(ToolDir)'
Reid Spencer7e9e0b02004-11-18 10:03:46 +00001279 $(Echo) "ExmplDir : " '$(ExmplDir)'
Reid Spencerf88808a2004-10-30 09:19:36 +00001280 $(Echo) "TDFiles : " '$(TDFiles)'
1281 $(Echo) "INCFiles : " '$(INCFiles)'
1282 $(Echo) "Compile.CXX : " '$(Compile.CXX)'
1283 $(Echo) "Compile.C : " '$(Compile.C)'
1284 $(Echo) "Archive : " '$(Archive)'
Reid Spencer9d0c1e02004-11-02 16:36:03 +00001285 $(Echo) "YaccFiles : " '$(YaccFiles)'
1286 $(Echo) "LexFiles : " '$(LexFiles)'