1 #===-- Makefile.common - Common make rules for LLVM -------*- makefile -*--====
3 # This file is included by all of the LLVM makefiles. This file defines common
4 # rules to do things like compile a .cpp file or generate dependancy info.
5 # These are platform dependant, so this is the file used to specify these
6 # system dependant operations.
8 # The following functionality can be set by setting incoming variables.
9 # The variable $(LEVEL) *must* be set:
11 # 1. LEVEL - The level of the current subdirectory from the top of the
12 # MagicStats view. This level should be expressed as a path, for
13 # example, ../.. for two levels deep.
15 # 2. DIRS - A list of subdirectories to be built. Fake targets are set up
16 # so that each of the targets "all", "install", and "clean" each build
17 # the subdirectories before the local target. DIRS are guaranteed to be
20 # 3. PARALLEL_DIRS - A list of subdirectories to be built, but that may be
21 # built in any order. All DIRS are built in order before PARALLEL_DIRS are
22 # built, which are then built in any order.
24 # 4. Source - If specified, this sets the source code filenames. If this
25 # is not set, it defaults to be all of the .cpp, .c, .y, and .l files
26 # in the current directory. Also, if you want to build files in addition
27 # to the local files, you can use the ExtraSource variable
29 # 5. SourceDir - If specified, this specifies a directory that the source files
30 # are in, if they are not in the current directory. This should include a
31 # trailing / character.
33 #===-----------------------------------------------------------------------====
35 # Configuration file to set paths specific to local installation of LLVM
37 include $(LEVEL)/Makefile.config
39 # Figure out how to do platform specific stuff on this platform. This is really
40 # gross and should be autoconfiscated (automake actually), but should hopefully
41 # work on Linux and solaris (SunOS).
43 UNAME := $(shell uname)
44 include $(LEVEL)/Makefile.$(UNAME)
47 # if SHARED_LIBRARY is specified, the default is to build the dynamic lib
51 # Default Rule: Make sure it's also a :: rule
54 # Default for install is to at least build everything...
58 # Figure out which directory to build stuff into. We want to build into the
59 # /shared directory by default because it is guaranteed to be local to the
62 ifeq ($(LLVM_OBJ_DIR),.)
63 BUILD_ROOT = $(LLVM_OBJ_DIR)
64 BUILD_ROOT_TOP = $(LEVEL)
67 BUILD_ROOT := $(LLVM_OBJ_DIR)$(patsubst $(HOME)%,%,$(shell pwd))
69 # Calculate the BUILD_ROOT_TOP variable, which is the top of the llvm/ tree.
70 # Note that although this is just equal to $(BUILD_ROOT)/$(LEVEL), we cannot use
71 # this expression because some of the directories on the source tree may not
72 # exist in the build tree (for example the test/ heirarchy). Thus we evaluate
73 # the directory to eliminate the ../'s
76 TOP_DIRECTORY := $(shell cd $(TOPLEVEL); pwd)
78 TOP_DIRECTORY := $(shell cd $(LEVEL); pwd)
81 BUILD_ROOT_TOP := $(LLVM_OBJ_DIR)$(patsubst $(HOME)%,%,$(TOP_DIRECTORY))
87 #--------------------------------------------------------------------
88 # Variables derived from configuration options...
89 #--------------------------------------------------------------------
91 #BinInstDir=/usr/local/bin
92 #LibInstDir=/usr/local/lib/xxx
93 #DocInstDir=/usr/doc/xxx
97 PURIFY := $(PURIFY) -cache-dir="$(BUILD_ROOT_TOP)/../purifycache" -chain-length="30" -messages=all
99 ifdef ENABLE_PROFILING
101 CONFIGURATION := Profile
103 ifdef ENABLE_OPTIMIZED
104 CONFIGURATION := Release
106 CONFIGURATION := Debug
110 # Shorthand for commonly accessed directories
111 DESTLIBDEBUG := $(BUILD_ROOT_TOP)/lib/Debug
112 DESTLIBRELEASE := $(BUILD_ROOT_TOP)/lib/Release
113 DESTLIBPROFILE := $(BUILD_ROOT_TOP)/lib/Profile
114 DESTLIBCURRENT := $(BUILD_ROOT_TOP)/lib/$(CONFIGURATION)
117 LLVMLIBDEBUGSOURCE := $(LLVM_LIB_DIR)/lib/Debug
118 LLVMLIBRELEASESOURCE := $(LLVM_LIB_DIR)/lib/Release
119 LLVMLIBPROFILESOURCE := $(LLVM_LIB_DIR)/lib/Profile
120 LLVMLIBCURRENTSOURCE := $(LLVM_LIB_DIR)/lib/$(CONFIGURATION)
122 PROJLIBDEBUGSOURCE := $(BUILD_ROOT_TOP)/lib/Debug
123 PROJLIBRELEASESOURCE := $(BUILD_ROOT_TOP)/lib/Release
124 PROJLIBPROFILESOURCE := $(BUILD_ROOT_TOP)/lib/Profile
125 PROJLIBCURRENTSOURCE := $(BUILD_ROOT_TOP)/lib/$(CONFIGURATION)
129 LLVMLIBDEBUGSOURCE := $(BUILD_ROOT_TOP)/lib/Debug
130 LLVMLIBRELEASESOURCE := $(BUILD_ROOT_TOP)/lib/Release
131 LLVMLIBPROFILESOURCE := $(BUILD_ROOT_TOP)/lib/Profile
132 LLVMLIBCURRENTSOURCE := $(BUILD_ROOT_TOP)/lib/$(CONFIGURATION)
136 TOOLDEBUG := $(BUILD_ROOT_TOP)/tools/Debug
137 TOOLRELEASE := $(BUILD_ROOT_TOP)/tools/Release
138 TOOLPROFILE := $(BUILD_ROOT_TOP)/tools/Profile
139 TOOLCURRENT := $(BUILD_ROOT_TOP)/tools/$(CONFIGURATION)
146 #---------------------------------------------------------
147 # Compilation options...
148 #---------------------------------------------------------
150 # Special tools used while building the LLVM tree. Burg is built as part of the
153 BURG := $(TOOLCURRENT)/burg
154 RunBurg := $(BURG) $(BURG_OPTS)
156 TBLGEN := $(TOOLCURRENT)/tblgen
158 # Enable this for profiling support with 'gprof'
159 # This automatically enables optimized builds.
160 ifdef ENABLE_PROFILING
164 #if PROJDIR is defined then we include PROJ DIR includes and libraries
168 PROJ_INCLUDE = $(PROJ_DIR)/include
171 # By default, strip symbol information from executable
173 STRIP = $(PLATFORMSTRIPOPTS)
174 STRIP_WARN_MSG = "(without symbols) "
177 # Allow gnu extensions...
178 CPPFLAGS += -D_GNU_SOURCE
180 # -Wno-unused-parameter
181 CompileCommonOpts := -Wall -W -Wwrite-strings -Wno-unused -I$(LEVEL)/include -I$(PROJ_INCLUDE)
182 CompileOptimizeOpts := -O3 -DNDEBUG -finline-functions -fshort-enums
184 # Compile a cpp file, don't link...
185 Compile := $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CompileCommonOpts)
186 CompileG := $(Compile) -g -D_DEBUG
187 CompileO := $(Compile) $(CompileOptimizeOpts) -felide-constructors -fomit-frame-pointer
188 CompileP := $(Compile) $(CompileOptimizeOpts) -felide-constructors $(PROFILE)
190 # Compile a c file, don't link...
191 CompileC := $(CC) -c $(CPPFLAGS) $(CCFLAGS) $(CompileCommonOpts)
192 CompileCG := $(CompileC) -g -D_DEBUG
193 CompileCO := $(CompileC) $(CompileOptimizeOpts) -fomit-frame-pointer
194 CompileCP := $(CompileC) $(CompileOptimizeOpts) $(PROFILE)
197 # Link final executable
199 ifdef ENABLE_PURIFY # To enable purify, build with 'gmake ENABLE_PURIFY=1'
200 Link := $(PURIFY) $(CXX) -static
206 LinkG := $(Link) -g -L$(PROJLIBDEBUGSOURCE) -L$(LLVMLIBDEBUGSOURCE) $(STRIP)
207 LinkO := $(Link) -O3 -L$(PROJLIBRELEASESOURCE) -L$(LLVMLIBRELEASESOURCE)
208 LinkP := $(Link) -O3 -L$(PROJLIBPROFILESOURCE) -L$(LLVMLIBPROFILESOURCE) $(PROFILE)
210 LinkG := $(Link) -g -L$(LLVMLIBDEBUGSOURCE) $(STRIP)
211 LinkO := $(Link) -O3 -L$(LLVMLIBRELEASESOURCE)
212 LinkP := $(Link) -O3 -L$(LLVMLIBPROFILESOURCE) $(PROFILE)
217 # Create one .o file from a bunch of .o files...
220 # MakeSO - Create a .so file from a .o files...
221 MakeSO := $(CXX) $(MakeSharedObjectOption)
222 MakeSOO := $(MakeSO) -O3
223 MakeSOP := $(MakeSOO) $(PROFILE)
225 # Create dependancy file from CPP file, send to stdout.
226 Depend := $(CXX) -MM -I$(LEVEL)/include -I$(PROJ_INCLUDE) $(CPPFLAGS)
227 DependC := $(CC) -MM -I$(LEVEL)/include -I$(PROJ_INCLUDE) $(CPPFLAGS)
229 # Archive a bunch of .o files into a .a file...
232 #----------------------------------------------------------
234 # Source includes all of the cpp files, and objects are derived from the
236 # The local Makefile can list other Source files via ExtraSource = ...
239 Source := $(ExtraSource) $(wildcard *.cpp *.c *.y *.l)
242 Objs := $(sort $(patsubst Debug/%.o, %.o, $(addsuffix .o,$(notdir $(basename $(Source))))))
243 ObjectsO := $(addprefix $(BUILD_ROOT)/Release/,$(Objs))
244 ObjectsP := $(addprefix $(BUILD_ROOT)/Profile/,$(Objs))
245 ObjectsG := $(addprefix $(BUILD_ROOT)/Debug/,$(Objs))
248 #---------------------------------------------------------
249 # Handle the DIRS and PARALLEL_DIRS options
250 #---------------------------------------------------------
253 all install clean test ::
254 $(VERB) for dir in ${DIRS}; do \
255 (cd $$dir; $(MAKE) $@) || exit 1; \
259 # Handle PARALLEL_DIRS
261 all :: $(addsuffix /.makeall , $(PARALLEL_DIRS))
262 install :: $(addsuffix /.makeinstall, $(PARALLEL_DIRS))
263 clean :: $(addsuffix /.makeclean , $(PARALLEL_DIRS))
264 test :: $(addsuffix /.maketest , $(PARALLEL_DIRS))
266 %/.makeall %/.makeinstall %/.makeclean %/.maketest:
267 $(VERB) cd $(@D); $(MAKE) $(subst $(@D)/.make,,$@)
270 #---------------------------------------------------------
271 # Handle the LIBRARYNAME option - used when building libs...
272 #---------------------------------------------------------
274 # When libraries are built, they are allowed to optionally define the
275 # DONT_BUILD_RELINKED make variable, which, when defined, prevents a .o file
276 # from being built for the library. This .o files may then be linked to by a
277 # tool if the tool does not need (or want) the semantics a .a file provides
278 # (linking in only object files that are "needed"). If a library is never to
279 # be used in this way, it is better to define DONT_BUILD_RELINKED, and define
280 # BUILD_ARCHIVE instead.
282 # Some libraries must be built as .a files (libscalar for example) because if
283 # it's built as a .o file, then all of the constituent .o files in it will be
284 # linked into tools (for example gccas) even if they only use one of the parts
285 # of it. For this reason, sometimes it's useful to use libraries as .a files.
289 # Make sure there isn't any extranous whitespace on the LIBRARYNAME option
290 LIBRARYNAME := $(strip $(LIBRARYNAME))
292 LIBNAME_O := $(DESTLIBRELEASE)/lib$(LIBRARYNAME).so
293 LIBNAME_P := $(DESTLIBPROFILE)/lib$(LIBRARYNAME).so
294 LIBNAME_G := $(DESTLIBDEBUG)/lib$(LIBRARYNAME).so
295 LIBNAME_AO := $(DESTLIBRELEASE)/lib$(LIBRARYNAME).a
296 LIBNAME_AP := $(DESTLIBPROFILE)/lib$(LIBRARYNAME).a
297 LIBNAME_AG := $(DESTLIBDEBUG)/lib$(LIBRARYNAME).a
298 LIBNAME_OBJO := $(DESTLIBRELEASE)/$(LIBRARYNAME).o
299 LIBNAME_OBJP := $(DESTLIBPROFILE)/$(LIBRARYNAME).o
300 LIBNAME_OBJG := $(DESTLIBDEBUG)/$(LIBRARYNAME).o
302 # dynamic target builds a shared object version of the library...
303 dynamic:: $(DESTLIBCURRENT)/lib$(LIBRARYNAME).so
305 # Does the library want a .o version built?
306 ifndef DONT_BUILD_RELINKED
307 all:: $(DESTLIBCURRENT)/$(LIBRARYNAME).o
310 # Does the library want an archive version built?
312 all:: $(DESTLIBCURRENT)/lib$(LIBRARYNAME).a
315 $(LIBNAME_O): $(ObjectsO) $(LibSubDirs) $(DESTLIBRELEASE)/.dir
316 @echo ======= Linking $(LIBRARYNAME) release library =======
317 $(VERB) $(MakeSOO) -o $@ $(ObjectsO) $(LibSubDirs) $(LibLinkOpts)
319 $(LIBNAME_P): $(ObjectsP) $(LibSubDirs) $(DESTLIBPROFILE)/.dir
320 @echo ======= Linking $(LIBRARYNAME) profile library =======
321 $(VERB) $(MakeSOP) -o $@ $(ObjectsP) $(LibSubDirs) $(LibLinkOpts)
323 $(LIBNAME_G): $(ObjectsG) $(LibSubDirs) $(DESTLIBDEBUG)/.dir
324 @echo ======= Linking $(LIBRARYNAME) debug library =======
325 $(VERB) $(MakeSO) -g -o $@ $(ObjectsG) $(LibSubDirs) $(LibLinkOpts)
327 $(LIBNAME_AO): $(ObjectsO) $(LibSubDirs) $(DESTLIBRELEASE)/.dir
328 @echo ======= Linking $(LIBRARYNAME) release library =======
330 $(VERB) $(AR) $@ $(ObjectsO) $(LibSubDirs)
332 $(LIBNAME_AP): $(ObjectsP) $(LibSubDirs) $(DESTLIBPROFILE)/.dir
333 @echo ======= Linking $(LIBRARYNAME) profile library =======
335 $(VERB) $(AR) $@ $(ObjectsP) $(LibSubDirs)
337 $(LIBNAME_AG): $(ObjectsG) $(LibSubDirs) $(DESTLIBDEBUG)/.dir
338 @echo ======= Linking $(LIBRARYNAME) debug library =======
340 $(VERB) $(AR) $@ $(ObjectsG) $(LibSubDirs)
342 $(LIBNAME_OBJO): $(ObjectsO) $(LibSubDirs) $(DESTLIBRELEASE)/.dir
344 $(VERB) $(Relink) -o $@ $(ObjectsO) $(LibSubDirs)
346 $(LIBNAME_OBJP): $(ObjectsP) $(LibSubDirs) $(DESTLIBPROFILE)/.dir
348 $(VERB) $(Relink) -o $@ $(ObjectsP) $(LibSubDirs)
350 $(LIBNAME_OBJG): $(ObjectsG) $(LibSubDirs) $(DESTLIBDEBUG)/.dir
352 $(VERB) $(Relink) -o $@ $(ObjectsG) $(LibSubDirs)
356 #------------------------------------------------------------------------
357 # Create a TAGS database for emacs
358 #------------------------------------------------------------------------
362 etags -l c++ `find include lib tools -name '*.cpp' -o -name '*.h'`
366 #------------------------------------------------------------------------
367 # Handle the TOOLNAME option - used when building tool executables...
368 #------------------------------------------------------------------------
370 # The TOOLNAME option should be used with a USEDLIBS variable that tells the
371 # libraries (and the order of the libs) that should be linked to the
372 # tool. USEDLIBS should contain a list of library names (some with .a extension)
373 # that are automatically linked in as .o files unless the .a suffix is added.
377 # TOOLEXENAME* - These compute the output filenames to generate...
378 TOOLEXENAME_G := $(BUILD_ROOT_TOP)/tools/Debug/$(TOOLNAME)
379 TOOLEXENAME_O := $(BUILD_ROOT_TOP)/tools/Release/$(TOOLNAME)
380 TOOLEXENAME_P := $(BUILD_ROOT_TOP)/tools/Profile/$(TOOLNAME)
381 TOOLEXENAMES := $(BUILD_ROOT_TOP)/tools/$(CONFIGURATION)/$(TOOLNAME)
383 # USED_LIBS_OPTIONS - Compute the options line that add -llib1 -llib2, etc.
386 PROJ_LIBS_OPTIONS := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS)))
387 PROJ_LIBS_OPTIONS_G := $(patsubst %.o, $(PROJLIBDEBUGSOURCE)/%.o, $(PROJ_LIBS_OPTIONS))
388 PROJ_LIBS_OPTIONS_O := $(patsubst %.o, $(PROJLIBRELEASESOURCE)/%.o,$(PROJ_LIBS_OPTIONS))
389 PROJ_LIBS_OPTIONS_P := $(patsubst %.o, $(PROJLIBPROFILESOURCE)/%.o,$(PROJ_LIBS_OPTIONS))
391 LLVM_LIBS_OPTIONS := $(patsubst %.a.o, -l%, $(addsuffix .o, $(LLVMLIBS)))
392 LLVM_LIBS_OPTIONS_G := $(patsubst %.o, $(LLVMLIBDEBUGSOURCE)/%.o, $(LLVM_LIBS_OPTIONS))
393 LLVM_LIBS_OPTIONS_O := $(patsubst %.o, $(LLVMLIBRELEASESOURCE)/%.o,$(LLVM_LIBS_OPTIONS))
394 LLVM_LIBS_OPTIONS_P := $(patsubst %.o, $(LLVMLIBPROFILESOURCE)/%.o,$(LLVM_LIBS_OPTIONS))
396 LIB_OPTS_G := $(LLVM_LIBS_OPTIONS_G) $(PROJ_LIBS_OPTIONS_G)
397 LIB_OPTS_O := $(LLVM_LIBS_OPTIONS_O) $(PROJ_LIBS_OPTIONS_P)
398 LIB_OPTS_P := $(LLVM_LIBS_OPTIONS_P) $(PROJ_LIBS_OPTIONS_P)
402 LLVM_LIBS_OPTIONS := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS)))
403 LLVM_LIBS_OPTIONS_G := $(patsubst %.o, $(LLVMLIBDEBUGSOURCE)/%.o, $(LLVM_LIBS_OPTIONS))
404 LLVM_LIBS_OPTIONS_O := $(patsubst %.o, $(LLVMLIBRELEASESOURCE)/%.o,$(LLVM_LIBS_OPTIONS))
405 LLVM_LIBS_OPTIONS_P := $(patsubst %.o, $(LLVMLIBPROFILESOURCE)/%.o,$(LLVM_LIBS_OPTIONS))
407 LIB_OPTS_G := $(LLVM_LIBS_OPTIONS_G)
408 LIB_OPTS_O := $(LLVM_LIBS_OPTIONS_O)
409 LIB_OPTS_P := $(LLVM_LIBS_OPTIONS_P)
417 # USED_LIB_PATHS - Compute the path of the libraries used so that tools are
418 # rebuilt if libraries change. This has to make sure to handle .a/.so and .o
421 STATICUSEDLIBS := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(USEDLIBS)))
422 USED_LIB_PATHS_G := $(addprefix $(DESTLIBDEBUG)/, $(STATICUSEDLIBS))
423 USED_LIB_PATHS_O := $(addprefix $(DESTLIBRELEASE)/, $(STATICUSEDLIBS))
424 USED_LIB_PATHS_P := $(addprefix $(DESTLIBPROFILE)/, $(STATICUSEDLIBS))
425 LINK_OPTS := $(TOOLLINKOPTS) $(PLATFORMLINKOPTS)
432 # Tell make that we need to rebuild subdirectories before we can link the tool.
433 # This affects things like LLI which has library subdirectories.
434 $(USED_LIB_PATHS_G) $(USED_LIB_PATHS_O) $(USED_LIB_PATHS_P): \
435 $(addsuffix /.makeall, $(PARALLEL_DIRS))
437 all:: $(TOOLEXENAMES)
439 $(VERB) rm -f $(TOOLEXENAMES)
441 $(TOOLEXENAME_G): $(ObjectsG) $(USED_LIB_PATHS_G) $(TOOLDEBUG)/.dir
442 @echo ======= Linking $(TOOLNAME) debug executable $(STRIP_WARN_MSG)=======
443 $(VERB) $(LinkG) -o $@ $(ObjectsG) $(LIB_OPTS_G) $(LINK_OPTS)
445 $(TOOLEXENAME_O): $(ObjectsO) $(USED_LIB_PATHS_O) $(TOOLRELEASE)/.dir
446 @echo ======= Linking $(TOOLNAME) release executable =======
447 $(VERB) $(LinkO) -o $@ $(ObjectsO) $(LIB_OPTS_O) $(LINK_OPTS)
449 $(TOOLEXENAME_P): $(ObjectsP) $(USED_LIB_PATHS_P) $(TOOLPROFILE)/.dir
450 @echo ======= Linking $(TOOLNAME) profile executable =======
451 $(VERB) $(LinkP) -o $@ $(ObjectsP) $(LIB_OPTS_P) $(LINK_OPTS)
457 #---------------------------------------------------------
458 .PRECIOUS: $(BUILD_ROOT)/Depend/.dir
459 .PRECIOUS: $(BUILD_ROOT)/Debug/.dir $(BUILD_ROOT)/Release/.dir
461 # Create .o files in the ObjectFiles directory from the .cpp and .c files...
462 $(BUILD_ROOT)/Release/%.o: $(SourceDir)%.cpp $(BUILD_ROOT)/Release/.dir
464 $(VERB) $(CompileO) $< -o $@
466 $(BUILD_ROOT)/Release/%.o: $(SourceDir)%.c $(BUILD_ROOT)/Release/.dir
467 $(VERB) $(CompileCO) $< -o $@
469 $(BUILD_ROOT)/Profile/%.o: $(SourceDir)%.cpp $(BUILD_ROOT)/Profile/.dir
471 $(VERB) $(CompileP) $< -o $@
473 $(BUILD_ROOT)/Profile/%.o: $(SourceDir)%.c $(BUILD_ROOT)/Profile/.dir
475 $(VERB) $(CompileCP) $< -o $@
477 $(BUILD_ROOT)/Debug/%.o: $(SourceDir)%.cpp $(BUILD_ROOT)/Debug/.dir
479 $(VERB) $(CompileG) $< -o $@
481 $(BUILD_ROOT)/Debug/%.o: $(SourceDir)%.c $(BUILD_ROOT)/Debug/.dir
482 $(VERB) $(CompileCG) $< -o $@
485 # Rules for building lex/yacc files
487 LEX_FILES = $(filter %.l, $(Source))
488 LEX_OUTPUT = $(LEX_FILES:%.l=%.cpp)
489 YACC_FILES = $(filter %.y, $(Source))
490 YACC_OUTPUT = $(addprefix $(YACC_FILES:%.y=%), .h .cpp .output)
491 .PRECIOUS: $(LEX_OUTPUT) $(YACC_OUTPUT)
493 # Create a .cpp source file from a flex input file... this uses sed to cut down
494 # on the warnings emited by GCC...
496 # The last line is a gross hack to work around flex aparently not being able to
497 # resize the buffer on a large token input. Currently, for uninitialized string
498 # buffers in LLVM we can generate very long tokens, so this is a hack around it.
499 # FIXME. (f.e. char Buffer[10000]; )
502 $(FLEX) -t $< | sed '/^find_rule/d' | \
503 sed 's/void yyunput/inline void yyunput/' | \
504 sed 's/void \*yy_flex_realloc/inline void *yy_flex_realloc/' | \
505 sed 's/#define YY_BUF_SIZE 16384/#define YY_BUF_SIZE (16384*64)/' > $@
507 # Rule for building the bison parsers...
508 %.c: %.y # Cancel built-in rules for yacc
509 %.h: %.y # Cancel built-in rules for yacc
511 @echo Bison\'ing $<...
512 $(VERB) $(BISON) -v -d -p $(<:%Parser.y=%) $*.y
513 $(VERB) mv -f $*.tab.c $*.cpp
514 $(VERB) mv -f $*.tab.h $*.h
516 # To create the directories...
521 # To create postscript files from dot files...
525 # 'make clean' nukes the tree
527 $(VERB) rm -rf $(BUILD_ROOT)/Debug $(BUILD_ROOT)/Release $(BUILD_ROOT)/Profile $(BUILD_ROOT)/Depend
528 $(VERB) rm -f core core.[0-9][0-9]* *.o *.d *.so *~ *.flc
529 $(VERB) rm -f $(LEX_OUTPUT) $(YACC_OUTPUT)
531 # If dependencies were generated for the file that included this file,
532 # include the dependancies now...
534 SourceBaseNames := $(basename $(notdir $(filter-out Debug/%, $(Source))))
535 SourceDepend := $(SourceBaseNames:%=$(BUILD_ROOT)/Depend/%.d)
537 # Create dependencies for the *.cpp files...
539 $(BUILD_ROOT)/Depend/%.d: $(SourceDir)%.cpp $(BUILD_ROOT)/Depend/.dir
540 $(VERB) $(Depend) $< | sed 's|$*\.o *|$(BUILD_ROOT)/Release/& $(BUILD_ROOT)/Profile/& $(BUILD_ROOT)/Debug/& $(BUILD_ROOT)/Depend/$(@F)|g' > $@
542 # Create dependencies for the *.c files...
544 $(BUILD_ROOT)/Depend/%.d: $(SourceDir)%.c $(BUILD_ROOT)/Depend/.dir
545 $(VERB) $(DependC) $< | sed 's|$*\.o *|Release/& Profile/& Debug/& Depend/$(@F)|g' > $@
547 ifneq ($(SourceDepend),)
548 -include $(SourceDepend)