blob: 9897fc87846f001bd1d15b7a16b22de0253edcfd [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
235 BCLinkLib.Flags += -v
236 VERBOSE := 1
237endif
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 Spencerf8b4a8e2004-11-08 17:32:12 +0000289BCLinkLib = $(LLVMGCC) -shared -nostdlib $(BCLinkLib.Flags)
Reid Spencerf88808a2004-10-30 09:19:36 +0000290LTInstall = $(LIBTOOL) $(LibTool.Flags) --mode=install $(INSTALL)
Reid Spencer81cd0492004-10-23 20:04:14 +0000291Burg = $(BURG) -I $(BUILD_SRC_DIR)
292TableGen = $(TBLGEN) -I $(BUILD_SRC_DIR)
Reid Spencerf88808a2004-10-30 09:19:36 +0000293Archive = $(AR) $(AR.Flags)
Reid Spencerec7a80b2004-11-14 21:46:55 +0000294LArchive = $(ToolDir)/llvm-ar rcsf
Reid Spencerf206bd72004-10-22 21:01:56 +0000295ifdef RANLIB
Reid Spencer81cd0492004-10-23 20:04:14 +0000296Ranlib = $(RANLIB)
Reid Spencerf206bd72004-10-22 21:01:56 +0000297else
Reid Spencer81cd0492004-10-23 20:04:14 +0000298Ranlib = ranlib
John Criswell3ef61af2003-06-30 21:59:07 +0000299endif
300
Chris Lattner2f7c9632001-06-06 20:29:01 +0000301#----------------------------------------------------------
Reid Spencer81cd0492004-10-23 20:04:14 +0000302# Get the list of source files
303#----------------------------------------------------------
304ifndef SOURCES
Reid Spencerf88808a2004-10-30 09:19:36 +0000305 Sources := $(notdir $(wildcard $(BUILD_SRC_DIR)/*.cpp \
306 $(BUILD_SRC_DIR)/*.cc $(BUILD_SRC_DIR)/*.c $(BUILD_SRC_DIR)/*.y \
307 $(BUILD_SRC_DIR)/*.l))
308else
309 Sources := $(SOURCES)
Reid Spencerf206bd72004-10-22 21:01:56 +0000310endif
311
312ifdef BUILT_SOURCES
Reid Spencerf88808a2004-10-30 09:19:36 +0000313Sources += $(filter %.cpp %.c %.cc %.y %.l,$(BUILT_SOURCES))
Vikram S. Adve53738842002-10-14 16:40:04 +0000314endif
Vikram S. Advefe346892001-07-15 13:16:47 +0000315
Reid Spencer81cd0492004-10-23 20:04:14 +0000316#----------------------------------------------------------
317# Types of objects that can be built from sources
318#----------------------------------------------------------
Reid Spencerf88808a2004-10-30 09:19:36 +0000319BaseNameSources := $(sort $(basename $(Sources)))
320ObjectsO := $(BaseNameSources:%=$(ObjDir)/%.o)
321ObjectsLO := $(BaseNameSources:%=$(ObjDir)/%.lo)
322ObjectsBC := $(BaseNameSources:%=$(ObjDir)/%.bc)
Reid Spencer81cd0492004-10-23 20:04:14 +0000323
324###############################################################################
325# DIRECTORIES: Handle recursive descent of directory structure
326###############################################################################
John Criswell3601f372003-07-31 20:58:51 +0000327
Chris Lattner2f7c9632001-06-06 20:29:01 +0000328#---------------------------------------------------------
Reid Spencer9c7bfc92004-10-28 09:15:28 +0000329# Provide rules to make install dirs. This must be early
330# in the file so they get built before dependencies
331#---------------------------------------------------------
332
333$(bindir):
Reid Spencerf88808a2004-10-30 09:19:36 +0000334 $(Verb) $(MKDIR) $(bindir)
Chris Lattner615e7fb2004-11-01 06:14:59 +0000335
Reid Spencer9c7bfc92004-10-28 09:15:28 +0000336$(libdir):
Reid Spencerf88808a2004-10-30 09:19:36 +0000337 $(Verb) $(MKDIR) $(libdir)
Reid Spencer9c7bfc92004-10-28 09:15:28 +0000338
339$(bytecode_libdir):
Reid Spencerf88808a2004-10-30 09:19:36 +0000340 $(Verb) $(MKDIR) $(bytecode_libdir)
Reid Spencer9c7bfc92004-10-28 09:15:28 +0000341
342$(sysconfdir):
Reid Spencerf88808a2004-10-30 09:19:36 +0000343 $(Verb) $(MKDIR) $(sysconfdir)
Reid Spencer9c7bfc92004-10-28 09:15:28 +0000344
Reid Spencerf88808a2004-10-30 09:19:36 +0000345# To create other directories, as needed, and timestamp their creation
346%/.dir:
347 $(Verb) $(MKDIR) $* > /dev/null
Reid Spencerfc66af42004-11-29 05:00:33 +0000348 $(Verb) $(DATE) > $@
Reid Spencerf88808a2004-10-30 09:19:36 +0000349
Reid Spencer7e9e0b02004-11-18 10:03:46 +0000350.PRECIOUS: $(ObjDir)/.dir $(LibDir)/.dir $(ToolDir)/.dir $(ExmplDir)/.dir
351.PRECIOUS: $(LLVMLibDir)/.dir $(LLVMToolDir)/.dir $(LLVMExmplDir)/.dir
Reid Spencer9c7bfc92004-10-28 09:15:28 +0000352
353#---------------------------------------------------------
Reid Spencer81cd0492004-10-23 20:04:14 +0000354# Handle the DIRS options for sequential construction
Chris Lattner2f7c9632001-06-06 20:29:01 +0000355#---------------------------------------------------------
356
Reid Spencerf88808a2004-10-30 09:19:36 +0000357SubDirs :=
Anand Shukla8c2a0ee2002-09-18 04:29:30 +0000358ifdef DIRS
Reid Spencerf88808a2004-10-30 09:19:36 +0000359SubDirs += $(DIRS)
360$(RecursiveTargets)::
361 $(Verb) for dir in $(DIRS); do \
Reid Spencerf206bd72004-10-22 21:01:56 +0000362 if [ ! -f $$dir/Makefile ]; then \
363 $(MKDIR) $$dir; \
364 cp $(BUILD_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
365 fi; \
Reid Spencer100080c2004-10-25 08:27:37 +0000366 ($(MAKE) -C $$dir $@ ) || exit 1; \
Chris Lattner539a23c2002-09-17 23:35:02 +0000367 done
Anand Shukla8c2a0ee2002-09-18 04:29:30 +0000368endif
Chris Lattnerf3dd5f52002-09-18 03:22:27 +0000369
Reid Spencer81cd0492004-10-23 20:04:14 +0000370#---------------------------------------------------------
371# Handle the EXPERIMENTAL_DIRS options ensuring success
372# after each directory is built.
373#---------------------------------------------------------
374ifdef EXPERIMENTAL_DIRS
Reid Spencerf88808a2004-10-30 09:19:36 +0000375$(RecursiveTargets)::
376 $(Verb) for dir in $(EXPERIMENTAL_DIRS); do \
Reid Spencer81cd0492004-10-23 20:04:14 +0000377 if [ ! -f $$dir/Makefile ]; then \
378 $(MKDIR) $$dir; \
379 cp $(BUILD_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
380 fi; \
Reid Spencer100080c2004-10-25 08:27:37 +0000381 ($(MAKE) -C $$dir $@ ) || exit 0; \
Reid Spencer81cd0492004-10-23 20:04:14 +0000382 done
383endif
Chris Lattnerf3dd5f52002-09-18 03:22:27 +0000384
Reid Spencer81cd0492004-10-23 20:04:14 +0000385#---------------------------------------------------------
386# Handle the PARALLEL_DIRS options for parallel construction
387#---------------------------------------------------------
388ifdef PARALLEL_DIRS
389
Reid Spencerf88808a2004-10-30 09:19:36 +0000390SubDirs += $(PARALLEL_DIRS)
391
Reid Spencer81cd0492004-10-23 20:04:14 +0000392# Unfortunately, this list must be maintained if new
393# 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))
400
Reid Spencerf88808a2004-10-30 09:19:36 +0000401Parallel_Targets := $(foreach T,$(RecursiveTargets),%/.make$(T))
Reid Spencer81cd0492004-10-23 20:04:14 +0000402
403$(Parallel_Targets) :
Reid Spencerf88808a2004-10-30 09:19:36 +0000404 $(Verb) if [ ! -f $(@D)/Makefile ]; then \
Reid Spencerf206bd72004-10-22 21:01:56 +0000405 $(MKDIR) $(@D); \
406 cp $(BUILD_SRC_DIR)/$(@D)/Makefile $(@D)/Makefile; \
John Criswell6df35dd2003-11-25 19:32:22 +0000407 fi; \
Reid Spencer100080c2004-10-25 08:27:37 +0000408 $(MAKE) -C $(@D) $(subst $(@D)/.make,,$@)
Chris Lattner2f7c9632001-06-06 20:29:01 +0000409endif
410
Reid Spencer81cd0492004-10-23 20:04:14 +0000411#---------------------------------------------------------
412# Handle the OPTIONAL_DIRS options for directores that may
413# or may not exist.
414#---------------------------------------------------------
John Criswell8224df92003-06-27 16:58:44 +0000415ifdef OPTIONAL_DIRS
Reid Spencer100080c2004-10-25 08:27:37 +0000416
Reid Spencerf88808a2004-10-30 09:19:36 +0000417SubDirs += $(OPTIONAL_DIRS)
Reid Spencer100080c2004-10-25 08:27:37 +0000418
Reid Spencerf88808a2004-10-30 09:19:36 +0000419$(RecursiveTargets)::
420 $(Verb) for dir in $(OPTIONAL_DIRS); do \
Reid Spencerf206bd72004-10-22 21:01:56 +0000421 if [ -d $(BUILD_SRC_DIR)/$$dir ]; then\
422 if [ ! -f $$dir/Makefile ]; then \
423 $(MKDIR) $$dir; \
424 cp $(BUILD_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
425 fi; \
Reid Spencer100080c2004-10-25 08:27:37 +0000426 ($(MAKE) -C$$dir $@ ) || exit 1; \
Reid Spencerf206bd72004-10-22 21:01:56 +0000427 fi \
John Criswell8224df92003-06-27 16:58:44 +0000428 done
429endif
430
Reid Spencercc51e7b2004-08-20 09:20:05 +0000431#---------------------------------------------------------
432# Handle the CONFIG_FILES options
433#---------------------------------------------------------
434ifdef CONFIG_FILES
Reid Spencercc51e7b2004-08-20 09:20:05 +0000435
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000436install-local:: $(sysconfdir) $(CONFIG_FILES)
Reid Spencerf88808a2004-10-30 09:19:36 +0000437 $(Echo) Installing Configuration Files To $(sysconfdir)
438 $(Verb)for file in $(CONFIG_FILES); do \
Reid Spencer39d6a612004-11-23 05:59:53 +0000439 if test -f $(BUILD_OBJ_DIR)/$${file} ; then \
440 $(INSTALL) $(BUILD_OBJ_DIR)/$${file} $(sysconfdir) ; \
441 elif test -f $(BUILD_SRC_DIR)/$${file} ; then \
442 $(INSTALL) $(BUILD_SRC_DIR)/$${file} $(sysconfdir) ; \
443 else \
444 $(ECHO) Error: cannot find config file $${file}. ; \
445 fi \
Reid Spencercc51e7b2004-08-20 09:20:05 +0000446 done
Reid Spencer81cd0492004-10-23 20:04:14 +0000447
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000448uninstall-local::
Reid Spencerf88808a2004-10-30 09:19:36 +0000449 $(Echo) Uninstalling Configuration Files From $(sysconfdir)
450 $(Verb)for file in $(CONFIG_FILES); do \
Reid Spencer100080c2004-10-25 08:27:37 +0000451 $(RM) -f $(sysconfdir)/$${file} ; \
Reid Spencer12a3a052004-10-24 07:53:21 +0000452 done
453
Reid Spencercc51e7b2004-08-20 09:20:05 +0000454endif
455
Reid Spencer81cd0492004-10-23 20:04:14 +0000456###############################################################################
457# Library Build Rules: Four ways to build a library
458###############################################################################
Chris Lattner2f7c9632001-06-06 20:29:01 +0000459
Brian Gaekeecc92bf2004-01-22 22:53:48 +0000460
Reid Spencer81cd0492004-10-23 20:04:14 +0000461# if we're building a library ...
Chris Lattner2f7c9632001-06-06 20:29:01 +0000462ifdef LIBRARYNAME
Vikram S. Advefe346892001-07-15 13:16:47 +0000463
Chris Lattner0100eab2002-09-16 22:36:42 +0000464# Make sure there isn't any extranous whitespace on the LIBRARYNAME option
Chris Lattnere6e193ca2002-09-16 22:34:56 +0000465LIBRARYNAME := $(strip $(LIBRARYNAME))
Reid Spencerf88808a2004-10-30 09:19:36 +0000466LibName.LA := $(LibDir)/lib$(LIBRARYNAME).la
467LibName.A := $(LibDir)/lib$(LIBRARYNAME).a
468LibName.O := $(LibDir)/$(LIBRARYNAME).o
469LibName.BC := $(LibDir)/lib$(LIBRARYNAME).bc
Chris Lattnere6e193ca2002-09-16 22:34:56 +0000470
Reid Spencer81cd0492004-10-23 20:04:14 +0000471#---------------------------------------------------------
472# Shared Library Targets:
473# If the user asked for a shared library to be built
474# with the SHARED_LIBRARY variable, then we provide
475# targets for building them.
476#---------------------------------------------------------
Reid Spencerf206bd72004-10-22 21:01:56 +0000477ifdef SHARED_LIBRARY
478
Reid Spencerf88808a2004-10-30 09:19:36 +0000479all-local:: $(LibName.LA)
Reid Spencerf206bd72004-10-22 21:01:56 +0000480
Reid Spencerf88808a2004-10-30 09:19:36 +0000481$(LibName.LA): $(BUILT_SOURCES) $(ObjectsLO) $(LibDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000482 $(Echo) Linking $(BuildMode) Shared Library $(LIBRARYNAME)$(SHLIBEXT)
Reid Spencerf88808a2004-10-30 09:19:36 +0000483 $(Verb) $(Link) -o $@ $(ObjectsLO)
484 $(Verb) $(LTInstall) $@ $(LibDir)
Reid Spencer81cd0492004-10-23 20:04:14 +0000485
486clean-local::
Reid Spencerf88808a2004-10-30 09:19:36 +0000487ifneq ($(strip $(LibName.LA)),)
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000488 -$(Verb) $(RM) -f $(LibName.LA)
Reid Spencer12a3a052004-10-24 07:53:21 +0000489endif
Reid Spencerf206bd72004-10-22 21:01:56 +0000490
Reid Spencer12a3a052004-10-24 07:53:21 +0000491DestSharedLib = $(libdir)/lib$(LIBRARYNAME)$(SHLIBEXT)
Reid Spencerf206bd72004-10-22 21:01:56 +0000492
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000493install-local:: $(DestSharedLib)
Reid Spencer12a3a052004-10-24 07:53:21 +0000494
Reid Spencerf88808a2004-10-30 09:19:36 +0000495$(DestSharedLib): $(libdir) $(LibName.LA)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000496 $(Echo) Installing $(BuildMode) Shared Library $(DestSharedLib)
Reid Spencerf88808a2004-10-30 09:19:36 +0000497 $(Verb) $(LTInstall) $(LibName.LA) $(DestSharedLib)
498 $(Verb) $(LIBTOOL) --finish $(libdir)
Reid Spencer12a3a052004-10-24 07:53:21 +0000499
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000500uninstall-local::
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000501 $(Echo) Uninstalling $(BuildMode) Shared Library $(DestSharedLib)
Reid Spenceraee67e62004-11-12 02:27:36 +0000502 -$(Verb) $(RM) -f $(libdir)/lib$(LIBRARYNAME).*
Reid Spencer12a3a052004-10-24 07:53:21 +0000503
Reid Spencerf206bd72004-10-22 21:01:56 +0000504endif
505
Reid Spencer81cd0492004-10-23 20:04:14 +0000506#---------------------------------------------------------
507# Bytecode Library Targets:
508# If the user asked for a bytecode library to be built
509# with the BYTECODE_LIBRARY variable, then we provide
510# targets for building them.
511#---------------------------------------------------------
Reid Spencerf206bd72004-10-22 21:01:56 +0000512ifdef BYTECODE_LIBRARY
513
514ifdef EXPORTED_SYMBOL_LIST
515 BCLinkLib += -Xlinker -internalize-public-api-list=$(EXPORTED_SYMBOL_LIST)
516else
517 ifdef EXPORTED_SYMBOL_FILE
518 BCLinkLib += -Xlinker -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
519 else
520 BCLinkLib += -Xlinker -disable-internalize
521 endif
522endif
523
Reid Spencerf88808a2004-10-30 09:19:36 +0000524all-local:: $(LibName.BC)
Reid Spencerf206bd72004-10-22 21:01:56 +0000525
Chris Lattner0ea40c92004-11-29 19:47:58 +0000526$(LibName.BC): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(GCCLD)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000527 $(Echo) Linking $(BuildMode) Bytecode Library $(notdir $@)
Reid Spencerf88808a2004-10-30 09:19:36 +0000528 $(Verb) $(BCLinkLib) -o $@ $(ObjectsBC)
Reid Spencerf206bd72004-10-22 21:01:56 +0000529
Reid Spencer81cd0492004-10-23 20:04:14 +0000530clean-local::
Reid Spencerf88808a2004-10-30 09:19:36 +0000531ifneq ($(strip $(LibName.BC)),)
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000532 -$(Verb) $(RM) -f $(LibName.BC)
Reid Spencer12a3a052004-10-24 07:53:21 +0000533endif
Reid Spencerf206bd72004-10-22 21:01:56 +0000534
Reid Spencer12a3a052004-10-24 07:53:21 +0000535DestBytecodeLib = $(bytecode_libdir)/lib$(LIBRARYNAME).bc
Reid Spencer8da1b5d2004-10-26 07:09:33 +0000536
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000537install-local:: $(DestBytecodeLib)
Chris Lattner0c4f4fe2003-08-15 02:18:35 +0000538
Reid Spencerf88808a2004-10-30 09:19:36 +0000539$(DestBytecodeLib): $(bytecode_libdir) $(LibName.BC)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000540 $(Echo) Installing $(BuildMode) Bytecode Library $(DestBytecodeLib)
Reid Spencerf88808a2004-10-30 09:19:36 +0000541 $(Verb) $(INSTALL) $(LibName.BC) $@
Reid Spencer12a3a052004-10-24 07:53:21 +0000542
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000543uninstall-local::
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000544 $(Echo) Uninstalling $(BuildMode) Bytecode Library $(DestBytecodeLib)
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000545 -$(Verb) $(RM) -f $(DestBytecodeLib)
Reid Spencerf206bd72004-10-22 21:01:56 +0000546
547endif
Vikram S. Adve15bd3ad2002-08-02 18:34:12 +0000548
Reid Spencerf88808a2004-10-30 09:19:36 +0000549#---------------------------------------------------------
550# ReLinked Library Targets:
551# If the user didn't explicitly forbid building a
552# relinked then we provide targets for building them.
553#---------------------------------------------------------
Chris Lattner76d98ba2002-07-23 17:56:16 +0000554ifndef DONT_BUILD_RELINKED
Reid Spencerf206bd72004-10-22 21:01:56 +0000555
Reid Spencerf88808a2004-10-30 09:19:36 +0000556all-local:: $(LibName.O)
557
558$(LibName.O): $(BUILT_SOURCES) $(ObjectsO) $(LibDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000559 $(Echo) Linking $(BuildMode) Object Library $(notdir $@)
Reid Spencerf88808a2004-10-30 09:19:36 +0000560 $(Verb) $(Relink) -o $@ $(ObjectsO)
Reid Spencerf206bd72004-10-22 21:01:56 +0000561
Reid Spencer81cd0492004-10-23 20:04:14 +0000562clean-local::
Reid Spencerf88808a2004-10-30 09:19:36 +0000563ifneq ($(strip $(LibName.O)),)
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000564 -$(Verb) $(RM) -f $(LibName.O)
Reid Spencer12a3a052004-10-24 07:53:21 +0000565endif
566
567DestRelinkedLib = $(libdir)/$(LIBRARYNAME).o
568
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000569install-local:: $(DestRelinkedLib)
Reid Spencer12a3a052004-10-24 07:53:21 +0000570
Reid Spencerf88808a2004-10-30 09:19:36 +0000571$(DestRelinkedLib): $(libdir) $(LibName.O)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000572 $(Echo) Installing $(BuildMode) Object Library $(DestRelinkedLib)
Reid Spencerf88808a2004-10-30 09:19:36 +0000573 $(Verb) $(LTInstall) $(LibName.O) $(DestRelinkedLib)
Reid Spencer12a3a052004-10-24 07:53:21 +0000574
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000575uninstall-local::
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000576 $(Echo) Uninstalling $(BuildMode) Object Library $(DestRelinkedLib)
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000577 -$(Verb) $(RM) -f $(DestRelinkedLib)
Reid Spencerf206bd72004-10-22 21:01:56 +0000578
Chris Lattner76d98ba2002-07-23 17:56:16 +0000579endif
Chris Lattnerc2bd7cf2003-03-14 20:25:22 +0000580
Reid Spencerf88808a2004-10-30 09:19:36 +0000581#---------------------------------------------------------
582# Archive Library Targets:
583# If the user wanted a regular archive library built,
584# then we provide targets for building them.
585#---------------------------------------------------------
Chris Lattner76d98ba2002-07-23 17:56:16 +0000586ifdef BUILD_ARCHIVE
Chris Lattner76d98ba2002-07-23 17:56:16 +0000587
Reid Spencerf88808a2004-10-30 09:19:36 +0000588all-local:: $(LibName.A)
589
590$(LibName.A): $(BUILT_SOURCES) $(ObjectsO) $(LibDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000591 $(Echo) Building $(BuildMode) Archive Library $(notdir $@)
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000592 -$(Verb) $(RM) -f $@
Reid Spencerf88808a2004-10-30 09:19:36 +0000593 $(Verb) $(Archive) $@ $(ObjectsO)
594 $(Verb) $(Ranlib) $@
Vikram S. Adve20aa62f2002-09-20 14:03:13 +0000595
Reid Spencer81cd0492004-10-23 20:04:14 +0000596clean-local::
Reid Spencerf88808a2004-10-30 09:19:36 +0000597ifneq ($(strip $(LibName.A)),)
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000598 -$(Verb) $(RM) -f $(LibName.A)
Chris Lattner2f7c9632001-06-06 20:29:01 +0000599endif
600
Reid Spencer12a3a052004-10-24 07:53:21 +0000601DestArchiveLib := $(libdir)/lib$(LIBRARYNAME).a
602
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000603install-local:: $(DestArchiveLib)
Reid Spencer12a3a052004-10-24 07:53:21 +0000604
Reid Spencerf88808a2004-10-30 09:19:36 +0000605$(DestArchiveLib): $(libdir) $(LibName.A)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000606 $(Echo) Installing $(BuildMode) Archive Library $(DestArchiveLib)
Reid Spencerf88808a2004-10-30 09:19:36 +0000607 $(Verb) $(MKDIR) $(libdir)
608 $(Verb) $(LTInstall) $(LibName.A) $(DestArchiveLib)
Reid Spencer12a3a052004-10-24 07:53:21 +0000609
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000610uninstall-local::
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000611 $(Echo) Uninstalling $(BuildMode) Archive Library $(DestArchiveLib)
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000612 -$(Verb) $(RM) -f $(DestArchiveLib)
Reid Spencer12a3a052004-10-24 07:53:21 +0000613
614endif
615
616# endif LIBRARYNAME
Reid Spencerf206bd72004-10-22 21:01:56 +0000617endif
618
Reid Spencerdcba7782004-10-24 08:21:04 +0000619###############################################################################
620# Tool Build Rules: Build executable tool based on TOOLNAME option
621###############################################################################
622
Chris Lattner07c7c192001-09-07 22:57:58 +0000623ifdef TOOLNAME
624
Reid Spencerf88808a2004-10-30 09:19:36 +0000625#---------------------------------------------------------
Reid Spenceraf4495a2004-11-29 07:17:07 +0000626# Handle the special "JIT" value for LLVM_LIBS which is a
627# shorthand for a bunch of libraries that get the correct
628# JIT support for a tool that runs JIT.
629#---------------------------------------------------------
630ifeq ($(LLVMLIBS),JIT)
631
632# Make sure we can get our own symbols in the tool
633Link += -dlopen self
634
635# Generic JIT libraries
636JIT_LIBS := LLVMInterpreter LLVMJIT LLVMCodeGen LLVMExecutionEngine
637
638# You can enable the X86 JIT on a non-X86 host by setting the flag
639# ENABLE_X86_JIT on the make command line. If not, it will still be
640# enabled automagically on an X86 host.
641ifeq ($(ARCH), x86)
642 ENABLE_X86_JIT = 1
643endif
644
645# What the X86 JIT requires
646ifdef ENABLE_X86_JIT
647 JIT_LIBS += LLVMX86 LLVMSelectionDAG
648endif
649
650# You can enable the SparcV9 JIT on a non-SparcV9 host by setting the flag
651# ENABLE_SPARCV9_JIT on the make command line. If not, it will still be
652# enabled automagically on an SparcV9 host.
653ifeq ($(ARCH), Sparc)
654 ENABLE_SPARCV9_JIT = 1
655endif
656
657# What the Sparc JIT requires
658ifdef ENABLE_SPARCV9_JIT
659 JIT_LIBS += LLVMSparcV9 LLVMSparcV9ModuloSched LLVMSparcV9InstrSched \
660 LLVMSparcV9LiveVar LLVMInstrumentation.a LLVMProfilePaths \
661 LLVMBCWriter LLVMTransforms.a LLVMipo.a LLVMipa.a \
662 LLVMDataStructure.a LLVMSparcV9RegAlloc
663endif
664
665# You can enable the PowerPC JIT on a non-PowerPC host by setting the flag
666# ENABLE_PPC_JIT on the make command line. If not, it will still be
667# enabled automagically on an PowerPC host.
668ifeq ($(ARCH), PowerPC)
669 ENABLE_PPC_JIT = 1
670endif
671
672# What the PowerPC JIT requires
673ifdef ENABLE_PPC_JIT
674 JIT_LIBS += LLVMPowerPC
675endif
676
677LLVMLIBS := $(JIT_LIBS) LLVMScalarOpts LLVMAnalysis.a LLVMTransformUtils.a \
678 LLVMBCReader LLVMCore LLVMSupport.a LLVMTarget.a LLVMbzip2 \
679 LLVMSystem.a $(PLATFORMLIBDL)
680endif
681
682#---------------------------------------------------------
Reid Spencerf88808a2004-10-30 09:19:36 +0000683# Set up variables for building a tool.
684#---------------------------------------------------------
Reid Spencer7e9e0b02004-11-18 10:03:46 +0000685ifdef EXAMPLE_TOOL
686ToolBuildPath := $(ExmplDir)/$(TOOLNAME)$(EXEEXT)
687else
Reid Spencerf88808a2004-10-30 09:19:36 +0000688ToolBuildPath := $(ToolDir)/$(TOOLNAME)$(EXEEXT)
Reid Spencer7e9e0b02004-11-18 10:03:46 +0000689endif
Reid Spencerf88808a2004-10-30 09:19:36 +0000690ProjLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS)))
691ProjLibsOptions := $(patsubst %.o, $(LibDir)/%.o, $(ProjLibsOptions))
692LLVMLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(LLVMLIBS)))
693LLVMLibsOptions := $(patsubst %.o, $(LLVMLibDir)/%.o, $(LLVMLibsOptions))
694ProjUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(USEDLIBS)))
695LLVMUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(LLVMLIBS)))
696ProjLibsPaths := $(addprefix $(LibDir)/,$(ProjUsedLibs))
697LLVMLibsPaths := $(addprefix $(LLVMLibDir)/,$(LLVMUsedLibs))
Chris Lattner07c7c192001-09-07 22:57:58 +0000698
Reid Spencerf88808a2004-10-30 09:19:36 +0000699#---------------------------------------------------------
Reid Spencerf88808a2004-10-30 09:19:36 +0000700# Tell make that we need to rebuild subdirectories before
701# we can link the tool. This affects things like LLI which
702# has library subdirectories.
703#---------------------------------------------------------
704$(ToolBuildPath): $(addsuffix /.makeall, $(PARALLEL_DIRS))
Chris Lattner3ecb7762003-01-22 16:13:31 +0000705
Reid Spencerf88808a2004-10-30 09:19:36 +0000706#---------------------------------------------------------
707# Provide targets for building the tools
708#---------------------------------------------------------
709all-local:: $(ToolBuildPath)
John Criswell8224df92003-06-27 16:58:44 +0000710
Reid Spencer81cd0492004-10-23 20:04:14 +0000711clean-local::
Reid Spencerf88808a2004-10-30 09:19:36 +0000712ifneq ($(strip $(ToolBuildPath)),)
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000713 -$(Verb) $(RM) -f $(ToolBuildPath)
Reid Spencer12a3a052004-10-24 07:53:21 +0000714endif
Chris Lattner07c7c192001-09-07 22:57:58 +0000715
Reid Spencer7e9e0b02004-11-18 10:03:46 +0000716ifdef EXAMPLE_TOOL
717$(ToolBuildPath): $(ExmplDir)/.dir
718else
719$(ToolBuildPath): $(ToolDir)/.dir
720endif
721
722$(ToolBuildPath): $(BUILT_SOURCES) $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000723 $(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg)
Reid Spencerf88808a2004-10-30 09:19:36 +0000724 $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
725 $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000726 $(Echo) ======= Finished Linking $(BuildMode) Executable $(TOOLNAME) $(StripWarnMsg)
Reid Spencer12a3a052004-10-24 07:53:21 +0000727
728DestTool = $(bindir)/$(TOOLNAME)
729
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000730install-local:: $(DestTool)
Reid Spencer8da1b5d2004-10-26 07:09:33 +0000731
Reid Spencerf88808a2004-10-30 09:19:36 +0000732$(DestTool): $(bindir) $(ToolBuildPath)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000733 $(Echo) Installing $(BuildMode) $(DestTool)
Reid Spencerf88808a2004-10-30 09:19:36 +0000734 $(Verb) $(INSTALL) $(ToolBuildPath) $(DestTool)
Reid Spencer12a3a052004-10-24 07:53:21 +0000735
Reid Spencerbe6a4e92004-10-28 07:57:28 +0000736uninstall-local::
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000737 $(Echo) Uninstalling $(BuildMode) $(DestTool)
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000738 -$(Verb) $(RM) -f $(DestTool)
Reid Spencer12a3a052004-10-24 07:53:21 +0000739
Reid Spencerf206bd72004-10-22 21:01:56 +0000740endif
Chris Lattner07c7c192001-09-07 22:57:58 +0000741
Reid Spencerf88808a2004-10-30 09:19:36 +0000742###############################################################################
743# Object Build Rules: Build object files based on sources
744###############################################################################
745
746# Provide rule sets for when dependency generation is enabled
Reid Spencerf206bd72004-10-22 21:01:56 +0000747ifndef DISABLE_AUTO_DEPENDENCIES
Vikram S. Adve20aa62f2002-09-20 14:03:13 +0000748
Reid Spencerf88808a2004-10-30 09:19:36 +0000749#---------------------------------------------------------
750# Create .lo files in the ObjDir directory from the .cpp and .c files...
751#---------------------------------------------------------
Reid Spencer81cd0492004-10-23 20:04:14 +0000752ifdef SHARED_LIBRARY
753
Reid Spencerf88808a2004-10-30 09:19:36 +0000754$(ObjDir)/%.lo $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000755 $(Echo) "Compiling $*.cpp for $(BuildMode) build (PIC)"
Reid Spencerf88808a2004-10-30 09:19:36 +0000756 $(Verb) if $(LTCompile.CXX) -MD -MT $@ -MP -MF $(ObjDir)/$*.LACXXd $< -o $@ ; \
757 then $(MV) -f "$(ObjDir)/$*.LACXXd" "$(ObjDir)/$*.d"; \
758 else $(RM) -f "$(ObjDir)/$*.LACXXd"; exit 1; fi
Reid Spencer81cd0492004-10-23 20:04:14 +0000759
Reid Spencerf88808a2004-10-30 09:19:36 +0000760$(ObjDir)/%.lo $(ObjDir)/%.o: %.c $(ObjDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000761 $(Echo) "Compiling $*.c for $(BuildMode) build (PIC)"
Reid Spencerf88808a2004-10-30 09:19:36 +0000762 $(Verb) if $(LTCompile.C) -MD -MT $@ -MP -MF $(ObjDir)/$*.LACd $< -o $@ ; \
763 then $(MV) -f "$(ObjDir)/$*.LACd" "$(ObjDir)/$*.d"; \
764 else $(RM) -f "$(ObjDir)/$*.LACd"; exit 1; fi
Reid Spencer81cd0492004-10-23 20:04:14 +0000765
Reid Spencerf88808a2004-10-30 09:19:36 +0000766#---------------------------------------------------------
767# Create .o files in the ObjDir directory from the .cpp and .c files...
768#---------------------------------------------------------
Reid Spencer81cd0492004-10-23 20:04:14 +0000769else
Reid Spencerf206bd72004-10-22 21:01:56 +0000770
Reid Spencerf88808a2004-10-30 09:19:36 +0000771$(ObjDir)/%.o: %.cpp $(ObjDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000772 $(Echo) "Compiling $*.cpp for $(BuildMode) build"
Reid Spencerf88808a2004-10-30 09:19:36 +0000773 $(Verb) if $(Compile.CXX) -MD -MT $@ -MP -MF $(ObjDir)/$*.CXXd $< -o $@ ; \
774 then $(MV) -f "$(ObjDir)/$*.CXXd" "$(ObjDir)/$*.d"; \
775 else $(RM) -f "$(ObjDir)/$*.CXXd"; exit 1; fi
Reid Spencerf206bd72004-10-22 21:01:56 +0000776
Reid Spencerf88808a2004-10-30 09:19:36 +0000777$(ObjDir)/%.o: %.c $(ObjDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000778 $(Echo) "Compiling $*.c for $(BuildMode) build"
Reid Spencerf88808a2004-10-30 09:19:36 +0000779 $(Verb) if $(Compile.C) -MD -MT $@ -MP -MF $(ObjDir)/$*.Cd $< -o $@ ; \
780 then $(MV) -f "$(ObjDir)/$*.Cd" "$(ObjDir)/$*.d"; \
781 else $(RM) -f "$(ObjDir)/$*.Cd"; exit 1; fi
Reid Spencer81cd0492004-10-23 20:04:14 +0000782
783endif
Reid Spencerf206bd72004-10-22 21:01:56 +0000784
Reid Spencerf88808a2004-10-30 09:19:36 +0000785#---------------------------------------------------------
786# Create .bc files in the ObjDir directory from .cpp and .c files...
787#---------------------------------------------------------
Chris Lattner0ea40c92004-11-29 19:47:58 +0000788$(ObjDir)/%.bc: %.cpp $(ObjDir)/.dir $(GCCAS)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000789 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
Reid Spencerf88808a2004-10-30 09:19:36 +0000790 $(Verb) if $(BCCompile.CXX) -MD -MT $@ -MP -MF "$(ObjDir)/$*.BCCXXd" $< -o $@ ; \
791 then $(MV) -f "$(ObjDir)/$*.BCCXXd" "$(ObjDir)/$*.d"; \
792 else $(RM) -f "$(ObjDir)/$*.BCCXXd"; exit 1; fi
Reid Spencerf206bd72004-10-22 21:01:56 +0000793
Chris Lattner0ea40c92004-11-29 19:47:58 +0000794$(ObjDir)/%.bc: %.c $(ObjDir)/.dir $(GCCAS)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000795 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
Reid Spencerf88808a2004-10-30 09:19:36 +0000796 $(Verb) if $(BCCompile.C) -MD -MT $@ -MP -MF "$(ObjDir)/$*.BCCd" $< -o $@ ; \
797 then $(MV) -f "$(ObjDir)/$*.BCCd" "$(ObjDir)/$*.d"; \
798 else $(RM) -f "$(ObjDir)/$*.BCCd"; exit 1; fi
Reid Spencerf206bd72004-10-22 21:01:56 +0000799
Reid Spencerf88808a2004-10-30 09:19:36 +0000800# Provide alternate rule sets if dependencies are disabled
Reid Spencerf206bd72004-10-22 21:01:56 +0000801else
802
Reid Spencer81cd0492004-10-23 20:04:14 +0000803ifdef SHARED_LIBRARY
804
Reid Spencerf88808a2004-10-30 09:19:36 +0000805$(ObjDir)/%.lo $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000806 $(Echo) "Compiling $*.cpp for $(BuildMode) build (PIC)"
Reid Spencer81cd0492004-10-23 20:04:14 +0000807 $(LTCompile.CXX) $< -o $@
808
Reid Spencerf88808a2004-10-30 09:19:36 +0000809$(ObjDir)/%.lo $(ObjDir)/%.o: %.c $(ObjDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000810 $(Echo) "Compiling $*.cpp for $(BuildMode) build (PIC)"
Reid Spencer81cd0492004-10-23 20:04:14 +0000811 $(LTCompile.C) $< -o $@
812
813else
Reid Spencerf206bd72004-10-22 21:01:56 +0000814
Reid Spencerf88808a2004-10-30 09:19:36 +0000815$(ObjDir)/%.o: %.cpp $(ObjDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000816 $(Echo) "Compiling $*.cpp for $(BuildMode) build"
Reid Spencer81cd0492004-10-23 20:04:14 +0000817 $(Compile.CXX) $< -o $@
Reid Spencerf206bd72004-10-22 21:01:56 +0000818
Reid Spencerf88808a2004-10-30 09:19:36 +0000819$(ObjDir)/%.o: %.c $(ObjDir)/.dir
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000820 $(Echo) "Compiling $*.cpp for $(BuildMode) build"
Reid Spencer81cd0492004-10-23 20:04:14 +0000821 $(Compile.C) $< -o $@
822endif
Reid Spencerf206bd72004-10-22 21:01:56 +0000823
Chris Lattner0ea40c92004-11-29 19:47:58 +0000824$(ObjDir)/%.bc: %.cpp $(ObjDir)/.dir $(GCCAS)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000825 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
Reid Spencer991f66a2004-10-31 18:52:15 +0000826 $(BCCompile.CXX) $< -o $@
Reid Spencerf206bd72004-10-22 21:01:56 +0000827
Chris Lattner0ea40c92004-11-29 19:47:58 +0000828$(ObjDir)/%.bc: %.c $(ObjDir)/.dir $(GCCAS)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000829 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
Reid Spencer991f66a2004-10-31 18:52:15 +0000830 $(BCCompile.C) $< -o $@
Brian Gaeke0f148bc2003-12-10 00:26:28 +0000831
Chris Lattner07c7c192001-09-07 22:57:58 +0000832endif
833
Reid Spencerf88808a2004-10-30 09:19:36 +0000834#---------------------------------------------------------
835# Provide rule to build .bc files from .ll sources,
836# regardless of dependencies
837#---------------------------------------------------------
838$(ObjDir)/%.bc: %.ll $(ObjDir)/.dir $(LLVMAS)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000839 $(Echo) "Compiling $*.ll for $(BuildMode) build"
Reid Spencerf88808a2004-10-30 09:19:36 +0000840 $(Verb) $(LLVMAS) $< -f -o $@
841
842###############################################################################
843# TABLEGEN: Provide rules for running tblgen to produce *.inc files
844###############################################################################
Chris Lattner0c4f4fe2003-08-15 02:18:35 +0000845
Reid Spencerf206bd72004-10-22 21:01:56 +0000846ifdef TARGET
847
Reid Spencerf88808a2004-10-30 09:19:36 +0000848TDFiles := $(strip $(wildcard $(BUILD_SRC_DIR)/*.td) $(LLVM_SRC_ROOT)/lib/Target/Target.td)
849INCFiles := $(filter %.inc,$(BUILT_SOURCES))
Reid Spencerf206bd72004-10-22 21:01:56 +0000850
Reid Spencerf88808a2004-10-30 09:19:36 +0000851$(INCFiles) : $(TBLGEN) $(TDFiles)
Reid Spencerf206bd72004-10-22 21:01:56 +0000852
Reid Spencer94105c72004-10-27 04:34:35 +0000853%GenRegisterNames.inc : %.td
Reid Spencerf88808a2004-10-30 09:19:36 +0000854 $(Echo) "Building $(<F) register names with tblgen"
855 $(Verb) $(TableGen) -gen-register-enums -o $@ $<
Reid Spencerf206bd72004-10-22 21:01:56 +0000856
Reid Spencer94105c72004-10-27 04:34:35 +0000857%GenRegisterInfo.h.inc : %.td
Reid Spencerf88808a2004-10-30 09:19:36 +0000858 $(Echo) "Building $(<F) register information header with tblgen"
859 $(Verb) $(TableGen) -gen-register-desc-header -o $@ $<
Reid Spencerf206bd72004-10-22 21:01:56 +0000860
861%GenRegisterInfo.inc : %.td
Reid Spencerf88808a2004-10-30 09:19:36 +0000862 $(Echo) "Building $(<F) register info implementation with tblgen"
863 $(Verb) $(TableGen) -gen-register-desc -o $@ $<
Reid Spencerf206bd72004-10-22 21:01:56 +0000864
865%GenInstrNames.inc : %.td
Reid Spencerf88808a2004-10-30 09:19:36 +0000866 $(Echo) "Building $(<F) instruction names with tblgen"
867 $(Verb) $(TableGen) -gen-instr-enums -o $@ $<
Reid Spencerf206bd72004-10-22 21:01:56 +0000868
869%GenInstrInfo.inc : %.td
Reid Spencerf88808a2004-10-30 09:19:36 +0000870 $(Echo) "Building $(<F) instruction information with tblgen"
871 $(Verb) $(TableGen) -gen-instr-desc -o $@ $<
Reid Spencerf206bd72004-10-22 21:01:56 +0000872
873%GenAsmWriter.inc : %.td
Reid Spencerf88808a2004-10-30 09:19:36 +0000874 $(Echo) "Building $(<F) assembly writer with tblgen"
875 $(Verb) $(TableGen) -gen-asm-writer -o $@ $<
Reid Spencerf206bd72004-10-22 21:01:56 +0000876
877%GenATTAsmWriter.inc : %.td
Reid Spencerf88808a2004-10-30 09:19:36 +0000878 $(Echo) "Building $(<F) AT&T assembly writer with tblgen"
879 $(Verb) $(TableGen) -gen-asm-writer -o $@ $<
Reid Spencerf206bd72004-10-22 21:01:56 +0000880
881%GenIntelAsmWriter.inc : %.td
Reid Spencerf88808a2004-10-30 09:19:36 +0000882 $(Echo) "Building $(<F) Intel assembly writer with tblgen"
883 $(Verb) $(TableGen) -gen-asm-writer -asmwriternum=1 -o $@ $<
Reid Spencerf206bd72004-10-22 21:01:56 +0000884
885%GenInstrSelector.inc: %.td
Reid Spencerf88808a2004-10-30 09:19:36 +0000886 $(Echo) "Building $(<F) instruction selector with tblgen"
887 $(Verb) $(TableGen) -gen-instr-selector -o $@ $<
Reid Spencerf206bd72004-10-22 21:01:56 +0000888
889%GenCodeEmitter.inc:: %.td
Reid Spencerf88808a2004-10-30 09:19:36 +0000890 $(Echo) "Building $(<F) code emitter with tblgen"
891 $(Verb) $(TableGen) -gen-emitter -o $@ $<
Reid Spencerf206bd72004-10-22 21:01:56 +0000892
Reid Spencer81cd0492004-10-23 20:04:14 +0000893clean-local::
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000894 -$(Verb) $(RM) -f $(INCFiles)
Reid Spencerf206bd72004-10-22 21:01:56 +0000895
896endif
Chris Lattner0c4f4fe2003-08-15 02:18:35 +0000897
Reid Spencerf88808a2004-10-30 09:19:36 +0000898###############################################################################
899# LEX AND YACC: Provide rules for generating sources with lex and yacc
900###############################################################################
Chris Lattnerdb644dd2003-01-16 22:44:19 +0000901
Reid Spencerf88808a2004-10-30 09:19:36 +0000902#---------------------------------------------------------
903# Provide rules for generating a .cpp source file from
904# (f)lex input sources.
905#---------------------------------------------------------
906
Reid Spencer9d0c1e02004-11-02 16:36:03 +0000907LexFiles := $(filter %.l,$(Sources))
Reid Spencerf88808a2004-10-30 09:19:36 +0000908
Reid Spencer9d0c1e02004-11-02 16:36:03 +0000909ifneq ($(LexFiles),)
910
911LexOutput := $(strip $(patsubst %.l,%.cpp,$(LexFiles)))
Reid Spencerf88808a2004-10-30 09:19:36 +0000912
913.PRECIOUS: $(LexOutput)
914
915# Note the extra sed filtering here, used to cut down on the warnings emited
916# by GCC. The last line is a gross hack to work around flex aparently not
917# being able to resize the buffer on a large token input. Currently, for
918# uninitialized string buffers in LLVM we can generate very long tokens, so
919# this is a hack around it.
Chris Lattner92fc9b02003-08-15 20:00:47 +0000920# FIXME. (f.e. char Buffer[10000] )
Chris Lattner2f7c9632001-06-06 20:29:01 +0000921%.cpp: %.l
Reid Spencerf88808a2004-10-30 09:19:36 +0000922 $(Echo) Flexing $<
923 $(Verb) $(FLEX) -t $< | \
Reid Spencerf206bd72004-10-22 21:01:56 +0000924 $(SED) 's/void yyunput/inline void yyunput/' | \
925 $(SED) 's/void \*yy_flex_realloc/inline void *yy_flex_realloc/' | \
926 $(SED) 's/#define YY_BUF_SIZE 16384/#define YY_BUF_SIZE (16384*64)/' \
Reid Spencerb7f710a2004-10-28 00:41:43 +0000927 > $@
Chris Lattner2f7c9632001-06-06 20:29:01 +0000928
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000929clean-local::
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000930 -$(Verb) $(RM) -f $(LexOutput)
Reid Spencer9d0c1e02004-11-02 16:36:03 +0000931 $(Verb) $(RM) -f $(LexOutput)
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000932
Reid Spencerf88808a2004-10-30 09:19:36 +0000933endif
934
935#---------------------------------------------------------
936# Provide rules for generating a .cpp and .h source files
937# from yacc (bison) input sources.
938#---------------------------------------------------------
939
Reid Spencer9d0c1e02004-11-02 16:36:03 +0000940YaccFiles := $(filter %.y,$(Sources))
941ifneq ($(YaccFiles),)
942YaccOutput := $(addprefix $(patsubst %.y,%,$(YaccFiles)),.h .cpp .output)
Reid Spencerf88808a2004-10-30 09:19:36 +0000943
944.PRECIOUS: $(YaccOutput)
945
946# Cancel built-in rules for yacc
947%.c: %.y
948%.cpp: %.y
949%.h: %.y
950
Chris Lattner2f7c9632001-06-06 20:29:01 +0000951# Rule for building the bison parsers...
Chris Lattner2f7c9632001-06-06 20:29:01 +0000952%.cpp %.h : %.y
Reid Spencerf88808a2004-10-30 09:19:36 +0000953 $(Echo) "Bisoning $*.y"
954 $(Verb) $(BISON) -v -d -p $(<F:%Parser.y=%) -o $*.tab.c $<
955 $(Verb) $(MV) -f $*.tab.c $*.cpp
956 $(Verb) $(MV) -f $*.tab.h $*.h
Chris Lattner2f7c9632001-06-06 20:29:01 +0000957
Reid Spencerb5b92fb2004-11-01 07:50:27 +0000958clean-local::
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000959 -$(Verb) $(RM) -f $(YaccOutput)
Reid Spencer9d0c1e02004-11-02 16:36:03 +0000960 $(Verb) $(RM) -f $(YaccOutput)
Reid Spencerf88808a2004-10-30 09:19:36 +0000961endif
Chris Lattner2f7c9632001-06-06 20:29:01 +0000962
Reid Spencerf88808a2004-10-30 09:19:36 +0000963###############################################################################
964# OTHER RULES: Other rules needed
965###############################################################################
Reid Spencerf206bd72004-10-22 21:01:56 +0000966
Chris Lattner23d47392003-01-16 21:06:18 +0000967# To create postscript files from dot files...
John Criswell4ffb8442003-10-02 19:02:02 +0000968ifneq ($(DOT),false)
Chris Lattner23d47392003-01-16 21:06:18 +0000969%.ps: %.dot
Reid Spencerf206bd72004-10-22 21:01:56 +0000970 $(DOT) -Tps < $< > $@
John Criswell3ef61af2003-06-30 21:59:07 +0000971else
972%.ps: %.dot
Reid Spencerf88808a2004-10-30 09:19:36 +0000973 $(Echo) "Cannot build $@: The program dot is not installed"
John Criswell3ef61af2003-06-30 21:59:07 +0000974endif
Chris Lattner23d47392003-01-16 21:06:18 +0000975
John Criswell0a6e6aa2003-09-06 14:44:17 +0000976# This rules ensures that header files that are removed still have a rule for
977# which they can be "generated." This allows make to ignore them and
978# reproduce the dependency lists.
John Criswella8391af2003-09-18 18:37:08 +0000979%.h:: ;
John Criswell0a6e6aa2003-09-06 14:44:17 +0000980
Reid Spencerf88808a2004-10-30 09:19:36 +0000981# Define clean-local to clean the current directory. Note that this uses a
982# very conservative approach ensuring that empty variables do not cause
983# errors or disastrous removal.
Reid Spencer81cd0492004-10-23 20:04:14 +0000984clean-local::
Reid Spencerf88808a2004-10-30 09:19:36 +0000985ifneq ($(strip $(ObjDir)),)
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000986 -$(Verb) $(RM) -rf $(ObjDir)
Reid Spencer12a3a052004-10-24 07:53:21 +0000987endif
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000988 -$(Verb) $(RM) -f core core.[0-9][0-9]* *.o *.d *~ *.flc
Brian Gaeke8625f682004-01-21 19:53:11 +0000989ifneq ($(strip $(SHLIBEXT)),) # Extra paranoia - make real sure SHLIBEXT is set
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000990 -$(Verb) $(RM) -f *$(SHLIBEXT)
Brian Gaeke8625f682004-01-21 19:53:11 +0000991endif
John Criswell3ef61af2003-06-30 21:59:07 +0000992
Reid Spencer9d0c1e02004-11-02 16:36:03 +0000993clean-all-local::
Reid Spencer651dd3ad2004-11-02 16:56:15 +0000994 -$(Verb) $(RM) -rf Debug Release Profile
Reid Spencer9d0c1e02004-11-02 16:36:03 +0000995
Reid Spencerf88808a2004-10-30 09:19:36 +0000996# Build tags database for Emacs/Xemacs:
Reid Spenceraee67e62004-11-12 02:27:36 +0000997tags:: TAGS CTAGS
998
Reid Spencerf88808a2004-10-30 09:19:36 +0000999TAGS:
Reid Spenceraee67e62004-11-12 02:27:36 +00001000 find $(BUILD_SRC_ROOT)/include $(BUILD_SRC_ROOT)/lib \
1001 $(BUILD_SRC_ROOT)/tools $(BUILD_SRC_ROOT)/examples \
1002 $(BUILD_OBJ_ROOT)/include $(BUILD_OBJ_ROOT)/lib \
1003 $(BUILD_OBJ_ROOT)/tools $(BUILD_OBJ_ROOT)/examples \
1004 -name '*.cpp' -o -name '*.h' | \
Reid Spencerf88808a2004-10-30 09:19:36 +00001005 $(ETAGS) $(ETAGSFLAGS) -
1006
Reid Spenceraee67e62004-11-12 02:27:36 +00001007CTAGS:
1008 find $(BUILD_SRC_ROOT)/include $(BUILD_SRC_ROOT)/lib \
1009 $(BUILD_SRC_ROOT)/tools $(BUILD_SRC_ROOT)/examples \
1010 $(BUILD_OBJ_ROOT)/include $(BUILD_OBJ_ROOT)/lib \
1011 $(BUILD_OBJ_ROOT)/tools $(BUILD_OBJ_ROOT)/examples \
1012 \( -name '*.cpp' -o -name '*.h' \) -print | \
1013 ctags -ImtT -o $(BUILD_OBJ_ROOT)/CTAGS -L -
1014
1015
Reid Spencer81cd0492004-10-23 20:04:14 +00001016###############################################################################
1017# DEPENDENCIES: Include the dependency files if we should
1018###############################################################################
Chris Lattnere9d7d702003-08-22 14:10:16 +00001019ifndef DISABLE_AUTO_DEPENDENCIES
1020
Reid Spencer81cd0492004-10-23 20:04:14 +00001021# If its not one of the cleaning targets
Reid Spencerf88808a2004-10-30 09:19:36 +00001022ifneq ($strip($(filter-out clean clean-local dist-clean,$(MAKECMDGOALS))),)
Reid Spencerf206bd72004-10-22 21:01:56 +00001023
Reid Spencer81cd0492004-10-23 20:04:14 +00001024# Get the list of dependency files
Reid Spencerf88808a2004-10-30 09:19:36 +00001025DependFiles := $(basename $(filter %.cpp %.c %.cc, $(Sources)))
Reid Spencerb5b92fb2004-11-01 07:50:27 +00001026DependFiles := $(patsubst %,$(BUILD_OBJ_DIR)/$(BuildMode)/%.d,$(DependFiles))
Misha Brukmanb891ffb2003-11-09 21:36:19 +00001027
Reid Spencer81cd0492004-10-23 20:04:14 +00001028-include /dev/null $(DependFiles)
1029
John Criswell48ecca62003-08-12 18:51:51 +00001030endif
Chris Lattner598222b2003-08-18 17:27:40 +00001031
Reid Spencerf88808a2004-10-30 09:19:36 +00001032endif
Reid Spencerf206bd72004-10-22 21:01:56 +00001033
Reid Spencer100080c2004-10-25 08:27:37 +00001034###############################################################################
Reid Spencerf88808a2004-10-30 09:19:36 +00001035# DISTRIBUTION: Handle construction of a distribution tarball
Reid Spencer100080c2004-10-25 08:27:37 +00001036###############################################################################
1037
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001038#------------------------------------------------------------------------
1039# Define distribution related variables
1040#------------------------------------------------------------------------
Reid Spencer100080c2004-10-25 08:27:37 +00001041DistName := $(LLVM_TARBALL_NAME)
1042DistDir := $(BUILD_OBJ_ROOT)/$(DistName)
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001043TopDistDir := $(BUILD_OBJ_ROOT)/$(DistName)
Reid Spencer100080c2004-10-25 08:27:37 +00001044DistTarGZip := $(BUILD_OBJ_ROOT)/$(DistName).tar.gz
1045DistZip := $(BUILD_OBJ_ROOT)/$(DistName).zip
1046DistTarBZ2 := $(BUILD_OBJ_ROOT)/$(DistName).tar.bz2
1047DistAlways := CREDITS.TXT LICENSE.TXT README.txt README AUTHORS COPYING \
1048 ChangeLog INSTALL NEWS Makefile Makefile.common Makefile.rules \
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001049 Makefile.config.in configure autoconf
1050DistOther := $(notdir $(wildcard \
1051 $(BUILD_SRC_DIR)/*.h \
1052 $(BUILD_SRC_DIR)/*.td \
1053 $(BUILD_SRC_DIR)/*.def \
1054 $(BUILD_SRC_DIR)/*.ll \
1055 $(BUILD_SRC_DIR)/*.in))
Reid Spencerf88808a2004-10-30 09:19:36 +00001056DistSubDirs := $(SubDirs)
Reid Spencerfc66af42004-11-29 05:00:33 +00001057DistSources = $(Sources) $(EXTRA_DIST)
1058DistFiles = $(DistAlways) $(DistSources) $(DistOther)
Reid Spencer100080c2004-10-25 08:27:37 +00001059
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001060#------------------------------------------------------------------------
1061# We MUST build distribution with OBJ_DIR != SRC_DIR
1062#------------------------------------------------------------------------
1063ifeq ($(BUILD_SRC_DIR),$(BUILD_OBJ_DIR))
1064dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
Reid Spencerf88808a2004-10-30 09:19:36 +00001065 $(Echo) ERROR: Target $@ only available with OBJ_DIR != SRC_DIR
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001066
1067DistCheckTop :=
1068else
1069
1070DistCheckTop := check
Reid Spencerf88808a2004-10-30 09:19:36 +00001071
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001072#------------------------------------------------------------------------
1073# Prevent catastrophic remove
1074#------------------------------------------------------------------------
1075ifeq ($(LLVM_TARBALL_NAME),)
1076$(error LLVM_TARBALL_NAME is empty. Please rerun configure)
1077endif
1078
1079#------------------------------------------------------------------------
1080# Prevent attempt to run dist targets from anywhere but the top level
1081#------------------------------------------------------------------------
1082ifneq ($(LEVEL),.)
1083
1084dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
Reid Spencerf88808a2004-10-30 09:19:36 +00001085 $(Echo) ERROR: You must run $@ from $(BUILD_OBJ_ROOT)
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001086
1087else
1088
1089#------------------------------------------------------------------------
1090# Provide the top level targets
1091#------------------------------------------------------------------------
1092
Reid Spencerf88808a2004-10-30 09:19:36 +00001093dist-gzip:: $(DistTarGZip)
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001094
1095$(DistTarGZip) : distdir
Reid Spencerf88808a2004-10-30 09:19:36 +00001096 $(Echo) Packing gzipped distribution tar file.
Reid Spencerfc66af42004-11-29 05:00:33 +00001097 $(Verb) cd $(BUILD_OBJ_ROOT) ; $(TAR) chf - "$(DistName)" | \
1098 $(GZIP) -c > "$(DistTarGZip)"
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001099
Reid Spencerf88808a2004-10-30 09:19:36 +00001100dist-bzip2:: $(DistTarBZ2)
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001101
1102$(DistTarBZ2) : distdir
Reid Spencerf88808a2004-10-30 09:19:36 +00001103 $(Echo) Packing bzipped distribution tar file.
Reid Spencerfc66af42004-11-29 05:00:33 +00001104 $(Verb) cd $(BUILD_OBJ_ROOT) ; $(TAR) chf - $(DistName) | \
1105 $(BZIP2) -c >$(DistTarBZ2)
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001106
Reid Spencerf88808a2004-10-30 09:19:36 +00001107dist-zip:: $(DistZip)
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001108
1109$(DistZip) : distdir
Reid Spencerf88808a2004-10-30 09:19:36 +00001110 $(Echo) Packing zipped distribution file.
1111 $(Verb) rm -f $(DistZip)
1112 $(Verb) cd $(BUILD_OBJ_ROOT) ; $(ZIP) -rq $(DistZip) $(DistName)
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001113
1114dist :: $(DistTarGZip) $(DistTarBZ2) $(DistZip)
Reid Spencerf88808a2004-10-30 09:19:36 +00001115 $(Echo) ===== DISTRIBUTION PACKAGING SUCESSFUL =====
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001116
1117DistCheckDir := $(LLVM_OBJ_ROOT)/_distcheckdir
1118
Reid Spencer77a46d22004-10-26 22:26:33 +00001119dist-check:: $(DistCheckTop) $(DistTarGZip)
Reid Spencerf88808a2004-10-30 09:19:36 +00001120 $(Echo) Checking distribution tar file.
1121 $(Verb) if test -d $(DistCheckDir) ; then \
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001122 $(RM) -rf $(DistCheckDir) ; \
1123 fi
Reid Spencerf88808a2004-10-30 09:19:36 +00001124 $(Verb) $(MKDIR) $(DistCheckDir)
1125 $(Verb) cd $(DistCheckDir) && \
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001126 $(MKDIR) $(DistCheckDir)/build && \
1127 $(MKDIR) $(DistCheckDir)/install && \
1128 gunzip -c $(DistTarGZip) | $(TAR) xf - && \
1129 cd build && \
1130 ../$(DistName)/configure --prefix="$(DistCheckDir)/install" \
1131 --srcdir=../$(DistName) --with-llvmgccdir="$(LLVMGCCDIR)" && \
1132 $(MAKE) check && \
1133 $(MAKE) install && \
1134 $(MAKE) uninstall && \
1135 $(MAKE) dist && \
1136 $(MAKE) clean && \
1137 $(MAKE) dist-clean && \
Reid Spencerf88808a2004-10-30 09:19:36 +00001138 $(EchoCmd) ===== $(DistTarGZip) Ready For Distribution =====
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001139
1140dist-clean::
Reid Spencerf88808a2004-10-30 09:19:36 +00001141 $(Echo) Cleaning distribution files
Reid Spencer651dd3ad2004-11-02 16:56:15 +00001142 -$(Verb) $(RM) -rf $(DistTarGZip) $(DistTarBZ2) $(DistZip) $(DistName) $(DistCheckDir)
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001143
1144endif
1145
1146#------------------------------------------------------------------------
1147# Provide the recursive distdir target for building the distribution directory
1148#------------------------------------------------------------------------
Reid Spencer77a46d22004-10-26 22:26:33 +00001149distdir : $(DistSources)
Reid Spencerf88808a2004-10-30 09:19:36 +00001150 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001151 if test -d "$(DistDir)" ; then \
1152 find $(DistDir) -type d ! -perm -200 -exec chmod u+w {} ';' || \
1153 exit 1 ; \
1154 fi ; \
Reid Spencerf88808a2004-10-30 09:19:36 +00001155 $(EchoCmd) Removing $(DistDir) ; \
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001156 $(RM) -rf $(DistDir); \
1157 fi
Reid Spencerfc66af42004-11-29 05:00:33 +00001158 $(Echo) Building Distribution Directory $(DistDir)
Reid Spencerf88808a2004-10-30 09:19:36 +00001159 $(Verb) $(MKDIR) $(DistDir)
1160 $(Verb) srcdirstrip=`echo "$(BUILD_SRC_DIR)" | sed 's|.|.|g'`; \
Reid Spencer100080c2004-10-25 08:27:37 +00001161 srcrootstrip=`echo "$(BUILD_SRC_ROOT)" | sed 's|.|.|g'`; \
1162 for file in $(DistFiles) ; do \
1163 case "$$file" in \
1164 $(BUILD_SRC_DIR)/*) file=`echo "$$file" | sed "s#^$$srcdirstrip/##"`;; \
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001165 $(BUILD_SRC_ROOT)/*) file=`echo "$$file" | sed "s#^$$srcrootstrip/#$(BUILD_OBJ_ROOT)/#"`;; \
Reid Spencer100080c2004-10-25 08:27:37 +00001166 esac; \
1167 if test -f "$$file" || test -d "$$file" ; then \
1168 from_dir=. ; \
1169 else \
1170 from_dir=$(BUILD_SRC_DIR); \
1171 fi; \
1172 to_dir=`echo "$$file" | sed -e 's#/[^/]*$$##'`; \
1173 if test "$$to_dir" != "$$file" && test "$$to_dir" != "."; then \
1174 to_dir="$(DistDir)/$$dir"; \
1175 $(MKDIR) "$$to_dir" ; \
1176 else \
1177 to_dir="$(DistDir)"; \
1178 fi; \
1179 mid_dir=`echo "$$file" | sed -n -e 's#^\(.*\)/[^/]*$$#\1#p'`; \
1180 if test -n "$$mid_dir" ; then \
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001181 $(MKDIR) "$$to_dir/$$mid_dir" || exit 1; \
Reid Spencer100080c2004-10-25 08:27:37 +00001182 fi ; \
1183 if test -d "$$from_dir/$$file"; then \
1184 if test -d "$(BUILD_SRC_DIR)/$$file" && \
1185 test "$$from_dir" != "$(BUILD_SRC_DIR)" ; then \
1186 cp -pR "$(BUILD_SRC_DIR)/$$file" "$$to_dir" || exit 1; \
1187 fi; \
1188 cp -pR $$from_dir/$$file $$to_dir || exit 1; \
1189 elif test -f "$$from_dir/$$file" ; then \
1190 cp -p "$$from_dir/$$file" "$(DistDir)/$$file" || exit 1; \
1191 elif test -L "$$from_dir/$$file" ; then \
1192 cp -pd "$$from_dir/$$file" $(DistDir)/$$file || exit 1; \
1193 elif echo "$(DistAlways)" | grep -v "$$file" >/dev/null ; then \
Reid Spencerf88808a2004-10-30 09:19:36 +00001194 $(EchoCmd) "===== WARNING: Distribution Source $$from_dir/$$file Not Found!" ; \
1195 elif test "$(Verb)" != '@' ; then \
1196 $(EchoCmd) "Skipping non-existent $$from_dir/$$file" ; \
Reid Spencer100080c2004-10-25 08:27:37 +00001197 fi; \
1198 done
Reid Spencerf88808a2004-10-30 09:19:36 +00001199 $(Verb) for subdir in $(DistSubDirs) ; do \
Reid Spencer100080c2004-10-25 08:27:37 +00001200 if test "$$subdir" \!= "." ; then \
Reid Spencer100080c2004-10-25 08:27:37 +00001201 new_distdir="$(DistDir)/$$subdir" ; \
Reid Spencer8da1b5d2004-10-26 07:09:33 +00001202 test -d "$$new_distdir" || $(MKDIR) "$$new_distdir" || exit 1; \
1203 ( cd $$subdir && $(MAKE) DistDir="$$new_distdir" distdir ) || exit 1; \
Reid Spencer100080c2004-10-25 08:27:37 +00001204 fi; \
1205 done
Reid Spencerf88808a2004-10-30 09:19:36 +00001206 $(Verb) $(MAKE) DistDir="$(DistDir)" dist-hook || exit 1
1207 -$(Verb) find $(DistDir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
Reid Spencer100080c2004-10-25 08:27:37 +00001208 ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
1209 ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
1210 ! -type d ! -perm -444 -exec $(SHELL) $(INSTALL_SH) -c -m a+r {} {} \; \
1211 || chmod -R a+r $(DistDir)
1212
Reid Spencerf88808a2004-10-30 09:19:36 +00001213# This is invoked by distdir target, define it as a no-op to avoid errors if not
1214# defined by user.
Reid Spencer100080c2004-10-25 08:27:37 +00001215dist-hook::
1216
Reid Spencer23a70372004-10-22 23:06:30 +00001217endif
Reid Spencerf206bd72004-10-22 21:01:56 +00001218
1219###############################################################################
Reid Spencer12a3a052004-10-24 07:53:21 +00001220# TOP LEVEL - targets only to apply at the top level directory
1221###############################################################################
1222
1223ifeq ($(LEVEL),.)
1224
1225#------------------------------------------------------------------------
Reid Spencer12a3a052004-10-24 07:53:21 +00001226# Install support for project's include files:
1227#------------------------------------------------------------------------
1228install-local::
Reid Spencerf88808a2004-10-30 09:19:36 +00001229 $(Echo) Installing include files
1230 $(Verb) $(MKDIR) $(includedir)
1231 $(Verb) if [ -d "$(BUILD_SRC_ROOT)/include" ] ; then \
Reid Spencer12a3a052004-10-24 07:53:21 +00001232 cd $(BUILD_SRC_ROOT)/include && \
1233 find . -path '*/Internal' -prune -o '(' -type f \
1234 '!' '(' -name '*~' -o -name '.cvsignore' -o -name '.#*' ')' \
1235 -print ')' | grep -v CVS | pax -rwdvpe $(includedir) ; \
1236 fi
1237
1238uninstall-local::
Reid Spencerf88808a2004-10-30 09:19:36 +00001239 $(Echo) Uninstalling include files
1240 $(Verb) if [ -d "$(BUILD_SRC_ROOT)/include" ] ; then \
Reid Spencer12a3a052004-10-24 07:53:21 +00001241 cd $(BUILD_SRC_ROOT)/include && \
1242 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f \
1243 '!' '(' -name '*~' -o -name '.cvsignore' -o -name '.#*' ')' \
1244 -print ')' | grep -v CVS | sed 's#^#$(includedir)/#'` ; \
1245 fi
1246
Reid Spencer12a3a052004-10-24 07:53:21 +00001247endif
1248
Reid Spencerf206bd72004-10-22 21:01:56 +00001249#------------------------------------------------------------------------
1250# Print out the directories used for building
Reid Spencerf88808a2004-10-30 09:19:36 +00001251#------------------------------------------------------------------------
Reid Spencer81cd0492004-10-23 20:04:14 +00001252printvars::
Reid Spencerb5b92fb2004-11-01 07:50:27 +00001253 $(Echo) "BuildMode : " '$(BuildMode)'
Reid Spencerf88808a2004-10-30 09:19:36 +00001254 $(Echo) "BUILD_SRC_ROOT : " '$(BUILD_SRC_ROOT)'
1255 $(Echo) "BUILD_SRC_DIR : " '$(BUILD_SRC_DIR)'
1256 $(Echo) "BUILD_OBJ_ROOT : " '$(BUILD_OBJ_ROOT)'
1257 $(Echo) "BUILD_OBJ_DIR : " '$(BUILD_OBJ_DIR)'
1258 $(Echo) "LLVM_SRC_ROOT : " '$(LLVM_SRC_ROOT)'
1259 $(Echo) "LLVM_OBJ_ROOT : " '$(LLVM_OBJ_ROOT)'
1260 $(Echo) "libdir : " '$(libdir)'
1261 $(Echo) "bindir : " '$(bindir)'
1262 $(Echo) "sysconfdir : " '$(sysconfdir)'
1263 $(Echo) "bytecode_libdir: " '$(bytecode_libdir)'
1264 $(Echo) "UserTargets : " '$(UserTargets)'
1265 $(Echo) "ObjMakefiles : " '$(ObjMakefiles)'
1266 $(Echo) "SrcMakefiles : " '$(SrcMakefiles)'
1267 $(Echo) "ObjDir : " '$(ObjDir)'
1268 $(Echo) "LibDir : " '$(LibDir)'
1269 $(Echo) "ToolDir : " '$(ToolDir)'
Reid Spencer7e9e0b02004-11-18 10:03:46 +00001270 $(Echo) "ExmplDir : " '$(ExmplDir)'
Reid Spencerf88808a2004-10-30 09:19:36 +00001271 $(Echo) "TDFiles : " '$(TDFiles)'
1272 $(Echo) "INCFiles : " '$(INCFiles)'
1273 $(Echo) "Compile.CXX : " '$(Compile.CXX)'
1274 $(Echo) "Compile.C : " '$(Compile.C)'
1275 $(Echo) "Archive : " '$(Archive)'
Reid Spencer9d0c1e02004-11-02 16:36:03 +00001276 $(Echo) "YaccFiles : " '$(YaccFiles)'
1277 $(Echo) "LexFiles : " '$(LexFiles)'