blob: fc6598bb672211342aeb28ac2de160aee2036bc5 [file] [log] [blame]
Misha Brukman6d5ab862004-04-24 00:10:56 +00001#===-- Makefile.rules - Common make rules for LLVM ---------*- Makefile -*--===#
2#
John Criswelld8846c12003-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 Brukman6d5ab862004-04-24 00:10:56 +00008#===------------------------------------------------------------------------===#
Chris Lattner00950542001-06-06 20:29:01 +00009#
Reid Spencer3a561f52004-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 Lattneraf06a082003-08-15 03:02:52 +000012#
Vikram S. Adved60aede2002-07-09 12:04:21 +000013#===-----------------------------------------------------------------------====
Chris Lattner00950542001-06-06 20:29:01 +000014
Reid Spencercc2d1e22004-10-30 09:19:36 +000015################################################################################
Reid Spencer3a561f52004-10-23 20:04:14 +000016# TARGETS: Define standard targets that can be invoked
Reid Spencercc2d1e22004-10-30 09:19:36 +000017################################################################################
John Criswell7a73b802003-06-30 21:59:07 +000018
Chris Lattner00950542001-06-06 20:29:01 +000019#--------------------------------------------------------------------
Reid Spencer3a561f52004-10-23 20:04:14 +000020# Define the various target sets
21#--------------------------------------------------------------------
Reid Spencer3d659492004-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 Spencercc2d1e22004-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 Spencer3a561f52004-10-23 20:04:14 +000029
Reid Spencercc2d1e22004-10-30 09:19:36 +000030################################################################################
Reid Spencer9411c642004-10-26 22:26:33 +000031# INITIALIZATION: Basic things the makefile needs
Reid Spencercc2d1e22004-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 Spencer9411c642004-10-26 22:26:33 +000038
39#--------------------------------------------------------------------
40# Reset the list of suffixes we know how to build
41#--------------------------------------------------------------------
42.SUFFIXES:
Reid Spencercc2d1e22004-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 Spencer9411c642004-10-26 22:26:33 +000045
Reid Spencer3a561f52004-10-23 20:04:14 +000046#--------------------------------------------------------------------
47# Mark all of these targets as phony to avoid implicit rule search
48#--------------------------------------------------------------------
Reid Spencercc2d1e22004-10-30 09:19:36 +000049.PHONY: $(UserTargets) $(InternalTargets)
Reid Spencer3a561f52004-10-23 20:04:14 +000050
51#--------------------------------------------------------------------
Reid Spencer9411c642004-10-26 22:26:33 +000052# Make sure all the user-target rules are double colon rules and
53# they are defined first.
Reid Spencer3a561f52004-10-23 20:04:14 +000054#--------------------------------------------------------------------
55
Reid Spencercc2d1e22004-10-30 09:19:36 +000056$(UserTargets)::
Reid Spencer151f8ba2004-10-25 08:27:37 +000057
Reid Spencer9411c642004-10-26 22:26:33 +000058################################################################################
59# PRECONDITIONS: that which must be built/checked first
60################################################################################
61
Reid Spencer023c4462004-11-17 19:08:44 +000062SrcMakefiles := $(filter %Makefile %Makefile.tests %Makefile.JIT,\
63 $(wildcard $(BUILD_SRC_DIR)/Makefile*))
Reid Spencercc2d1e22004-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 Spencer9411c642004-10-26 22:26:33 +000070
Reid Spencercc2d1e22004-10-30 09:19:36 +000071preconditions : $(PreConditions)
Reid Spencer9411c642004-10-26 22:26:33 +000072
73#------------------------------------------------------------------------
74# Make sure the BUILT_SOURCES are built first
75#------------------------------------------------------------------------
Reid Spencercc2d1e22004-10-30 09:19:36 +000076$(filter-out clean clean-local,UserTargets):: $(BUILT_SOURCES)
Reid Spencer9411c642004-10-26 22:26:33 +000077
78clean-local::
79ifneq ($(strip $(BUILT_SOURCES)),)
Reid Spencerca5fe8f2004-11-02 16:56:15 +000080 -$(Verb) $(RM) -f $(BUILT_SOURCES)
Reid Spencer9411c642004-10-26 22:26:33 +000081endif
82
Reid Spencercc2d1e22004-10-30 09:19:36 +000083$(BUILT_SOURCES) : $(ObjMakefiles)
Reid Spencer80f0ef72004-10-28 00:41:43 +000084
Reid Spencer9411c642004-10-26 22:26:33 +000085#------------------------------------------------------------------------
86# Make sure we're not using a stale configuration
87#------------------------------------------------------------------------
Reid Spencercc2d1e22004-10-30 09:19:36 +000088.PRECIOUS: $(ConfigStatusScript)
89$(ConfigStatusScript): $(ConfigureScript)
90 $(Echo) Reconfiguring with $<
Reid Spencer7d277002004-11-29 12:37:44 +000091 $(Verb) cd $(BUILD_OBJ_ROOT) && \
92 $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
93 $(ConfigStatusScript)
Reid Spencer9411c642004-10-26 22:26:33 +000094
95#------------------------------------------------------------------------
96# Make sure the configuration makefile is up to date
97#------------------------------------------------------------------------
Reid Spencercc2d1e22004-10-30 09:19:36 +000098$(MakefileConfig): $(MakefileConfigIn) $(ConfigStatusScript)
99 $(Echo) Regenerating $@
100 $(Verb) cd $(LLVM_OBJ_ROOT) ; $(ConfigStatusScript) Makefile.config
Reid Spencer9411c642004-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 Spencer023c4462004-11-17 19:08:44 +0000108Makefile: $(BUILD_SRC_DIR)/Makefile
Reid Spencercc2d1e22004-10-30 09:19:36 +0000109 $(Echo) "Updating Makefile"
110 $(Verb) $(MKDIR) $(@D)
111 $(Verb) cp -f $< $@
Reid Spencer9411c642004-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 Spencer9411c642004-10-26 22:26:33 +0000116$(BUILD_OBJ_DIR)/Makefile% : $(BUILD_SRC_DIR)/Makefile%
Reid Spencer86606782004-10-26 23:10:00 +0000117 @case '$?' in \
118 *Makefile.rules) ;; \
119 *.in) ;; \
Reid Spencercc2d1e22004-10-30 09:19:36 +0000120 *) $(Echo) "Updating $(@F)" ; \
Reid Spencer86606782004-10-26 23:10:00 +0000121 $(MKDIR) $(@D) ; \
122 cp -f $< $@ ;; \
123 esac
124
Reid Spencer9411c642004-10-26 22:26:33 +0000125endif
126
127#------------------------------------------------------------------------
128# Set up the basic dependencies
129#------------------------------------------------------------------------
Reid Spencercc2d1e22004-10-30 09:19:36 +0000130$(UserTargets):: $(PreConditions)
Reid Spencer9411c642004-10-26 22:26:33 +0000131
132all:: all-local
Reid Spencer3a561f52004-10-23 20:04:14 +0000133check:: check-local
134clean:: clean-local
Reid Spencer3d659492004-11-02 16:36:03 +0000135clean-all:: clean-local clean-all-local
Reid Spencer9411c642004-10-26 22:26:33 +0000136install:: install-local
137uninstall:: uninstall-local
138check-local:: all-local
139install-local:: all-local
Reid Spencer3a561f52004-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 Lattner00950542001-06-06 20:29:01 +0000147#--------------------------------------------------------------------
148
Chris Lattner760da062003-03-14 20:25:22 +0000149ifdef ENABLE_PROFILING
Reid Spencer9af3b292004-11-01 07:50:27 +0000150 BuildMode := Profile
Reid Spencercc2d1e22004-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 Lattner760da062003-03-14 20:25:22 +0000154else
155 ifdef ENABLE_OPTIMIZED
Reid Spencer9af3b292004-11-01 07:50:27 +0000156 BuildMode := Release
Reid Spencercc2d1e22004-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 Lattner760da062003-03-14 20:25:22 +0000160 else
Reid Spencer9af3b292004-11-01 07:50:27 +0000161 BuildMode := Debug
Reid Spencercc2d1e22004-10-30 09:19:36 +0000162 CXX.Flags := -g -D_DEBUG
163 C.Flags := -g -D_DEBUG
164 LD.Flags := -g -D_DEBUG
Reid Spencer4d71b662004-10-22 21:01:56 +0000165 KEEP_SYMBOLS := 1
Chris Lattner760da062003-03-14 20:25:22 +0000166 endif
167endif
168
Reid Spencercc2d1e22004-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 Spencer3a561f52004-10-23 20:04:14 +0000175
176#--------------------------------------------------------------------
Reid Spencer4d71b662004-10-22 21:01:56 +0000177# Directory locations
Reid Spencer3a561f52004-10-23 20:04:14 +0000178#--------------------------------------------------------------------
Reid Spencer9af3b292004-11-01 07:50:27 +0000179ObjDir := $(BUILD_OBJ_DIR)/$(BuildMode)
Reid Spencer815cbcf2004-11-18 10:03:46 +0000180LibDir := $(BUILD_OBJ_ROOT)/$(BuildMode)/lib
Reid Spencer9a5acaf2004-11-18 20:04:39 +0000181ToolDir := $(BUILD_OBJ_ROOT)/$(BuildMode)/bin
Reid Spencer815cbcf2004-11-18 10:03:46 +0000182ExmplDir := $(BUILD_OBJ_ROOT)/$(BuildMode)/examples
183LLVMLibDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/lib
Reid Spencer9a5acaf2004-11-18 20:04:39 +0000184LLVMToolDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/bin
Reid Spencer815cbcf2004-11-18 10:03:46 +0000185LExmplDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/examples
John Criswell7a73b802003-06-30 21:59:07 +0000186
Reid Spencer3a561f52004-10-23 20:04:14 +0000187#--------------------------------------------------------------------
Reid Spencer4d71b662004-10-22 21:01:56 +0000188# Full Paths To Compiled Tools and Utilities
Reid Spencer3a561f52004-10-23 20:04:14 +0000189#--------------------------------------------------------------------
Reid Spencercc2d1e22004-10-30 09:19:36 +0000190EchoCmd := $(ECHO) llvm[$(MAKELEVEL)]:
191Echo := @$(EchoCmd)
192ifndef LIBTOOL
Reid Spencer4d71b662004-10-22 21:01:56 +0000193LIBTOOL := $(LLVM_OBJ_ROOT)/mklib
Reid Spencercc2d1e22004-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 Lattner478b3b42004-11-29 19:47:58 +0000204ifndef GCCAS
205GCCAS := $(LLVMToolDir)/gccas$(EXEEXT)
206endif
Reid Spencercc2d1e22004-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 Dhurjatiffb55cd2003-05-29 16:18:20 +0000216
Reid Spencer4d71b662004-10-22 21:01:56 +0000217# Need a better way to compute this.
Reid Spencercc2d1e22004-10-30 09:19:36 +0000218LLVMGCCLibDir := $(dir $(shell $(LLVMGCC) -print-file-name=libgcc.a))/
Dinakar Dhurjatiffb55cd2003-05-29 16:18:20 +0000219
Reid Spencer3a561f52004-10-23 20:04:14 +0000220#--------------------------------------------------------------------
Reid Spencer4d71b662004-10-22 21:01:56 +0000221# Adjust to user's request
Reid Spencer3a561f52004-10-23 20:04:14 +0000222#--------------------------------------------------------------------
Dinakar Dhurjatiffb55cd2003-05-29 16:18:20 +0000223
Reid Spencercc2d1e22004-10-30 09:19:36 +0000224# Adjust LIBTOOL flags for shared libraries, or not.
John Criswell82f4a5a2003-07-31 20:58:51 +0000225ifndef SHARED_LIBRARY
Reid Spencercc2d1e22004-10-30 09:19:36 +0000226 LibTool.Flags += --tag=disable-shared
Reid Spencer4d71b662004-10-22 21:01:56 +0000227else
Reid Spencercc2d1e22004-10-30 09:19:36 +0000228 LD.Flags += -rpath $(LibDir)
John Criswell82f4a5a2003-07-31 20:58:51 +0000229endif
230
Reid Spencercceed9f2004-11-08 17:32:12 +0000231ifdef TOOL_VERBOSE
232 C.Flags += -v
233 CXX.Flags += -v
234 LD.Flags += -v
Reid Spencercceed9f2004-11-08 17:32:12 +0000235 VERBOSE := 1
Reid Spencer9a2f1372004-12-02 09:28:21 +0000236else
Reid Spencercceed9f2004-11-08 17:32:12 +0000237endif
238
Reid Spencer3a561f52004-10-23 20:04:14 +0000239# Adjust settings for verbose mode
Chris Lattner760da062003-03-14 20:25:22 +0000240ifndef VERBOSE
Reid Spencercc2d1e22004-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 Spencer151f8ba2004-10-25 08:27:37 +0000245else
Reid Spencercc2d1e22004-10-30 09:19:36 +0000246 ConfigureScriptFLAGS :=
Misha Brukmanb5f096f2002-09-12 16:05:39 +0000247endif
248
Vikram S. Advefeeae582002-09-18 11:55:13 +0000249# By default, strip symbol information from executable
Chris Lattner760da062003-03-14 20:25:22 +0000250ifndef KEEP_SYMBOLS
Reid Spencercc2d1e22004-10-30 09:19:36 +0000251 Strip := $(PLATFORMSTRIPOPTS)
252 StripWarnMsg := "(without symbols)"
Vikram S. Advefeeae582002-09-18 11:55:13 +0000253endif
254
Reid Spencer3a561f52004-10-23 20:04:14 +0000255# Adjust linker flags for building an executable
Reid Spencer4d71b662004-10-22 21:01:56 +0000256ifdef TOOLNAME
Reid Spencer815cbcf2004-11-18 10:03:46 +0000257ifdef EXAMPLE_TOOL
258 LD.Flags += -rpath $(ExmplDir) -export-dynamic
259else
Reid Spencercc2d1e22004-10-30 09:19:36 +0000260 LD.Flags += -rpath $(ToolDir) -export-dynamic
Dinakar Dhurjati87ea8aa2003-10-29 14:28:35 +0000261endif
Reid Spencer815cbcf2004-11-18 10:03:46 +0000262endif
Dinakar Dhurjati87ea8aa2003-10-29 14:28:35 +0000263
Reid Spencer3a561f52004-10-23 20:04:14 +0000264#----------------------------------------------------------
Reid Spencer4d71b662004-10-22 21:01:56 +0000265# Options To Invoke Tools
Reid Spencer3a561f52004-10-23 20:04:14 +0000266#----------------------------------------------------------
Reid Spencer4d71b662004-10-22 21:01:56 +0000267
268CompileCommonOpts := -Wall -W -Wwrite-strings -Wno-unused
269
Reid Spencercc2d1e22004-10-30 09:19:36 +0000270LD.Flags += -L$(LibDir) -L$(LLVMLibDir)
271CPP.Flags += -I$(BUILD_OBJ_DIR) \
Reid Spencer151f8ba2004-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 Spencer4d71b662004-10-22 21:01:56 +0000278
Reid Spencercc2d1e22004-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 Spencera69b1ea2004-10-28 09:15:28 +0000288 $(CompileCommonOpts)
Reid Spencercc2d1e22004-10-30 09:19:36 +0000289LTInstall = $(LIBTOOL) $(LibTool.Flags) --mode=install $(INSTALL)
Reid Spencer3a561f52004-10-23 20:04:14 +0000290Burg = $(BURG) -I $(BUILD_SRC_DIR)
291TableGen = $(TBLGEN) -I $(BUILD_SRC_DIR)
Reid Spencercc2d1e22004-10-30 09:19:36 +0000292Archive = $(AR) $(AR.Flags)
Reid Spencer9a2f1372004-12-02 09:28:21 +0000293LArchive = $(LLVMToolDir)/llvm-ar rcsf
Reid Spencer4d71b662004-10-22 21:01:56 +0000294ifdef RANLIB
Reid Spencer3a561f52004-10-23 20:04:14 +0000295Ranlib = $(RANLIB)
Reid Spencer4d71b662004-10-22 21:01:56 +0000296else
Reid Spencer3a561f52004-10-23 20:04:14 +0000297Ranlib = ranlib
John Criswell7a73b802003-06-30 21:59:07 +0000298endif
299
Chris Lattner00950542001-06-06 20:29:01 +0000300#----------------------------------------------------------
Reid Spencer3a561f52004-10-23 20:04:14 +0000301# Get the list of source files
302#----------------------------------------------------------
303ifndef SOURCES
Reid Spencercc2d1e22004-10-30 09:19:36 +0000304 Sources := $(notdir $(wildcard $(BUILD_SRC_DIR)/*.cpp \
305 $(BUILD_SRC_DIR)/*.cc $(BUILD_SRC_DIR)/*.c $(BUILD_SRC_DIR)/*.y \
306 $(BUILD_SRC_DIR)/*.l))
307else
308 Sources := $(SOURCES)
Reid Spencer4d71b662004-10-22 21:01:56 +0000309endif
310
311ifdef BUILT_SOURCES
Reid Spencercc2d1e22004-10-30 09:19:36 +0000312Sources += $(filter %.cpp %.c %.cc %.y %.l,$(BUILT_SOURCES))
Vikram S. Advead9ea7e2002-10-14 16:40:04 +0000313endif
Vikram S. Adve112a72c2001-07-15 13:16:47 +0000314
Reid Spencer3a561f52004-10-23 20:04:14 +0000315#----------------------------------------------------------
316# Types of objects that can be built from sources
317#----------------------------------------------------------
Reid Spencercc2d1e22004-10-30 09:19:36 +0000318BaseNameSources := $(sort $(basename $(Sources)))
319ObjectsO := $(BaseNameSources:%=$(ObjDir)/%.o)
320ObjectsLO := $(BaseNameSources:%=$(ObjDir)/%.lo)
321ObjectsBC := $(BaseNameSources:%=$(ObjDir)/%.bc)
Reid Spencer3a561f52004-10-23 20:04:14 +0000322
323###############################################################################
324# DIRECTORIES: Handle recursive descent of directory structure
325###############################################################################
John Criswell82f4a5a2003-07-31 20:58:51 +0000326
Chris Lattner00950542001-06-06 20:29:01 +0000327#---------------------------------------------------------
Reid Spencera69b1ea2004-10-28 09:15:28 +0000328# Provide rules to make install dirs. This must be early
329# in the file so they get built before dependencies
330#---------------------------------------------------------
331
332$(bindir):
Reid Spencercc2d1e22004-10-30 09:19:36 +0000333 $(Verb) $(MKDIR) $(bindir)
Chris Lattnere4cb90f2004-11-01 06:14:59 +0000334
Reid Spencera69b1ea2004-10-28 09:15:28 +0000335$(libdir):
Reid Spencercc2d1e22004-10-30 09:19:36 +0000336 $(Verb) $(MKDIR) $(libdir)
Reid Spencera69b1ea2004-10-28 09:15:28 +0000337
338$(bytecode_libdir):
Reid Spencercc2d1e22004-10-30 09:19:36 +0000339 $(Verb) $(MKDIR) $(bytecode_libdir)
Reid Spencera69b1ea2004-10-28 09:15:28 +0000340
341$(sysconfdir):
Reid Spencercc2d1e22004-10-30 09:19:36 +0000342 $(Verb) $(MKDIR) $(sysconfdir)
Reid Spencera69b1ea2004-10-28 09:15:28 +0000343
Reid Spencercc2d1e22004-10-30 09:19:36 +0000344# To create other directories, as needed, and timestamp their creation
345%/.dir:
346 $(Verb) $(MKDIR) $* > /dev/null
Reid Spencerfbbf3072004-11-29 05:00:33 +0000347 $(Verb) $(DATE) > $@
Reid Spencercc2d1e22004-10-30 09:19:36 +0000348
Reid Spencer815cbcf2004-11-18 10:03:46 +0000349.PRECIOUS: $(ObjDir)/.dir $(LibDir)/.dir $(ToolDir)/.dir $(ExmplDir)/.dir
350.PRECIOUS: $(LLVMLibDir)/.dir $(LLVMToolDir)/.dir $(LLVMExmplDir)/.dir
Reid Spencera69b1ea2004-10-28 09:15:28 +0000351
352#---------------------------------------------------------
Reid Spencer3a561f52004-10-23 20:04:14 +0000353# Handle the DIRS options for sequential construction
Chris Lattner00950542001-06-06 20:29:01 +0000354#---------------------------------------------------------
355
Reid Spencercc2d1e22004-10-30 09:19:36 +0000356SubDirs :=
Anand Shukla7c7a07e2002-09-18 04:29:30 +0000357ifdef DIRS
Reid Spencercc2d1e22004-10-30 09:19:36 +0000358SubDirs += $(DIRS)
359$(RecursiveTargets)::
360 $(Verb) for dir in $(DIRS); do \
Reid Spencer4d71b662004-10-22 21:01:56 +0000361 if [ ! -f $$dir/Makefile ]; then \
362 $(MKDIR) $$dir; \
363 cp $(BUILD_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
364 fi; \
Reid Spencer151f8ba2004-10-25 08:27:37 +0000365 ($(MAKE) -C $$dir $@ ) || exit 1; \
Chris Lattnerf1ffd992002-09-17 23:35:02 +0000366 done
Anand Shukla7c7a07e2002-09-18 04:29:30 +0000367endif
Chris Lattnera8abc222002-09-18 03:22:27 +0000368
Reid Spencer3a561f52004-10-23 20:04:14 +0000369#---------------------------------------------------------
370# Handle the EXPERIMENTAL_DIRS options ensuring success
371# after each directory is built.
372#---------------------------------------------------------
373ifdef EXPERIMENTAL_DIRS
Reid Spencercc2d1e22004-10-30 09:19:36 +0000374$(RecursiveTargets)::
375 $(Verb) for dir in $(EXPERIMENTAL_DIRS); do \
Reid Spencer3a561f52004-10-23 20:04:14 +0000376 if [ ! -f $$dir/Makefile ]; then \
377 $(MKDIR) $$dir; \
378 cp $(BUILD_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
379 fi; \
Reid Spencer151f8ba2004-10-25 08:27:37 +0000380 ($(MAKE) -C $$dir $@ ) || exit 0; \
Reid Spencer3a561f52004-10-23 20:04:14 +0000381 done
382endif
Chris Lattnera8abc222002-09-18 03:22:27 +0000383
Reid Spencer3a561f52004-10-23 20:04:14 +0000384#---------------------------------------------------------
385# Handle the PARALLEL_DIRS options for parallel construction
386#---------------------------------------------------------
387ifdef PARALLEL_DIRS
388
Reid Spencercc2d1e22004-10-30 09:19:36 +0000389SubDirs += $(PARALLEL_DIRS)
390
Reid Spencer3a561f52004-10-23 20:04:14 +0000391# Unfortunately, this list must be maintained if new
392# recursive targets are added.
Reid Spencercc2d1e22004-10-30 09:19:36 +0000393all :: $(addsuffix /.makeall ,$(PARALLEL_DIRS))
394clean :: $(addsuffix /.makeclean ,$(PARALLEL_DIRS))
Reid Spencerca5fe8f2004-11-02 16:56:15 +0000395clean-all:: $(addsuffix /.makeclean-all,$(PARALLEL_DIRS))
Reid Spencercc2d1e22004-10-30 09:19:36 +0000396check :: $(addsuffix /.makecheck ,$(PARALLEL_DIRS))
397install :: $(addsuffix /.makeinstall ,$(PARALLEL_DIRS))
Reid Spencer3a561f52004-10-23 20:04:14 +0000398uninstall:: $(addsuffix /.makeuninstall,$(PARALLEL_DIRS))
399
Reid Spencercc2d1e22004-10-30 09:19:36 +0000400Parallel_Targets := $(foreach T,$(RecursiveTargets),%/.make$(T))
Reid Spencer3a561f52004-10-23 20:04:14 +0000401
402$(Parallel_Targets) :
Reid Spencercc2d1e22004-10-30 09:19:36 +0000403 $(Verb) if [ ! -f $(@D)/Makefile ]; then \
Reid Spencer4d71b662004-10-22 21:01:56 +0000404 $(MKDIR) $(@D); \
405 cp $(BUILD_SRC_DIR)/$(@D)/Makefile $(@D)/Makefile; \
John Criswellb3866b62003-11-25 19:32:22 +0000406 fi; \
Reid Spencer151f8ba2004-10-25 08:27:37 +0000407 $(MAKE) -C $(@D) $(subst $(@D)/.make,,$@)
Chris Lattner00950542001-06-06 20:29:01 +0000408endif
409
Reid Spencer3a561f52004-10-23 20:04:14 +0000410#---------------------------------------------------------
411# Handle the OPTIONAL_DIRS options for directores that may
412# or may not exist.
413#---------------------------------------------------------
John Criswell2a6530f2003-06-27 16:58:44 +0000414ifdef OPTIONAL_DIRS
Reid Spencer151f8ba2004-10-25 08:27:37 +0000415
Reid Spencercc2d1e22004-10-30 09:19:36 +0000416SubDirs += $(OPTIONAL_DIRS)
Reid Spencer151f8ba2004-10-25 08:27:37 +0000417
Reid Spencercc2d1e22004-10-30 09:19:36 +0000418$(RecursiveTargets)::
419 $(Verb) for dir in $(OPTIONAL_DIRS); do \
Reid Spencer4d71b662004-10-22 21:01:56 +0000420 if [ -d $(BUILD_SRC_DIR)/$$dir ]; then\
421 if [ ! -f $$dir/Makefile ]; then \
422 $(MKDIR) $$dir; \
423 cp $(BUILD_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
424 fi; \
Reid Spencer151f8ba2004-10-25 08:27:37 +0000425 ($(MAKE) -C$$dir $@ ) || exit 1; \
Reid Spencer4d71b662004-10-22 21:01:56 +0000426 fi \
John Criswell2a6530f2003-06-27 16:58:44 +0000427 done
428endif
429
Reid Spencerfc945082004-08-20 09:20:05 +0000430#---------------------------------------------------------
431# Handle the CONFIG_FILES options
432#---------------------------------------------------------
433ifdef CONFIG_FILES
Reid Spencerfc945082004-08-20 09:20:05 +0000434
Reid Spencerc6dcc6a2004-10-28 07:57:28 +0000435install-local:: $(sysconfdir) $(CONFIG_FILES)
Reid Spencercc2d1e22004-10-30 09:19:36 +0000436 $(Echo) Installing Configuration Files To $(sysconfdir)
437 $(Verb)for file in $(CONFIG_FILES); do \
Reid Spencer1b426ab2004-11-23 05:59:53 +0000438 if test -f $(BUILD_OBJ_DIR)/$${file} ; then \
439 $(INSTALL) $(BUILD_OBJ_DIR)/$${file} $(sysconfdir) ; \
440 elif test -f $(BUILD_SRC_DIR)/$${file} ; then \
441 $(INSTALL) $(BUILD_SRC_DIR)/$${file} $(sysconfdir) ; \
442 else \
443 $(ECHO) Error: cannot find config file $${file}. ; \
444 fi \
Reid Spencerfc945082004-08-20 09:20:05 +0000445 done
Reid Spencer3a561f52004-10-23 20:04:14 +0000446
Reid Spencerc6dcc6a2004-10-28 07:57:28 +0000447uninstall-local::
Reid Spencercc2d1e22004-10-30 09:19:36 +0000448 $(Echo) Uninstalling Configuration Files From $(sysconfdir)
449 $(Verb)for file in $(CONFIG_FILES); do \
Reid Spencer151f8ba2004-10-25 08:27:37 +0000450 $(RM) -f $(sysconfdir)/$${file} ; \
Reid Spencere5487ba2004-10-24 07:53:21 +0000451 done
452
Reid Spencerfc945082004-08-20 09:20:05 +0000453endif
454
Reid Spencer3a561f52004-10-23 20:04:14 +0000455###############################################################################
456# Library Build Rules: Four ways to build a library
457###############################################################################
Chris Lattner00950542001-06-06 20:29:01 +0000458
Brian Gaeke8abff792004-01-22 22:53:48 +0000459
Reid Spencer3a561f52004-10-23 20:04:14 +0000460# if we're building a library ...
Chris Lattner00950542001-06-06 20:29:01 +0000461ifdef LIBRARYNAME
Vikram S. Adve112a72c2001-07-15 13:16:47 +0000462
Chris Lattner2a548c52002-09-16 22:36:42 +0000463# Make sure there isn't any extranous whitespace on the LIBRARYNAME option
Chris Lattnerccb4ebd2002-09-16 22:34:56 +0000464LIBRARYNAME := $(strip $(LIBRARYNAME))
Reid Spencercc2d1e22004-10-30 09:19:36 +0000465LibName.LA := $(LibDir)/lib$(LIBRARYNAME).la
466LibName.A := $(LibDir)/lib$(LIBRARYNAME).a
467LibName.O := $(LibDir)/$(LIBRARYNAME).o
Reid Spencer9a2f1372004-12-02 09:28:21 +0000468LibName.BCA:= $(LibDir)/lib$(LIBRARYNAME).bca
Chris Lattnerccb4ebd2002-09-16 22:34:56 +0000469
Reid Spencer3a561f52004-10-23 20:04:14 +0000470#---------------------------------------------------------
471# Shared Library Targets:
472# If the user asked for a shared library to be built
473# with the SHARED_LIBRARY variable, then we provide
474# targets for building them.
475#---------------------------------------------------------
Reid Spencer4d71b662004-10-22 21:01:56 +0000476ifdef SHARED_LIBRARY
477
Reid Spencercc2d1e22004-10-30 09:19:36 +0000478all-local:: $(LibName.LA)
Reid Spencer4d71b662004-10-22 21:01:56 +0000479
Reid Spencercc2d1e22004-10-30 09:19:36 +0000480$(LibName.LA): $(BUILT_SOURCES) $(ObjectsLO) $(LibDir)/.dir
Reid Spencer9af3b292004-11-01 07:50:27 +0000481 $(Echo) Linking $(BuildMode) Shared Library $(LIBRARYNAME)$(SHLIBEXT)
Reid Spencercc2d1e22004-10-30 09:19:36 +0000482 $(Verb) $(Link) -o $@ $(ObjectsLO)
483 $(Verb) $(LTInstall) $@ $(LibDir)
Reid Spencer3a561f52004-10-23 20:04:14 +0000484
485clean-local::
Reid Spencercc2d1e22004-10-30 09:19:36 +0000486ifneq ($(strip $(LibName.LA)),)
Reid Spencerca5fe8f2004-11-02 16:56:15 +0000487 -$(Verb) $(RM) -f $(LibName.LA)
Reid Spencere5487ba2004-10-24 07:53:21 +0000488endif
Reid Spencer4d71b662004-10-22 21:01:56 +0000489
Reid Spencere5487ba2004-10-24 07:53:21 +0000490DestSharedLib = $(libdir)/lib$(LIBRARYNAME)$(SHLIBEXT)
Reid Spencer4d71b662004-10-22 21:01:56 +0000491
Reid Spencerc6dcc6a2004-10-28 07:57:28 +0000492install-local:: $(DestSharedLib)
Reid Spencere5487ba2004-10-24 07:53:21 +0000493
Reid Spencercc2d1e22004-10-30 09:19:36 +0000494$(DestSharedLib): $(libdir) $(LibName.LA)
Reid Spencer9af3b292004-11-01 07:50:27 +0000495 $(Echo) Installing $(BuildMode) Shared Library $(DestSharedLib)
Reid Spencercc2d1e22004-10-30 09:19:36 +0000496 $(Verb) $(LTInstall) $(LibName.LA) $(DestSharedLib)
497 $(Verb) $(LIBTOOL) --finish $(libdir)
Reid Spencere5487ba2004-10-24 07:53:21 +0000498
Reid Spencerc6dcc6a2004-10-28 07:57:28 +0000499uninstall-local::
Reid Spencer9af3b292004-11-01 07:50:27 +0000500 $(Echo) Uninstalling $(BuildMode) Shared Library $(DestSharedLib)
Reid Spencer12d79512004-11-12 02:27:36 +0000501 -$(Verb) $(RM) -f $(libdir)/lib$(LIBRARYNAME).*
Reid Spencere5487ba2004-10-24 07:53:21 +0000502
Reid Spencer4d71b662004-10-22 21:01:56 +0000503endif
504
Reid Spencer3a561f52004-10-23 20:04:14 +0000505#---------------------------------------------------------
506# Bytecode Library Targets:
507# If the user asked for a bytecode library to be built
508# with the BYTECODE_LIBRARY variable, then we provide
509# targets for building them.
510#---------------------------------------------------------
Reid Spencer4d71b662004-10-22 21:01:56 +0000511ifdef BYTECODE_LIBRARY
512
Reid Spencer9a2f1372004-12-02 09:28:21 +0000513all-local:: $(LibName.BCA)
514
515ifdef EXPORTED_SYMBOL_FILE
516BCLinkLib = $(LLVMGCC) -shared -nostdlib -Xlinker \
517 -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
518
519$(LibName.BCA): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(GCCLD)
520 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@) \
521 "(internalize)"
522 $(BCLinkLib) -o $(ObjDir)/$(LIBRARYNAME).o $(ObjectsBC)
523 $(Verb) $(LArchive) $@ $(ObjDir)/$(LIBRARYNAME).o
Reid Spencer4d71b662004-10-22 21:01:56 +0000524else
Reid Spencer9a2f1372004-12-02 09:28:21 +0000525$(LibName.BCA): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(GCCLD)
526 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@)
527 $(Verb) $(LArchive) $@ $(ObjectsBC)
528
Reid Spencer4d71b662004-10-22 21:01:56 +0000529endif
530
Reid Spencer3a561f52004-10-23 20:04:14 +0000531clean-local::
Reid Spencer9a2f1372004-12-02 09:28:21 +0000532ifneq ($(strip $(LibName.BCA)),)
533 -$(Verb) $(RM) -f $(LibName.BCA)
Reid Spencere5487ba2004-10-24 07:53:21 +0000534endif
Reid Spencer4d71b662004-10-22 21:01:56 +0000535
Reid Spencer9a2f1372004-12-02 09:28:21 +0000536DestBytecodeLib = $(bytecode_libdir)/lib$(LIBRARYNAME).a
537
538install-bytecode: $(DestBytecodeLib)
Reid Spencere45ebfa2004-10-26 07:09:33 +0000539
Reid Spencerc6dcc6a2004-10-28 07:57:28 +0000540install-local:: $(DestBytecodeLib)
Chris Lattner481cc7c2003-08-15 02:18:35 +0000541
Reid Spencer9a2f1372004-12-02 09:28:21 +0000542$(DestBytecodeLib): $(bytecode_libdir) $(LibName.BCA)
543 $(Echo) Installing $(BuildMode) Bytecode Archive $(DestBytecodeLib)
544 $(Verb) $(INSTALL) $(LibName.BCA) $@
Reid Spencere5487ba2004-10-24 07:53:21 +0000545
Reid Spencerc6dcc6a2004-10-28 07:57:28 +0000546uninstall-local::
Reid Spencer9a2f1372004-12-02 09:28:21 +0000547 $(Echo) Uninstalling $(BuildMode) Bytecode Archive $(DestBytecodeLib)
Reid Spencerca5fe8f2004-11-02 16:56:15 +0000548 -$(Verb) $(RM) -f $(DestBytecodeLib)
Reid Spencer4d71b662004-10-22 21:01:56 +0000549
550endif
Vikram S. Adve60f56062002-08-02 18:34:12 +0000551
Reid Spencercc2d1e22004-10-30 09:19:36 +0000552#---------------------------------------------------------
553# ReLinked Library Targets:
554# If the user didn't explicitly forbid building a
555# relinked then we provide targets for building them.
556#---------------------------------------------------------
Chris Lattnere62dbe92002-07-23 17:56:16 +0000557ifndef DONT_BUILD_RELINKED
Reid Spencer4d71b662004-10-22 21:01:56 +0000558
Reid Spencercc2d1e22004-10-30 09:19:36 +0000559all-local:: $(LibName.O)
560
561$(LibName.O): $(BUILT_SOURCES) $(ObjectsO) $(LibDir)/.dir
Reid Spencer9af3b292004-11-01 07:50:27 +0000562 $(Echo) Linking $(BuildMode) Object Library $(notdir $@)
Reid Spencercc2d1e22004-10-30 09:19:36 +0000563 $(Verb) $(Relink) -o $@ $(ObjectsO)
Reid Spencer4d71b662004-10-22 21:01:56 +0000564
Reid Spencer3a561f52004-10-23 20:04:14 +0000565clean-local::
Reid Spencercc2d1e22004-10-30 09:19:36 +0000566ifneq ($(strip $(LibName.O)),)
Reid Spencerca5fe8f2004-11-02 16:56:15 +0000567 -$(Verb) $(RM) -f $(LibName.O)
Reid Spencere5487ba2004-10-24 07:53:21 +0000568endif
569
570DestRelinkedLib = $(libdir)/$(LIBRARYNAME).o
571
Reid Spencerc6dcc6a2004-10-28 07:57:28 +0000572install-local:: $(DestRelinkedLib)
Reid Spencere5487ba2004-10-24 07:53:21 +0000573
Reid Spencercc2d1e22004-10-30 09:19:36 +0000574$(DestRelinkedLib): $(libdir) $(LibName.O)
Reid Spencer9af3b292004-11-01 07:50:27 +0000575 $(Echo) Installing $(BuildMode) Object Library $(DestRelinkedLib)
Reid Spencercc2d1e22004-10-30 09:19:36 +0000576 $(Verb) $(LTInstall) $(LibName.O) $(DestRelinkedLib)
Reid Spencere5487ba2004-10-24 07:53:21 +0000577
Reid Spencerc6dcc6a2004-10-28 07:57:28 +0000578uninstall-local::
Reid Spencer9af3b292004-11-01 07:50:27 +0000579 $(Echo) Uninstalling $(BuildMode) Object Library $(DestRelinkedLib)
Reid Spencerca5fe8f2004-11-02 16:56:15 +0000580 -$(Verb) $(RM) -f $(DestRelinkedLib)
Reid Spencer4d71b662004-10-22 21:01:56 +0000581
Chris Lattnere62dbe92002-07-23 17:56:16 +0000582endif
Chris Lattner760da062003-03-14 20:25:22 +0000583
Reid Spencercc2d1e22004-10-30 09:19:36 +0000584#---------------------------------------------------------
585# Archive Library Targets:
586# If the user wanted a regular archive library built,
587# then we provide targets for building them.
588#---------------------------------------------------------
Chris Lattnere62dbe92002-07-23 17:56:16 +0000589ifdef BUILD_ARCHIVE
Chris Lattnere62dbe92002-07-23 17:56:16 +0000590
Reid Spencercc2d1e22004-10-30 09:19:36 +0000591all-local:: $(LibName.A)
592
593$(LibName.A): $(BUILT_SOURCES) $(ObjectsO) $(LibDir)/.dir
Reid Spencer9af3b292004-11-01 07:50:27 +0000594 $(Echo) Building $(BuildMode) Archive Library $(notdir $@)
Reid Spencerca5fe8f2004-11-02 16:56:15 +0000595 -$(Verb) $(RM) -f $@
Reid Spencercc2d1e22004-10-30 09:19:36 +0000596 $(Verb) $(Archive) $@ $(ObjectsO)
597 $(Verb) $(Ranlib) $@
Vikram S. Adve41e78912002-09-20 14:03:13 +0000598
Reid Spencer3a561f52004-10-23 20:04:14 +0000599clean-local::
Reid Spencercc2d1e22004-10-30 09:19:36 +0000600ifneq ($(strip $(LibName.A)),)
Reid Spencerca5fe8f2004-11-02 16:56:15 +0000601 -$(Verb) $(RM) -f $(LibName.A)
Chris Lattner00950542001-06-06 20:29:01 +0000602endif
603
Reid Spencere5487ba2004-10-24 07:53:21 +0000604DestArchiveLib := $(libdir)/lib$(LIBRARYNAME).a
605
Reid Spencerc6dcc6a2004-10-28 07:57:28 +0000606install-local:: $(DestArchiveLib)
Reid Spencere5487ba2004-10-24 07:53:21 +0000607
Reid Spencercc2d1e22004-10-30 09:19:36 +0000608$(DestArchiveLib): $(libdir) $(LibName.A)
Reid Spencer9af3b292004-11-01 07:50:27 +0000609 $(Echo) Installing $(BuildMode) Archive Library $(DestArchiveLib)
Reid Spencercc2d1e22004-10-30 09:19:36 +0000610 $(Verb) $(MKDIR) $(libdir)
611 $(Verb) $(LTInstall) $(LibName.A) $(DestArchiveLib)
Reid Spencere5487ba2004-10-24 07:53:21 +0000612
Reid Spencerc6dcc6a2004-10-28 07:57:28 +0000613uninstall-local::
Reid Spencer9af3b292004-11-01 07:50:27 +0000614 $(Echo) Uninstalling $(BuildMode) Archive Library $(DestArchiveLib)
Reid Spencerca5fe8f2004-11-02 16:56:15 +0000615 -$(Verb) $(RM) -f $(DestArchiveLib)
Reid Spencere5487ba2004-10-24 07:53:21 +0000616
617endif
618
619# endif LIBRARYNAME
Reid Spencer4d71b662004-10-22 21:01:56 +0000620endif
621
Reid Spencerb1dd3dd2004-10-24 08:21:04 +0000622###############################################################################
623# Tool Build Rules: Build executable tool based on TOOLNAME option
624###############################################################################
625
Chris Lattner1cbc29f2001-09-07 22:57:58 +0000626ifdef TOOLNAME
627
Reid Spencercc2d1e22004-10-30 09:19:36 +0000628#---------------------------------------------------------
Reid Spencer7c787c92004-11-29 07:17:07 +0000629# Handle the special "JIT" value for LLVM_LIBS which is a
630# shorthand for a bunch of libraries that get the correct
631# JIT support for a tool that runs JIT.
632#---------------------------------------------------------
633ifeq ($(LLVMLIBS),JIT)
634
635# Make sure we can get our own symbols in the tool
636Link += -dlopen self
637
638# Generic JIT libraries
639JIT_LIBS := LLVMInterpreter LLVMJIT LLVMCodeGen LLVMExecutionEngine
640
641# You can enable the X86 JIT on a non-X86 host by setting the flag
642# ENABLE_X86_JIT on the make command line. If not, it will still be
643# enabled automagically on an X86 host.
644ifeq ($(ARCH), x86)
645 ENABLE_X86_JIT = 1
646endif
647
648# What the X86 JIT requires
649ifdef ENABLE_X86_JIT
650 JIT_LIBS += LLVMX86 LLVMSelectionDAG
651endif
652
653# You can enable the SparcV9 JIT on a non-SparcV9 host by setting the flag
654# ENABLE_SPARCV9_JIT on the make command line. If not, it will still be
655# enabled automagically on an SparcV9 host.
656ifeq ($(ARCH), Sparc)
657 ENABLE_SPARCV9_JIT = 1
658endif
659
660# What the Sparc JIT requires
661ifdef ENABLE_SPARCV9_JIT
662 JIT_LIBS += LLVMSparcV9 LLVMSparcV9ModuloSched LLVMSparcV9InstrSched \
663 LLVMSparcV9LiveVar LLVMInstrumentation.a LLVMProfilePaths \
664 LLVMBCWriter LLVMTransforms.a LLVMipo.a LLVMipa.a \
665 LLVMDataStructure.a LLVMSparcV9RegAlloc
666endif
667
668# You can enable the PowerPC JIT on a non-PowerPC host by setting the flag
669# ENABLE_PPC_JIT on the make command line. If not, it will still be
670# enabled automagically on an PowerPC host.
671ifeq ($(ARCH), PowerPC)
672 ENABLE_PPC_JIT = 1
673endif
674
675# What the PowerPC JIT requires
676ifdef ENABLE_PPC_JIT
677 JIT_LIBS += LLVMPowerPC
678endif
679
680LLVMLIBS := $(JIT_LIBS) LLVMScalarOpts LLVMAnalysis.a LLVMTransformUtils.a \
681 LLVMBCReader LLVMCore LLVMSupport.a LLVMTarget.a LLVMbzip2 \
682 LLVMSystem.a $(PLATFORMLIBDL)
683endif
684
685#---------------------------------------------------------
Reid Spencercc2d1e22004-10-30 09:19:36 +0000686# Set up variables for building a tool.
687#---------------------------------------------------------
Reid Spencer815cbcf2004-11-18 10:03:46 +0000688ifdef EXAMPLE_TOOL
689ToolBuildPath := $(ExmplDir)/$(TOOLNAME)$(EXEEXT)
690else
Reid Spencercc2d1e22004-10-30 09:19:36 +0000691ToolBuildPath := $(ToolDir)/$(TOOLNAME)$(EXEEXT)
Reid Spencer815cbcf2004-11-18 10:03:46 +0000692endif
Reid Spencercc2d1e22004-10-30 09:19:36 +0000693ProjLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS)))
694ProjLibsOptions := $(patsubst %.o, $(LibDir)/%.o, $(ProjLibsOptions))
695LLVMLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(LLVMLIBS)))
696LLVMLibsOptions := $(patsubst %.o, $(LLVMLibDir)/%.o, $(LLVMLibsOptions))
697ProjUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(USEDLIBS)))
698LLVMUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(LLVMLIBS)))
699ProjLibsPaths := $(addprefix $(LibDir)/,$(ProjUsedLibs))
700LLVMLibsPaths := $(addprefix $(LLVMLibDir)/,$(LLVMUsedLibs))
Chris Lattner1cbc29f2001-09-07 22:57:58 +0000701
Reid Spencercc2d1e22004-10-30 09:19:36 +0000702#---------------------------------------------------------
Reid Spencercc2d1e22004-10-30 09:19:36 +0000703# Tell make that we need to rebuild subdirectories before
704# we can link the tool. This affects things like LLI which
705# has library subdirectories.
706#---------------------------------------------------------
707$(ToolBuildPath): $(addsuffix /.makeall, $(PARALLEL_DIRS))
Chris Lattner8d7dfb32003-01-22 16:13:31 +0000708
Reid Spencercc2d1e22004-10-30 09:19:36 +0000709#---------------------------------------------------------
710# Provide targets for building the tools
711#---------------------------------------------------------
712all-local:: $(ToolBuildPath)
John Criswell2a6530f2003-06-27 16:58:44 +0000713
Reid Spencer3a561f52004-10-23 20:04:14 +0000714clean-local::
Reid Spencercc2d1e22004-10-30 09:19:36 +0000715ifneq ($(strip $(ToolBuildPath)),)
Reid Spencerca5fe8f2004-11-02 16:56:15 +0000716 -$(Verb) $(RM) -f $(ToolBuildPath)
Reid Spencere5487ba2004-10-24 07:53:21 +0000717endif
Chris Lattner1cbc29f2001-09-07 22:57:58 +0000718
Reid Spencer815cbcf2004-11-18 10:03:46 +0000719ifdef EXAMPLE_TOOL
720$(ToolBuildPath): $(ExmplDir)/.dir
721else
722$(ToolBuildPath): $(ToolDir)/.dir
723endif
724
725$(ToolBuildPath): $(BUILT_SOURCES) $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
Reid Spencer9af3b292004-11-01 07:50:27 +0000726 $(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg)
Reid Spencercc2d1e22004-10-30 09:19:36 +0000727 $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
728 $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB)
Reid Spencer9af3b292004-11-01 07:50:27 +0000729 $(Echo) ======= Finished Linking $(BuildMode) Executable $(TOOLNAME) $(StripWarnMsg)
Reid Spencere5487ba2004-10-24 07:53:21 +0000730
731DestTool = $(bindir)/$(TOOLNAME)
732
Reid Spencerc6dcc6a2004-10-28 07:57:28 +0000733install-local:: $(DestTool)
Reid Spencere45ebfa2004-10-26 07:09:33 +0000734
Reid Spencercc2d1e22004-10-30 09:19:36 +0000735$(DestTool): $(bindir) $(ToolBuildPath)
Reid Spencer9af3b292004-11-01 07:50:27 +0000736 $(Echo) Installing $(BuildMode) $(DestTool)
Reid Spencercc2d1e22004-10-30 09:19:36 +0000737 $(Verb) $(INSTALL) $(ToolBuildPath) $(DestTool)
Reid Spencere5487ba2004-10-24 07:53:21 +0000738
Reid Spencerc6dcc6a2004-10-28 07:57:28 +0000739uninstall-local::
Reid Spencer9af3b292004-11-01 07:50:27 +0000740 $(Echo) Uninstalling $(BuildMode) $(DestTool)
Reid Spencerca5fe8f2004-11-02 16:56:15 +0000741 -$(Verb) $(RM) -f $(DestTool)
Reid Spencere5487ba2004-10-24 07:53:21 +0000742
Reid Spencer4d71b662004-10-22 21:01:56 +0000743endif
Chris Lattner1cbc29f2001-09-07 22:57:58 +0000744
Reid Spencercc2d1e22004-10-30 09:19:36 +0000745###############################################################################
746# Object Build Rules: Build object files based on sources
747###############################################################################
748
749# Provide rule sets for when dependency generation is enabled
Reid Spencer4d71b662004-10-22 21:01:56 +0000750ifndef DISABLE_AUTO_DEPENDENCIES
Vikram S. Adve41e78912002-09-20 14:03:13 +0000751
Reid Spencercc2d1e22004-10-30 09:19:36 +0000752#---------------------------------------------------------
753# Create .lo files in the ObjDir directory from the .cpp and .c files...
754#---------------------------------------------------------
Reid Spencer3a561f52004-10-23 20:04:14 +0000755ifdef SHARED_LIBRARY
756
Reid Spencercc2d1e22004-10-30 09:19:36 +0000757$(ObjDir)/%.lo $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir
Reid Spencer9af3b292004-11-01 07:50:27 +0000758 $(Echo) "Compiling $*.cpp for $(BuildMode) build (PIC)"
Reid Spencercc2d1e22004-10-30 09:19:36 +0000759 $(Verb) if $(LTCompile.CXX) -MD -MT $@ -MP -MF $(ObjDir)/$*.LACXXd $< -o $@ ; \
760 then $(MV) -f "$(ObjDir)/$*.LACXXd" "$(ObjDir)/$*.d"; \
761 else $(RM) -f "$(ObjDir)/$*.LACXXd"; exit 1; fi
Reid Spencer3a561f52004-10-23 20:04:14 +0000762
Reid Spencercc2d1e22004-10-30 09:19:36 +0000763$(ObjDir)/%.lo $(ObjDir)/%.o: %.c $(ObjDir)/.dir
Reid Spencer9af3b292004-11-01 07:50:27 +0000764 $(Echo) "Compiling $*.c for $(BuildMode) build (PIC)"
Reid Spencercc2d1e22004-10-30 09:19:36 +0000765 $(Verb) if $(LTCompile.C) -MD -MT $@ -MP -MF $(ObjDir)/$*.LACd $< -o $@ ; \
766 then $(MV) -f "$(ObjDir)/$*.LACd" "$(ObjDir)/$*.d"; \
767 else $(RM) -f "$(ObjDir)/$*.LACd"; exit 1; fi
Reid Spencer3a561f52004-10-23 20:04:14 +0000768
Reid Spencercc2d1e22004-10-30 09:19:36 +0000769#---------------------------------------------------------
770# Create .o files in the ObjDir directory from the .cpp and .c files...
771#---------------------------------------------------------
Reid Spencer3a561f52004-10-23 20:04:14 +0000772else
Reid Spencer4d71b662004-10-22 21:01:56 +0000773
Reid Spencercc2d1e22004-10-30 09:19:36 +0000774$(ObjDir)/%.o: %.cpp $(ObjDir)/.dir
Reid Spencer9af3b292004-11-01 07:50:27 +0000775 $(Echo) "Compiling $*.cpp for $(BuildMode) build"
Reid Spencercc2d1e22004-10-30 09:19:36 +0000776 $(Verb) if $(Compile.CXX) -MD -MT $@ -MP -MF $(ObjDir)/$*.CXXd $< -o $@ ; \
777 then $(MV) -f "$(ObjDir)/$*.CXXd" "$(ObjDir)/$*.d"; \
778 else $(RM) -f "$(ObjDir)/$*.CXXd"; exit 1; fi
Reid Spencer4d71b662004-10-22 21:01:56 +0000779
Reid Spencercc2d1e22004-10-30 09:19:36 +0000780$(ObjDir)/%.o: %.c $(ObjDir)/.dir
Reid Spencer9af3b292004-11-01 07:50:27 +0000781 $(Echo) "Compiling $*.c for $(BuildMode) build"
Reid Spencercc2d1e22004-10-30 09:19:36 +0000782 $(Verb) if $(Compile.C) -MD -MT $@ -MP -MF $(ObjDir)/$*.Cd $< -o $@ ; \
783 then $(MV) -f "$(ObjDir)/$*.Cd" "$(ObjDir)/$*.d"; \
784 else $(RM) -f "$(ObjDir)/$*.Cd"; exit 1; fi
Reid Spencer3a561f52004-10-23 20:04:14 +0000785
786endif
Reid Spencer4d71b662004-10-22 21:01:56 +0000787
Reid Spencercc2d1e22004-10-30 09:19:36 +0000788#---------------------------------------------------------
789# Create .bc files in the ObjDir directory from .cpp and .c files...
790#---------------------------------------------------------
Chris Lattner478b3b42004-11-29 19:47:58 +0000791$(ObjDir)/%.bc: %.cpp $(ObjDir)/.dir $(GCCAS)
Reid Spencer9af3b292004-11-01 07:50:27 +0000792 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
Reid Spencercc2d1e22004-10-30 09:19:36 +0000793 $(Verb) if $(BCCompile.CXX) -MD -MT $@ -MP -MF "$(ObjDir)/$*.BCCXXd" $< -o $@ ; \
794 then $(MV) -f "$(ObjDir)/$*.BCCXXd" "$(ObjDir)/$*.d"; \
795 else $(RM) -f "$(ObjDir)/$*.BCCXXd"; exit 1; fi
Reid Spencer4d71b662004-10-22 21:01:56 +0000796
Chris Lattner478b3b42004-11-29 19:47:58 +0000797$(ObjDir)/%.bc: %.c $(ObjDir)/.dir $(GCCAS)
Reid Spencer9af3b292004-11-01 07:50:27 +0000798 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
Reid Spencercc2d1e22004-10-30 09:19:36 +0000799 $(Verb) if $(BCCompile.C) -MD -MT $@ -MP -MF "$(ObjDir)/$*.BCCd" $< -o $@ ; \
800 then $(MV) -f "$(ObjDir)/$*.BCCd" "$(ObjDir)/$*.d"; \
801 else $(RM) -f "$(ObjDir)/$*.BCCd"; exit 1; fi
Reid Spencer4d71b662004-10-22 21:01:56 +0000802
Reid Spencercc2d1e22004-10-30 09:19:36 +0000803# Provide alternate rule sets if dependencies are disabled
Reid Spencer4d71b662004-10-22 21:01:56 +0000804else
805
Reid Spencer3a561f52004-10-23 20:04:14 +0000806ifdef SHARED_LIBRARY
807
Reid Spencercc2d1e22004-10-30 09:19:36 +0000808$(ObjDir)/%.lo $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir
Reid Spencer9af3b292004-11-01 07:50:27 +0000809 $(Echo) "Compiling $*.cpp for $(BuildMode) build (PIC)"
Reid Spencer3a561f52004-10-23 20:04:14 +0000810 $(LTCompile.CXX) $< -o $@
811
Reid Spencercc2d1e22004-10-30 09:19:36 +0000812$(ObjDir)/%.lo $(ObjDir)/%.o: %.c $(ObjDir)/.dir
Reid Spencer9af3b292004-11-01 07:50:27 +0000813 $(Echo) "Compiling $*.cpp for $(BuildMode) build (PIC)"
Reid Spencer3a561f52004-10-23 20:04:14 +0000814 $(LTCompile.C) $< -o $@
815
816else
Reid Spencer4d71b662004-10-22 21:01:56 +0000817
Reid Spencercc2d1e22004-10-30 09:19:36 +0000818$(ObjDir)/%.o: %.cpp $(ObjDir)/.dir
Reid Spencer9af3b292004-11-01 07:50:27 +0000819 $(Echo) "Compiling $*.cpp for $(BuildMode) build"
Reid Spencer3a561f52004-10-23 20:04:14 +0000820 $(Compile.CXX) $< -o $@
Reid Spencer4d71b662004-10-22 21:01:56 +0000821
Reid Spencercc2d1e22004-10-30 09:19:36 +0000822$(ObjDir)/%.o: %.c $(ObjDir)/.dir
Reid Spencer9af3b292004-11-01 07:50:27 +0000823 $(Echo) "Compiling $*.cpp for $(BuildMode) build"
Reid Spencer3a561f52004-10-23 20:04:14 +0000824 $(Compile.C) $< -o $@
825endif
Reid Spencer4d71b662004-10-22 21:01:56 +0000826
Chris Lattner478b3b42004-11-29 19:47:58 +0000827$(ObjDir)/%.bc: %.cpp $(ObjDir)/.dir $(GCCAS)
Reid Spencer9af3b292004-11-01 07:50:27 +0000828 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
Reid Spencer8676b7e2004-10-31 18:52:15 +0000829 $(BCCompile.CXX) $< -o $@
Reid Spencer4d71b662004-10-22 21:01:56 +0000830
Chris Lattner478b3b42004-11-29 19:47:58 +0000831$(ObjDir)/%.bc: %.c $(ObjDir)/.dir $(GCCAS)
Reid Spencer9af3b292004-11-01 07:50:27 +0000832 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
Reid Spencer8676b7e2004-10-31 18:52:15 +0000833 $(BCCompile.C) $< -o $@
Brian Gaeke44909cf2003-12-10 00:26:28 +0000834
Chris Lattner1cbc29f2001-09-07 22:57:58 +0000835endif
836
Reid Spencercc2d1e22004-10-30 09:19:36 +0000837#---------------------------------------------------------
838# Provide rule to build .bc files from .ll sources,
839# regardless of dependencies
840#---------------------------------------------------------
841$(ObjDir)/%.bc: %.ll $(ObjDir)/.dir $(LLVMAS)
Reid Spencer9af3b292004-11-01 07:50:27 +0000842 $(Echo) "Compiling $*.ll for $(BuildMode) build"
Reid Spencercc2d1e22004-10-30 09:19:36 +0000843 $(Verb) $(LLVMAS) $< -f -o $@
844
845###############################################################################
846# TABLEGEN: Provide rules for running tblgen to produce *.inc files
847###############################################################################
Chris Lattner481cc7c2003-08-15 02:18:35 +0000848
Reid Spencer4d71b662004-10-22 21:01:56 +0000849ifdef TARGET
850
Reid Spencercc2d1e22004-10-30 09:19:36 +0000851TDFiles := $(strip $(wildcard $(BUILD_SRC_DIR)/*.td) $(LLVM_SRC_ROOT)/lib/Target/Target.td)
852INCFiles := $(filter %.inc,$(BUILT_SOURCES))
Reid Spencer4d71b662004-10-22 21:01:56 +0000853
Reid Spencercc2d1e22004-10-30 09:19:36 +0000854$(INCFiles) : $(TBLGEN) $(TDFiles)
Reid Spencer4d71b662004-10-22 21:01:56 +0000855
Reid Spencer16544482004-10-27 04:34:35 +0000856%GenRegisterNames.inc : %.td
Reid Spencercc2d1e22004-10-30 09:19:36 +0000857 $(Echo) "Building $(<F) register names with tblgen"
858 $(Verb) $(TableGen) -gen-register-enums -o $@ $<
Reid Spencer4d71b662004-10-22 21:01:56 +0000859
Reid Spencer16544482004-10-27 04:34:35 +0000860%GenRegisterInfo.h.inc : %.td
Reid Spencercc2d1e22004-10-30 09:19:36 +0000861 $(Echo) "Building $(<F) register information header with tblgen"
862 $(Verb) $(TableGen) -gen-register-desc-header -o $@ $<
Reid Spencer4d71b662004-10-22 21:01:56 +0000863
864%GenRegisterInfo.inc : %.td
Reid Spencercc2d1e22004-10-30 09:19:36 +0000865 $(Echo) "Building $(<F) register info implementation with tblgen"
866 $(Verb) $(TableGen) -gen-register-desc -o $@ $<
Reid Spencer4d71b662004-10-22 21:01:56 +0000867
868%GenInstrNames.inc : %.td
Reid Spencercc2d1e22004-10-30 09:19:36 +0000869 $(Echo) "Building $(<F) instruction names with tblgen"
870 $(Verb) $(TableGen) -gen-instr-enums -o $@ $<
Reid Spencer4d71b662004-10-22 21:01:56 +0000871
872%GenInstrInfo.inc : %.td
Reid Spencercc2d1e22004-10-30 09:19:36 +0000873 $(Echo) "Building $(<F) instruction information with tblgen"
874 $(Verb) $(TableGen) -gen-instr-desc -o $@ $<
Reid Spencer4d71b662004-10-22 21:01:56 +0000875
876%GenAsmWriter.inc : %.td
Reid Spencercc2d1e22004-10-30 09:19:36 +0000877 $(Echo) "Building $(<F) assembly writer with tblgen"
878 $(Verb) $(TableGen) -gen-asm-writer -o $@ $<
Reid Spencer4d71b662004-10-22 21:01:56 +0000879
880%GenATTAsmWriter.inc : %.td
Reid Spencercc2d1e22004-10-30 09:19:36 +0000881 $(Echo) "Building $(<F) AT&T assembly writer with tblgen"
882 $(Verb) $(TableGen) -gen-asm-writer -o $@ $<
Reid Spencer4d71b662004-10-22 21:01:56 +0000883
884%GenIntelAsmWriter.inc : %.td
Reid Spencercc2d1e22004-10-30 09:19:36 +0000885 $(Echo) "Building $(<F) Intel assembly writer with tblgen"
886 $(Verb) $(TableGen) -gen-asm-writer -asmwriternum=1 -o $@ $<
Reid Spencer4d71b662004-10-22 21:01:56 +0000887
888%GenInstrSelector.inc: %.td
Reid Spencercc2d1e22004-10-30 09:19:36 +0000889 $(Echo) "Building $(<F) instruction selector with tblgen"
890 $(Verb) $(TableGen) -gen-instr-selector -o $@ $<
Reid Spencer4d71b662004-10-22 21:01:56 +0000891
892%GenCodeEmitter.inc:: %.td
Reid Spencercc2d1e22004-10-30 09:19:36 +0000893 $(Echo) "Building $(<F) code emitter with tblgen"
894 $(Verb) $(TableGen) -gen-emitter -o $@ $<
Reid Spencer4d71b662004-10-22 21:01:56 +0000895
Reid Spencer3a561f52004-10-23 20:04:14 +0000896clean-local::
Reid Spencerca5fe8f2004-11-02 16:56:15 +0000897 -$(Verb) $(RM) -f $(INCFiles)
Reid Spencer4d71b662004-10-22 21:01:56 +0000898
899endif
Chris Lattner481cc7c2003-08-15 02:18:35 +0000900
Reid Spencercc2d1e22004-10-30 09:19:36 +0000901###############################################################################
902# LEX AND YACC: Provide rules for generating sources with lex and yacc
903###############################################################################
Chris Lattnere8996782003-01-16 22:44:19 +0000904
Reid Spencercc2d1e22004-10-30 09:19:36 +0000905#---------------------------------------------------------
906# Provide rules for generating a .cpp source file from
907# (f)lex input sources.
908#---------------------------------------------------------
909
Reid Spencer3d659492004-11-02 16:36:03 +0000910LexFiles := $(filter %.l,$(Sources))
Reid Spencercc2d1e22004-10-30 09:19:36 +0000911
Reid Spencer3d659492004-11-02 16:36:03 +0000912ifneq ($(LexFiles),)
913
914LexOutput := $(strip $(patsubst %.l,%.cpp,$(LexFiles)))
Reid Spencercc2d1e22004-10-30 09:19:36 +0000915
916.PRECIOUS: $(LexOutput)
917
918# Note the extra sed filtering here, used to cut down on the warnings emited
919# by GCC. The last line is a gross hack to work around flex aparently not
920# being able to resize the buffer on a large token input. Currently, for
921# uninitialized string buffers in LLVM we can generate very long tokens, so
922# this is a hack around it.
Chris Lattnerb7dc2b92003-08-15 20:00:47 +0000923# FIXME. (f.e. char Buffer[10000] )
Chris Lattner00950542001-06-06 20:29:01 +0000924%.cpp: %.l
Reid Spencercc2d1e22004-10-30 09:19:36 +0000925 $(Echo) Flexing $<
926 $(Verb) $(FLEX) -t $< | \
Reid Spencer4d71b662004-10-22 21:01:56 +0000927 $(SED) 's/void yyunput/inline void yyunput/' | \
928 $(SED) 's/void \*yy_flex_realloc/inline void *yy_flex_realloc/' | \
929 $(SED) 's/#define YY_BUF_SIZE 16384/#define YY_BUF_SIZE (16384*64)/' \
Reid Spencer80f0ef72004-10-28 00:41:43 +0000930 > $@
Chris Lattner00950542001-06-06 20:29:01 +0000931
Reid Spencer9af3b292004-11-01 07:50:27 +0000932clean-local::
Reid Spencerca5fe8f2004-11-02 16:56:15 +0000933 -$(Verb) $(RM) -f $(LexOutput)
Reid Spencer3d659492004-11-02 16:36:03 +0000934 $(Verb) $(RM) -f $(LexOutput)
Reid Spencer9af3b292004-11-01 07:50:27 +0000935
Reid Spencercc2d1e22004-10-30 09:19:36 +0000936endif
937
938#---------------------------------------------------------
939# Provide rules for generating a .cpp and .h source files
940# from yacc (bison) input sources.
941#---------------------------------------------------------
942
Reid Spencer3d659492004-11-02 16:36:03 +0000943YaccFiles := $(filter %.y,$(Sources))
944ifneq ($(YaccFiles),)
945YaccOutput := $(addprefix $(patsubst %.y,%,$(YaccFiles)),.h .cpp .output)
Reid Spencercc2d1e22004-10-30 09:19:36 +0000946
947.PRECIOUS: $(YaccOutput)
948
949# Cancel built-in rules for yacc
950%.c: %.y
951%.cpp: %.y
952%.h: %.y
953
Chris Lattner00950542001-06-06 20:29:01 +0000954# Rule for building the bison parsers...
Chris Lattner00950542001-06-06 20:29:01 +0000955%.cpp %.h : %.y
Reid Spencercc2d1e22004-10-30 09:19:36 +0000956 $(Echo) "Bisoning $*.y"
957 $(Verb) $(BISON) -v -d -p $(<F:%Parser.y=%) -o $*.tab.c $<
958 $(Verb) $(MV) -f $*.tab.c $*.cpp
959 $(Verb) $(MV) -f $*.tab.h $*.h
Chris Lattner00950542001-06-06 20:29:01 +0000960
Reid Spencer9af3b292004-11-01 07:50:27 +0000961clean-local::
Reid Spencerca5fe8f2004-11-02 16:56:15 +0000962 -$(Verb) $(RM) -f $(YaccOutput)
Reid Spencer3d659492004-11-02 16:36:03 +0000963 $(Verb) $(RM) -f $(YaccOutput)
Reid Spencercc2d1e22004-10-30 09:19:36 +0000964endif
Chris Lattner00950542001-06-06 20:29:01 +0000965
Reid Spencercc2d1e22004-10-30 09:19:36 +0000966###############################################################################
967# OTHER RULES: Other rules needed
968###############################################################################
Reid Spencer4d71b662004-10-22 21:01:56 +0000969
Chris Lattner30440c62003-01-16 21:06:18 +0000970# To create postscript files from dot files...
John Criswelle0f9ac62003-10-02 19:02:02 +0000971ifneq ($(DOT),false)
Chris Lattner30440c62003-01-16 21:06:18 +0000972%.ps: %.dot
Reid Spencer4d71b662004-10-22 21:01:56 +0000973 $(DOT) -Tps < $< > $@
John Criswell7a73b802003-06-30 21:59:07 +0000974else
975%.ps: %.dot
Reid Spencercc2d1e22004-10-30 09:19:36 +0000976 $(Echo) "Cannot build $@: The program dot is not installed"
John Criswell7a73b802003-06-30 21:59:07 +0000977endif
Chris Lattner30440c62003-01-16 21:06:18 +0000978
John Criswell7f336952003-09-06 14:44:17 +0000979# This rules ensures that header files that are removed still have a rule for
980# which they can be "generated." This allows make to ignore them and
981# reproduce the dependency lists.
John Criswell4b6e5d12003-09-18 18:37:08 +0000982%.h:: ;
John Criswell7f336952003-09-06 14:44:17 +0000983
Reid Spencercc2d1e22004-10-30 09:19:36 +0000984# Define clean-local to clean the current directory. Note that this uses a
985# very conservative approach ensuring that empty variables do not cause
986# errors or disastrous removal.
Reid Spencer3a561f52004-10-23 20:04:14 +0000987clean-local::
Reid Spencercc2d1e22004-10-30 09:19:36 +0000988ifneq ($(strip $(ObjDir)),)
Reid Spencerca5fe8f2004-11-02 16:56:15 +0000989 -$(Verb) $(RM) -rf $(ObjDir)
Reid Spencere5487ba2004-10-24 07:53:21 +0000990endif
Reid Spencerca5fe8f2004-11-02 16:56:15 +0000991 -$(Verb) $(RM) -f core core.[0-9][0-9]* *.o *.d *~ *.flc
Brian Gaeke9d3cd402004-01-21 19:53:11 +0000992ifneq ($(strip $(SHLIBEXT)),) # Extra paranoia - make real sure SHLIBEXT is set
Reid Spencerca5fe8f2004-11-02 16:56:15 +0000993 -$(Verb) $(RM) -f *$(SHLIBEXT)
Brian Gaeke9d3cd402004-01-21 19:53:11 +0000994endif
John Criswell7a73b802003-06-30 21:59:07 +0000995
Reid Spencer3d659492004-11-02 16:36:03 +0000996clean-all-local::
Reid Spencerca5fe8f2004-11-02 16:56:15 +0000997 -$(Verb) $(RM) -rf Debug Release Profile
Reid Spencer3d659492004-11-02 16:36:03 +0000998
Reid Spencercc2d1e22004-10-30 09:19:36 +0000999# Build tags database for Emacs/Xemacs:
Reid Spencer12d79512004-11-12 02:27:36 +00001000tags:: TAGS CTAGS
1001
Reid Spencercc2d1e22004-10-30 09:19:36 +00001002TAGS:
Reid Spencer12d79512004-11-12 02:27:36 +00001003 find $(BUILD_SRC_ROOT)/include $(BUILD_SRC_ROOT)/lib \
1004 $(BUILD_SRC_ROOT)/tools $(BUILD_SRC_ROOT)/examples \
1005 $(BUILD_OBJ_ROOT)/include $(BUILD_OBJ_ROOT)/lib \
1006 $(BUILD_OBJ_ROOT)/tools $(BUILD_OBJ_ROOT)/examples \
1007 -name '*.cpp' -o -name '*.h' | \
Reid Spencercc2d1e22004-10-30 09:19:36 +00001008 $(ETAGS) $(ETAGSFLAGS) -
1009
Reid Spencer12d79512004-11-12 02:27:36 +00001010CTAGS:
1011 find $(BUILD_SRC_ROOT)/include $(BUILD_SRC_ROOT)/lib \
1012 $(BUILD_SRC_ROOT)/tools $(BUILD_SRC_ROOT)/examples \
1013 $(BUILD_OBJ_ROOT)/include $(BUILD_OBJ_ROOT)/lib \
1014 $(BUILD_OBJ_ROOT)/tools $(BUILD_OBJ_ROOT)/examples \
1015 \( -name '*.cpp' -o -name '*.h' \) -print | \
1016 ctags -ImtT -o $(BUILD_OBJ_ROOT)/CTAGS -L -
1017
1018
Reid Spencer3a561f52004-10-23 20:04:14 +00001019###############################################################################
1020# DEPENDENCIES: Include the dependency files if we should
1021###############################################################################
Chris Lattner33ad24a2003-08-22 14:10:16 +00001022ifndef DISABLE_AUTO_DEPENDENCIES
1023
Reid Spencer3a561f52004-10-23 20:04:14 +00001024# If its not one of the cleaning targets
Reid Spencercc2d1e22004-10-30 09:19:36 +00001025ifneq ($strip($(filter-out clean clean-local dist-clean,$(MAKECMDGOALS))),)
Reid Spencer4d71b662004-10-22 21:01:56 +00001026
Reid Spencer3a561f52004-10-23 20:04:14 +00001027# Get the list of dependency files
Reid Spencercc2d1e22004-10-30 09:19:36 +00001028DependFiles := $(basename $(filter %.cpp %.c %.cc, $(Sources)))
Reid Spencer9af3b292004-11-01 07:50:27 +00001029DependFiles := $(patsubst %,$(BUILD_OBJ_DIR)/$(BuildMode)/%.d,$(DependFiles))
Misha Brukman4f7a8cf2003-11-09 21:36:19 +00001030
Reid Spencer3a561f52004-10-23 20:04:14 +00001031-include /dev/null $(DependFiles)
1032
John Criswelld741bcf2003-08-12 18:51:51 +00001033endif
Chris Lattner1ddb6b62003-08-18 17:27:40 +00001034
Reid Spencercc2d1e22004-10-30 09:19:36 +00001035endif
Reid Spencer4d71b662004-10-22 21:01:56 +00001036
Reid Spencer151f8ba2004-10-25 08:27:37 +00001037###############################################################################
Reid Spencercc2d1e22004-10-30 09:19:36 +00001038# DISTRIBUTION: Handle construction of a distribution tarball
Reid Spencer151f8ba2004-10-25 08:27:37 +00001039###############################################################################
1040
Reid Spencere45ebfa2004-10-26 07:09:33 +00001041#------------------------------------------------------------------------
1042# Define distribution related variables
1043#------------------------------------------------------------------------
Reid Spencer151f8ba2004-10-25 08:27:37 +00001044DistName := $(LLVM_TARBALL_NAME)
1045DistDir := $(BUILD_OBJ_ROOT)/$(DistName)
Reid Spencere45ebfa2004-10-26 07:09:33 +00001046TopDistDir := $(BUILD_OBJ_ROOT)/$(DistName)
Reid Spencer151f8ba2004-10-25 08:27:37 +00001047DistTarGZip := $(BUILD_OBJ_ROOT)/$(DistName).tar.gz
1048DistZip := $(BUILD_OBJ_ROOT)/$(DistName).zip
1049DistTarBZ2 := $(BUILD_OBJ_ROOT)/$(DistName).tar.bz2
1050DistAlways := CREDITS.TXT LICENSE.TXT README.txt README AUTHORS COPYING \
1051 ChangeLog INSTALL NEWS Makefile Makefile.common Makefile.rules \
Reid Spencere45ebfa2004-10-26 07:09:33 +00001052 Makefile.config.in configure autoconf
1053DistOther := $(notdir $(wildcard \
1054 $(BUILD_SRC_DIR)/*.h \
1055 $(BUILD_SRC_DIR)/*.td \
1056 $(BUILD_SRC_DIR)/*.def \
1057 $(BUILD_SRC_DIR)/*.ll \
1058 $(BUILD_SRC_DIR)/*.in))
Reid Spencercc2d1e22004-10-30 09:19:36 +00001059DistSubDirs := $(SubDirs)
Reid Spencerfbbf3072004-11-29 05:00:33 +00001060DistSources = $(Sources) $(EXTRA_DIST)
1061DistFiles = $(DistAlways) $(DistSources) $(DistOther)
Reid Spencer151f8ba2004-10-25 08:27:37 +00001062
Reid Spencere45ebfa2004-10-26 07:09:33 +00001063#------------------------------------------------------------------------
1064# We MUST build distribution with OBJ_DIR != SRC_DIR
1065#------------------------------------------------------------------------
1066ifeq ($(BUILD_SRC_DIR),$(BUILD_OBJ_DIR))
1067dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
Reid Spencercc2d1e22004-10-30 09:19:36 +00001068 $(Echo) ERROR: Target $@ only available with OBJ_DIR != SRC_DIR
Reid Spencere45ebfa2004-10-26 07:09:33 +00001069
1070DistCheckTop :=
1071else
1072
1073DistCheckTop := check
Reid Spencercc2d1e22004-10-30 09:19:36 +00001074
Reid Spencere45ebfa2004-10-26 07:09:33 +00001075#------------------------------------------------------------------------
1076# Prevent catastrophic remove
1077#------------------------------------------------------------------------
1078ifeq ($(LLVM_TARBALL_NAME),)
1079$(error LLVM_TARBALL_NAME is empty. Please rerun configure)
1080endif
1081
1082#------------------------------------------------------------------------
1083# Prevent attempt to run dist targets from anywhere but the top level
1084#------------------------------------------------------------------------
1085ifneq ($(LEVEL),.)
1086
1087dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
Reid Spencercc2d1e22004-10-30 09:19:36 +00001088 $(Echo) ERROR: You must run $@ from $(BUILD_OBJ_ROOT)
Reid Spencere45ebfa2004-10-26 07:09:33 +00001089
1090else
1091
1092#------------------------------------------------------------------------
1093# Provide the top level targets
1094#------------------------------------------------------------------------
1095
Reid Spencercc2d1e22004-10-30 09:19:36 +00001096dist-gzip:: $(DistTarGZip)
Reid Spencere45ebfa2004-10-26 07:09:33 +00001097
1098$(DistTarGZip) : distdir
Reid Spencercc2d1e22004-10-30 09:19:36 +00001099 $(Echo) Packing gzipped distribution tar file.
Reid Spencerfbbf3072004-11-29 05:00:33 +00001100 $(Verb) cd $(BUILD_OBJ_ROOT) ; $(TAR) chf - "$(DistName)" | \
1101 $(GZIP) -c > "$(DistTarGZip)"
Reid Spencere45ebfa2004-10-26 07:09:33 +00001102
Reid Spencercc2d1e22004-10-30 09:19:36 +00001103dist-bzip2:: $(DistTarBZ2)
Reid Spencere45ebfa2004-10-26 07:09:33 +00001104
1105$(DistTarBZ2) : distdir
Reid Spencercc2d1e22004-10-30 09:19:36 +00001106 $(Echo) Packing bzipped distribution tar file.
Reid Spencerfbbf3072004-11-29 05:00:33 +00001107 $(Verb) cd $(BUILD_OBJ_ROOT) ; $(TAR) chf - $(DistName) | \
1108 $(BZIP2) -c >$(DistTarBZ2)
Reid Spencere45ebfa2004-10-26 07:09:33 +00001109
Reid Spencercc2d1e22004-10-30 09:19:36 +00001110dist-zip:: $(DistZip)
Reid Spencere45ebfa2004-10-26 07:09:33 +00001111
1112$(DistZip) : distdir
Reid Spencercc2d1e22004-10-30 09:19:36 +00001113 $(Echo) Packing zipped distribution file.
1114 $(Verb) rm -f $(DistZip)
1115 $(Verb) cd $(BUILD_OBJ_ROOT) ; $(ZIP) -rq $(DistZip) $(DistName)
Reid Spencere45ebfa2004-10-26 07:09:33 +00001116
1117dist :: $(DistTarGZip) $(DistTarBZ2) $(DistZip)
Reid Spencercc2d1e22004-10-30 09:19:36 +00001118 $(Echo) ===== DISTRIBUTION PACKAGING SUCESSFUL =====
Reid Spencere45ebfa2004-10-26 07:09:33 +00001119
1120DistCheckDir := $(LLVM_OBJ_ROOT)/_distcheckdir
1121
Reid Spencer9411c642004-10-26 22:26:33 +00001122dist-check:: $(DistCheckTop) $(DistTarGZip)
Reid Spencercc2d1e22004-10-30 09:19:36 +00001123 $(Echo) Checking distribution tar file.
1124 $(Verb) if test -d $(DistCheckDir) ; then \
Reid Spencere45ebfa2004-10-26 07:09:33 +00001125 $(RM) -rf $(DistCheckDir) ; \
1126 fi
Reid Spencercc2d1e22004-10-30 09:19:36 +00001127 $(Verb) $(MKDIR) $(DistCheckDir)
1128 $(Verb) cd $(DistCheckDir) && \
Reid Spencere45ebfa2004-10-26 07:09:33 +00001129 $(MKDIR) $(DistCheckDir)/build && \
1130 $(MKDIR) $(DistCheckDir)/install && \
1131 gunzip -c $(DistTarGZip) | $(TAR) xf - && \
1132 cd build && \
1133 ../$(DistName)/configure --prefix="$(DistCheckDir)/install" \
1134 --srcdir=../$(DistName) --with-llvmgccdir="$(LLVMGCCDIR)" && \
1135 $(MAKE) check && \
1136 $(MAKE) install && \
1137 $(MAKE) uninstall && \
1138 $(MAKE) dist && \
1139 $(MAKE) clean && \
1140 $(MAKE) dist-clean && \
Reid Spencercc2d1e22004-10-30 09:19:36 +00001141 $(EchoCmd) ===== $(DistTarGZip) Ready For Distribution =====
Reid Spencere45ebfa2004-10-26 07:09:33 +00001142
1143dist-clean::
Reid Spencercc2d1e22004-10-30 09:19:36 +00001144 $(Echo) Cleaning distribution files
Reid Spencerca5fe8f2004-11-02 16:56:15 +00001145 -$(Verb) $(RM) -rf $(DistTarGZip) $(DistTarBZ2) $(DistZip) $(DistName) $(DistCheckDir)
Reid Spencere45ebfa2004-10-26 07:09:33 +00001146
1147endif
1148
1149#------------------------------------------------------------------------
1150# Provide the recursive distdir target for building the distribution directory
1151#------------------------------------------------------------------------
Reid Spencer9411c642004-10-26 22:26:33 +00001152distdir : $(DistSources)
Reid Spencercc2d1e22004-10-30 09:19:36 +00001153 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
Reid Spencere45ebfa2004-10-26 07:09:33 +00001154 if test -d "$(DistDir)" ; then \
1155 find $(DistDir) -type d ! -perm -200 -exec chmod u+w {} ';' || \
1156 exit 1 ; \
1157 fi ; \
Reid Spencercc2d1e22004-10-30 09:19:36 +00001158 $(EchoCmd) Removing $(DistDir) ; \
Reid Spencere45ebfa2004-10-26 07:09:33 +00001159 $(RM) -rf $(DistDir); \
1160 fi
Reid Spencerfbbf3072004-11-29 05:00:33 +00001161 $(Echo) Building Distribution Directory $(DistDir)
Reid Spencercc2d1e22004-10-30 09:19:36 +00001162 $(Verb) $(MKDIR) $(DistDir)
1163 $(Verb) srcdirstrip=`echo "$(BUILD_SRC_DIR)" | sed 's|.|.|g'`; \
Reid Spencer151f8ba2004-10-25 08:27:37 +00001164 srcrootstrip=`echo "$(BUILD_SRC_ROOT)" | sed 's|.|.|g'`; \
1165 for file in $(DistFiles) ; do \
1166 case "$$file" in \
1167 $(BUILD_SRC_DIR)/*) file=`echo "$$file" | sed "s#^$$srcdirstrip/##"`;; \
Reid Spencere45ebfa2004-10-26 07:09:33 +00001168 $(BUILD_SRC_ROOT)/*) file=`echo "$$file" | sed "s#^$$srcrootstrip/#$(BUILD_OBJ_ROOT)/#"`;; \
Reid Spencer151f8ba2004-10-25 08:27:37 +00001169 esac; \
1170 if test -f "$$file" || test -d "$$file" ; then \
1171 from_dir=. ; \
1172 else \
1173 from_dir=$(BUILD_SRC_DIR); \
1174 fi; \
1175 to_dir=`echo "$$file" | sed -e 's#/[^/]*$$##'`; \
1176 if test "$$to_dir" != "$$file" && test "$$to_dir" != "."; then \
1177 to_dir="$(DistDir)/$$dir"; \
1178 $(MKDIR) "$$to_dir" ; \
1179 else \
1180 to_dir="$(DistDir)"; \
1181 fi; \
1182 mid_dir=`echo "$$file" | sed -n -e 's#^\(.*\)/[^/]*$$#\1#p'`; \
1183 if test -n "$$mid_dir" ; then \
Reid Spencere45ebfa2004-10-26 07:09:33 +00001184 $(MKDIR) "$$to_dir/$$mid_dir" || exit 1; \
Reid Spencer151f8ba2004-10-25 08:27:37 +00001185 fi ; \
1186 if test -d "$$from_dir/$$file"; then \
1187 if test -d "$(BUILD_SRC_DIR)/$$file" && \
1188 test "$$from_dir" != "$(BUILD_SRC_DIR)" ; then \
1189 cp -pR "$(BUILD_SRC_DIR)/$$file" "$$to_dir" || exit 1; \
1190 fi; \
1191 cp -pR $$from_dir/$$file $$to_dir || exit 1; \
1192 elif test -f "$$from_dir/$$file" ; then \
1193 cp -p "$$from_dir/$$file" "$(DistDir)/$$file" || exit 1; \
1194 elif test -L "$$from_dir/$$file" ; then \
1195 cp -pd "$$from_dir/$$file" $(DistDir)/$$file || exit 1; \
1196 elif echo "$(DistAlways)" | grep -v "$$file" >/dev/null ; then \
Reid Spencercc2d1e22004-10-30 09:19:36 +00001197 $(EchoCmd) "===== WARNING: Distribution Source $$from_dir/$$file Not Found!" ; \
1198 elif test "$(Verb)" != '@' ; then \
1199 $(EchoCmd) "Skipping non-existent $$from_dir/$$file" ; \
Reid Spencer151f8ba2004-10-25 08:27:37 +00001200 fi; \
1201 done
Reid Spencercc2d1e22004-10-30 09:19:36 +00001202 $(Verb) for subdir in $(DistSubDirs) ; do \
Reid Spencer151f8ba2004-10-25 08:27:37 +00001203 if test "$$subdir" \!= "." ; then \
Reid Spencer151f8ba2004-10-25 08:27:37 +00001204 new_distdir="$(DistDir)/$$subdir" ; \
Reid Spencere45ebfa2004-10-26 07:09:33 +00001205 test -d "$$new_distdir" || $(MKDIR) "$$new_distdir" || exit 1; \
1206 ( cd $$subdir && $(MAKE) DistDir="$$new_distdir" distdir ) || exit 1; \
Reid Spencer151f8ba2004-10-25 08:27:37 +00001207 fi; \
1208 done
Reid Spencercc2d1e22004-10-30 09:19:36 +00001209 $(Verb) $(MAKE) DistDir="$(DistDir)" dist-hook || exit 1
1210 -$(Verb) find $(DistDir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
Reid Spencer151f8ba2004-10-25 08:27:37 +00001211 ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
1212 ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
1213 ! -type d ! -perm -444 -exec $(SHELL) $(INSTALL_SH) -c -m a+r {} {} \; \
1214 || chmod -R a+r $(DistDir)
1215
Reid Spencercc2d1e22004-10-30 09:19:36 +00001216# This is invoked by distdir target, define it as a no-op to avoid errors if not
1217# defined by user.
Reid Spencer151f8ba2004-10-25 08:27:37 +00001218dist-hook::
1219
Reid Spencere53e3972004-10-22 23:06:30 +00001220endif
Reid Spencer4d71b662004-10-22 21:01:56 +00001221
1222###############################################################################
Reid Spencere5487ba2004-10-24 07:53:21 +00001223# TOP LEVEL - targets only to apply at the top level directory
1224###############################################################################
1225
1226ifeq ($(LEVEL),.)
1227
1228#------------------------------------------------------------------------
Reid Spencere5487ba2004-10-24 07:53:21 +00001229# Install support for project's include files:
1230#------------------------------------------------------------------------
1231install-local::
Reid Spencercc2d1e22004-10-30 09:19:36 +00001232 $(Echo) Installing include files
1233 $(Verb) $(MKDIR) $(includedir)
1234 $(Verb) if [ -d "$(BUILD_SRC_ROOT)/include" ] ; then \
Reid Spencere5487ba2004-10-24 07:53:21 +00001235 cd $(BUILD_SRC_ROOT)/include && \
1236 find . -path '*/Internal' -prune -o '(' -type f \
1237 '!' '(' -name '*~' -o -name '.cvsignore' -o -name '.#*' ')' \
1238 -print ')' | grep -v CVS | pax -rwdvpe $(includedir) ; \
1239 fi
1240
1241uninstall-local::
Reid Spencercc2d1e22004-10-30 09:19:36 +00001242 $(Echo) Uninstalling include files
1243 $(Verb) if [ -d "$(BUILD_SRC_ROOT)/include" ] ; then \
Reid Spencere5487ba2004-10-24 07:53:21 +00001244 cd $(BUILD_SRC_ROOT)/include && \
1245 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f \
1246 '!' '(' -name '*~' -o -name '.cvsignore' -o -name '.#*' ')' \
1247 -print ')' | grep -v CVS | sed 's#^#$(includedir)/#'` ; \
1248 fi
1249
Reid Spencere5487ba2004-10-24 07:53:21 +00001250endif
1251
Reid Spencer4d71b662004-10-22 21:01:56 +00001252#------------------------------------------------------------------------
1253# Print out the directories used for building
Reid Spencercc2d1e22004-10-30 09:19:36 +00001254#------------------------------------------------------------------------
Reid Spencer3a561f52004-10-23 20:04:14 +00001255printvars::
Reid Spencer9af3b292004-11-01 07:50:27 +00001256 $(Echo) "BuildMode : " '$(BuildMode)'
Reid Spencercc2d1e22004-10-30 09:19:36 +00001257 $(Echo) "BUILD_SRC_ROOT : " '$(BUILD_SRC_ROOT)'
1258 $(Echo) "BUILD_SRC_DIR : " '$(BUILD_SRC_DIR)'
1259 $(Echo) "BUILD_OBJ_ROOT : " '$(BUILD_OBJ_ROOT)'
1260 $(Echo) "BUILD_OBJ_DIR : " '$(BUILD_OBJ_DIR)'
1261 $(Echo) "LLVM_SRC_ROOT : " '$(LLVM_SRC_ROOT)'
1262 $(Echo) "LLVM_OBJ_ROOT : " '$(LLVM_OBJ_ROOT)'
1263 $(Echo) "libdir : " '$(libdir)'
1264 $(Echo) "bindir : " '$(bindir)'
1265 $(Echo) "sysconfdir : " '$(sysconfdir)'
1266 $(Echo) "bytecode_libdir: " '$(bytecode_libdir)'
1267 $(Echo) "UserTargets : " '$(UserTargets)'
1268 $(Echo) "ObjMakefiles : " '$(ObjMakefiles)'
1269 $(Echo) "SrcMakefiles : " '$(SrcMakefiles)'
1270 $(Echo) "ObjDir : " '$(ObjDir)'
1271 $(Echo) "LibDir : " '$(LibDir)'
1272 $(Echo) "ToolDir : " '$(ToolDir)'
Reid Spencer815cbcf2004-11-18 10:03:46 +00001273 $(Echo) "ExmplDir : " '$(ExmplDir)'
Reid Spencercc2d1e22004-10-30 09:19:36 +00001274 $(Echo) "TDFiles : " '$(TDFiles)'
1275 $(Echo) "INCFiles : " '$(INCFiles)'
1276 $(Echo) "Compile.CXX : " '$(Compile.CXX)'
1277 $(Echo) "Compile.C : " '$(Compile.C)'
1278 $(Echo) "Archive : " '$(Archive)'
Reid Spencer3d659492004-11-02 16:36:03 +00001279 $(Echo) "YaccFiles : " '$(YaccFiles)'
1280 $(Echo) "LexFiles : " '$(LexFiles)'