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)
157 # Enable this for profiling support with 'gprof'
158 # This automatically enables optimized builds.
159 ifdef ENABLE_PROFILING
163 #if PROJDIR is defined then we include PROJ DIR includes and libraries
167 PROJ_INCLUDE = $(PROJ_DIR)/include
170 # By default, strip symbol information from executable
172 STRIP = $(PLATFORMSTRIPOPTS)
173 STRIP_WARN_MSG = "(without symbols) "
176 # Allow gnu extensions...
177 CPPFLAGS += -D_GNU_SOURCE
179 # -Wno-unused-parameter
180 CompileCommonOpts := -Wall -W -Wwrite-strings -Wno-unused -I$(LEVEL)/include -I$(PROJ_INCLUDE)
181 CompileOptimizeOpts := -O3 -DNDEBUG -finline-functions -fshort-enums
183 # Compile a cpp file, don't link...
184 Compile := $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CompileCommonOpts)
185 CompileG := $(Compile) -g -D_DEBUG
186 CompileO := $(Compile) $(CompileOptimizeOpts) -felide-constructors -fomit-frame-pointer
187 CompileP := $(Compile) $(CompileOptimizeOpts) -felide-constructors $(PROFILE)
189 # Compile a c file, don't link...
190 CompileC := $(CC) -c $(CPPFLAGS) $(CCFLAGS) $(CompileCommonOpts)
191 CompileCG := $(CompileC) -g -D_DEBUG
192 CompileCO := $(CompileC) $(CompileOptimizeOpts) -fomit-frame-pointer
193 CompileCP := $(CompileC) $(CompileOptimizeOpts) $(PROFILE)
196 # Link final executable
198 ifdef ENABLE_PURIFY # To enable purify, build with 'gmake ENABLE_PURIFY=1'
199 Link := $(PURIFY) $(CXX) -static
205 LinkG := $(Link) -g -L$(PROJLIBDEBUGSOURCE) -L$(LLVMLIBDEBUGSOURCE) $(STRIP)
206 LinkO := $(Link) -O3 -L$(PROJLIBRELEASESOURCE) -L$(LLVMLIBRELEASESOURCE)
207 LinkP := $(Link) -O3 -L$(PROJLIBPROFILESOURCE) -L$(LLVMLIBPROFILESOURCE) $(PROFILE)
209 LinkG := $(Link) -g -L$(LLVMLIBDEBUGSOURCE) $(STRIP)
210 LinkO := $(Link) -O3 -L$(LLVMLIBRELEASESOURCE)
211 LinkP := $(Link) -O3 -L$(LLVMLIBPROFILESOURCE) $(PROFILE)
216 # Create one .o file from a bunch of .o files...
219 # MakeSO - Create a .so file from a .o files...
220 MakeSO := $(CXX) $(MakeSharedObjectOption)
221 MakeSOO := $(MakeSO) -O3
222 MakeSOP := $(MakeSOO) $(PROFILE)
224 # Create dependancy file from CPP file, send to stdout.
225 Depend := $(CXX) -MM -I$(LEVEL)/include -I$(PROJ_INCLUDE) $(CPPFLAGS)
226 DependC := $(CC) -MM -I$(LEVEL)/include -I$(PROJ_INCLUDE) $(CPPFLAGS)
228 # Archive a bunch of .o files into a .a file...
231 #----------------------------------------------------------
233 # Source includes all of the cpp files, and objects are derived from the
235 # The local Makefile can list other Source files via ExtraSource = ...
238 Source := $(ExtraSource) $(wildcard *.cpp *.c *.y *.l)
241 Objs := $(sort $(patsubst Debug/%.o, %.o, $(addsuffix .o,$(notdir $(basename $(Source))))))
242 ObjectsO := $(addprefix $(BUILD_ROOT)/Release/,$(Objs))
243 ObjectsP := $(addprefix $(BUILD_ROOT)/Profile/,$(Objs))
244 ObjectsG := $(addprefix $(BUILD_ROOT)/Debug/,$(Objs))
247 #---------------------------------------------------------
248 # Handle the DIRS and PARALLEL_DIRS options
249 #---------------------------------------------------------
252 all install clean test ::
253 $(VERB) for dir in ${DIRS}; do \
254 (cd $$dir; $(MAKE) $@) || exit 1; \
258 # Handle PARALLEL_DIRS
260 all :: $(addsuffix /.makeall , $(PARALLEL_DIRS))
261 install :: $(addsuffix /.makeinstall, $(PARALLEL_DIRS))
262 clean :: $(addsuffix /.makeclean , $(PARALLEL_DIRS))
263 test :: $(addsuffix /.maketest , $(PARALLEL_DIRS))
265 %/.makeall %/.makeinstall %/.makeclean %/.maketest:
266 $(VERB) cd $(@D); $(MAKE) $(subst $(@D)/.make,,$@)
269 #---------------------------------------------------------
270 # Handle the LIBRARYNAME option - used when building libs...
271 #---------------------------------------------------------
273 # When libraries are built, they are allowed to optionally define the
274 # DONT_BUILD_RELINKED make variable, which, when defined, prevents a .o file
275 # from being built for the library. This .o files may then be linked to by a
276 # tool if the tool does not need (or want) the semantics a .a file provides
277 # (linking in only object files that are "needed"). If a library is never to
278 # be used in this way, it is better to define DONT_BUILD_RELINKED, and define
279 # BUILD_ARCHIVE instead.
281 # Some libraries must be built as .a files (libscalar for example) because if
282 # it's built as a .o file, then all of the constituent .o files in it will be
283 # linked into tools (for example gccas) even if they only use one of the parts
284 # of it. For this reason, sometimes it's useful to use libraries as .a files.
288 # Make sure there isn't any extranous whitespace on the LIBRARYNAME option
289 LIBRARYNAME := $(strip $(LIBRARYNAME))
291 LIBNAME_O := $(DESTLIBRELEASE)/lib$(LIBRARYNAME).so
292 LIBNAME_P := $(DESTLIBPROFILE)/lib$(LIBRARYNAME).so
293 LIBNAME_G := $(DESTLIBDEBUG)/lib$(LIBRARYNAME).so
294 LIBNAME_AO := $(DESTLIBRELEASE)/lib$(LIBRARYNAME).a
295 LIBNAME_AP := $(DESTLIBPROFILE)/lib$(LIBRARYNAME).a
296 LIBNAME_AG := $(DESTLIBDEBUG)/lib$(LIBRARYNAME).a
297 LIBNAME_OBJO := $(DESTLIBRELEASE)/$(LIBRARYNAME).o
298 LIBNAME_OBJP := $(DESTLIBPROFILE)/$(LIBRARYNAME).o
299 LIBNAME_OBJG := $(DESTLIBDEBUG)/$(LIBRARYNAME).o
301 # dynamic target builds a shared object version of the library...
302 dynamic:: $(DESTLIBCURRENT)/lib$(LIBRARYNAME).so
304 # Does the library want a .o version built?
305 ifndef DONT_BUILD_RELINKED
306 all:: $(DESTLIBCURRENT)/$(LIBRARYNAME).o
309 # Does the library want an archive version built?
311 all:: $(DESTLIBCURRENT)/lib$(LIBRARYNAME).a
314 $(LIBNAME_O): $(ObjectsO) $(LibSubDirs) $(DESTLIBRELEASE)/.dir
315 @echo ======= Linking $(LIBRARYNAME) release library =======
316 $(VERB) $(MakeSOO) -o $@ $(ObjectsO) $(LibSubDirs) $(LibLinkOpts)
318 $(LIBNAME_P): $(ObjectsP) $(LibSubDirs) $(DESTLIBPROFILE)/.dir
319 @echo ======= Linking $(LIBRARYNAME) profile library =======
320 $(VERB) $(MakeSOP) -o $@ $(ObjectsP) $(LibSubDirs) $(LibLinkOpts)
322 $(LIBNAME_G): $(ObjectsG) $(LibSubDirs) $(DESTLIBDEBUG)/.dir
323 @echo ======= Linking $(LIBRARYNAME) debug library =======
324 $(VERB) $(MakeSO) -g -o $@ $(ObjectsG) $(LibSubDirs) $(LibLinkOpts)
326 $(LIBNAME_AO): $(ObjectsO) $(LibSubDirs) $(DESTLIBRELEASE)/.dir
327 @echo ======= Linking $(LIBRARYNAME) release library =======
329 $(VERB) $(AR) $@ $(ObjectsO) $(LibSubDirs)
331 $(LIBNAME_AP): $(ObjectsP) $(LibSubDirs) $(DESTLIBPROFILE)/.dir
332 @echo ======= Linking $(LIBRARYNAME) profile library =======
334 $(VERB) $(AR) $@ $(ObjectsP) $(LibSubDirs)
336 $(LIBNAME_AG): $(ObjectsG) $(LibSubDirs) $(DESTLIBDEBUG)/.dir
337 @echo ======= Linking $(LIBRARYNAME) debug library =======
339 $(VERB) $(AR) $@ $(ObjectsG) $(LibSubDirs)
341 $(LIBNAME_OBJO): $(ObjectsO) $(LibSubDirs) $(DESTLIBRELEASE)/.dir
343 $(VERB) $(Relink) -o $@ $(ObjectsO) $(LibSubDirs)
345 $(LIBNAME_OBJP): $(ObjectsP) $(LibSubDirs) $(DESTLIBPROFILE)/.dir
347 $(VERB) $(Relink) -o $@ $(ObjectsP) $(LibSubDirs)
349 $(LIBNAME_OBJG): $(ObjectsG) $(LibSubDirs) $(DESTLIBDEBUG)/.dir
351 $(VERB) $(Relink) -o $@ $(ObjectsG) $(LibSubDirs)
355 #------------------------------------------------------------------------
356 # Create a TAGS database for emacs
357 #------------------------------------------------------------------------
361 etags -l c++ `find include lib tools -name '*.cpp' -o -name '*.h'`
365 #------------------------------------------------------------------------
366 # Handle the TOOLNAME option - used when building tool executables...
367 #------------------------------------------------------------------------
369 # The TOOLNAME option should be used with a USEDLIBS variable that tells the
370 # libraries (and the order of the libs) that should be linked to the
371 # tool. USEDLIBS should contain a list of library names (some with .a extension)
372 # that are automatically linked in as .o files unless the .a suffix is added.
376 # TOOLEXENAME* - These compute the output filenames to generate...
377 TOOLEXENAME_G := $(BUILD_ROOT_TOP)/tools/Debug/$(TOOLNAME)
378 TOOLEXENAME_O := $(BUILD_ROOT_TOP)/tools/Release/$(TOOLNAME)
379 TOOLEXENAME_P := $(BUILD_ROOT_TOP)/tools/Profile/$(TOOLNAME)
380 TOOLEXENAMES := $(BUILD_ROOT_TOP)/tools/$(CONFIGURATION)/$(TOOLNAME)
382 # USED_LIBS_OPTIONS - Compute the options line that add -llib1 -llib2, etc.
385 PROJ_LIBS_OPTIONS := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS)))
386 PROJ_LIBS_OPTIONS_G := $(patsubst %.o, $(PROJLIBDEBUGSOURCE)/%.o, $(PROJ_LIBS_OPTIONS))
387 PROJ_LIBS_OPTIONS_O := $(patsubst %.o, $(PROJLIBRELEASESOURCE)/%.o,$(PROJ_LIBS_OPTIONS))
388 PROJ_LIBS_OPTIONS_P := $(patsubst %.o, $(PROJLIBPROFILESOURCE)/%.o,$(PROJ_LIBS_OPTIONS))
390 LLVM_LIBS_OPTIONS := $(patsubst %.a.o, -l%, $(addsuffix .o, $(LLVMLIBS)))
391 LLVM_LIBS_OPTIONS_G := $(patsubst %.o, $(LLVMLIBDEBUGSOURCE)/%.o, $(LLVM_LIBS_OPTIONS))
392 LLVM_LIBS_OPTIONS_O := $(patsubst %.o, $(LLVMLIBRELEASESOURCE)/%.o,$(LLVM_LIBS_OPTIONS))
393 LLVM_LIBS_OPTIONS_P := $(patsubst %.o, $(LLVMLIBPROFILESOURCE)/%.o,$(LLVM_LIBS_OPTIONS))
395 LIB_OPTS_G := $(LLVM_LIBS_OPTIONS_G) $(PROJ_LIBS_OPTIONS_G)
396 LIB_OPTS_O := $(LLVM_LIBS_OPTIONS_O) $(PROJ_LIBS_OPTIONS_P)
397 LIB_OPTS_P := $(LLVM_LIBS_OPTIONS_P) $(PROJ_LIBS_OPTIONS_P)
401 LLVM_LIBS_OPTIONS := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS)))
402 LLVM_LIBS_OPTIONS_G := $(patsubst %.o, $(LLVMLIBDEBUGSOURCE)/%.o, $(LLVM_LIBS_OPTIONS))
403 LLVM_LIBS_OPTIONS_O := $(patsubst %.o, $(LLVMLIBRELEASESOURCE)/%.o,$(LLVM_LIBS_OPTIONS))
404 LLVM_LIBS_OPTIONS_P := $(patsubst %.o, $(LLVMLIBPROFILESOURCE)/%.o,$(LLVM_LIBS_OPTIONS))
406 LIB_OPTS_G := $(LLVM_LIBS_OPTIONS_G)
407 LIB_OPTS_O := $(LLVM_LIBS_OPTIONS_O)
408 LIB_OPTS_P := $(LLVM_LIBS_OPTIONS_P)
416 # USED_LIB_PATHS - Compute the path of the libraries used so that tools are
417 # rebuilt if libraries change. This has to make sure to handle .a/.so and .o
420 STATICUSEDLIBS := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(USEDLIBS)))
421 USED_LIB_PATHS_G := $(addprefix $(DESTLIBDEBUG)/, $(STATICUSEDLIBS))
422 USED_LIB_PATHS_O := $(addprefix $(DESTLIBRELEASE)/, $(STATICUSEDLIBS))
423 USED_LIB_PATHS_P := $(addprefix $(DESTLIBPROFILE)/, $(STATICUSEDLIBS))
424 LINK_OPTS := $(TOOLLINKOPTS) $(PLATFORMLINKOPTS)
431 # Tell make that we need to rebuild subdirectories before we can link the tool.
432 # This affects things like LLI which has library subdirectories.
433 $(USED_LIB_PATHS_G) $(USED_LIB_PATHS_O) $(USED_LIB_PATHS_P): \
434 $(addsuffix /.makeall, $(PARALLEL_DIRS))
436 all:: $(TOOLEXENAMES)
438 $(VERB) rm -f $(TOOLEXENAMES)
440 $(TOOLEXENAME_G): $(ObjectsG) $(USED_LIB_PATHS_G) $(TOOLDEBUG)/.dir
441 @echo ======= Linking $(TOOLNAME) debug executable $(STRIP_WARN_MSG)=======
442 $(VERB) $(LinkG) -o $@ $(ObjectsG) $(LIB_OPTS_G) $(LINK_OPTS)
444 $(TOOLEXENAME_O): $(ObjectsO) $(USED_LIB_PATHS_O) $(TOOLRELEASE)/.dir
445 @echo ======= Linking $(TOOLNAME) release executable =======
446 $(VERB) $(LinkO) -o $@ $(ObjectsO) $(LIB_OPTS_O) $(LINK_OPTS)
448 $(TOOLEXENAME_P): $(ObjectsP) $(USED_LIB_PATHS_P) $(TOOLPROFILE)/.dir
449 @echo ======= Linking $(TOOLNAME) profile executable =======
450 $(VERB) $(LinkP) -o $@ $(ObjectsP) $(LIB_OPTS_P) $(LINK_OPTS)
456 #---------------------------------------------------------
457 .PRECIOUS: $(BUILD_ROOT)/Depend/.dir
458 .PRECIOUS: $(BUILD_ROOT)/Debug/.dir $(BUILD_ROOT)/Release/.dir
460 # Create .o files in the ObjectFiles directory from the .cpp and .c files...
461 $(BUILD_ROOT)/Release/%.o: $(SourceDir)%.cpp $(BUILD_ROOT)/Release/.dir
463 $(VERB) $(CompileO) $< -o $@
465 $(BUILD_ROOT)/Release/%.o: $(SourceDir)%.c $(BUILD_ROOT)/Release/.dir
466 $(VERB) $(CompileCO) $< -o $@
468 $(BUILD_ROOT)/Profile/%.o: $(SourceDir)%.cpp $(BUILD_ROOT)/Profile/.dir
470 $(VERB) $(CompileP) $< -o $@
472 $(BUILD_ROOT)/Profile/%.o: $(SourceDir)%.c $(BUILD_ROOT)/Profile/.dir
474 $(VERB) $(CompileCP) $< -o $@
476 $(BUILD_ROOT)/Debug/%.o: $(SourceDir)%.cpp $(BUILD_ROOT)/Debug/.dir
478 $(VERB) $(CompileG) $< -o $@
480 $(BUILD_ROOT)/Debug/%.o: $(SourceDir)%.c $(BUILD_ROOT)/Debug/.dir
481 $(VERB) $(CompileCG) $< -o $@
484 # Rules for building lex/yacc files
486 LEX_FILES = $(filter %.l, $(Source))
487 LEX_OUTPUT = $(LEX_FILES:%.l=%.cpp)
488 YACC_FILES = $(filter %.y, $(Source))
489 YACC_OUTPUT = $(addprefix $(YACC_FILES:%.y=%), .h .cpp .output)
490 .PRECIOUS: $(LEX_OUTPUT) $(YACC_OUTPUT)
492 # Create a .cpp source file from a flex input file... this uses sed to cut down
493 # on the warnings emited by GCC...
495 # The last line is a gross hack to work around flex aparently not being able to
496 # resize the buffer on a large token input. Currently, for uninitialized string
497 # buffers in LLVM we can generate very long tokens, so this is a hack around it.
498 # FIXME. (f.e. char Buffer[10000]; )
501 $(FLEX) -t $< | sed '/^find_rule/d' | \
502 sed 's/void yyunput/inline void yyunput/' | \
503 sed 's/void \*yy_flex_realloc/inline void *yy_flex_realloc/' | \
504 sed 's/#define YY_BUF_SIZE 16384/#define YY_BUF_SIZE (16384*64)/' > $@
506 # Rule for building the bison parsers...
507 %.c: %.y # Cancel built-in rules for yacc
508 %.h: %.y # Cancel built-in rules for yacc
510 @echo Bison\'ing $<...
511 $(VERB) $(BISON) -v -d -p $(<:%Parser.y=%) $*.y
512 $(VERB) mv -f $*.tab.c $*.cpp
513 $(VERB) mv -f $*.tab.h $*.h
515 # To create the directories...
520 # To create postscript files from dot files...
524 # 'make clean' nukes the tree
526 $(VERB) rm -rf $(BUILD_ROOT)/Debug $(BUILD_ROOT)/Release $(BUILD_ROOT)/Profile $(BUILD_ROOT)/Depend
527 $(VERB) rm -f core core.[0-9][0-9]* *.o *.d *.so *~ *.flc
528 $(VERB) rm -f $(LEX_OUTPUT) $(YACC_OUTPUT)
530 # If dependencies were generated for the file that included this file,
531 # include the dependancies now...
533 SourceBaseNames := $(basename $(notdir $(filter-out Debug/%, $(Source))))
534 SourceDepend := $(SourceBaseNames:%=$(BUILD_ROOT)/Depend/%.d)
536 # Create dependencies for the *.cpp files...
538 $(BUILD_ROOT)/Depend/%.d: $(SourceDir)%.cpp $(BUILD_ROOT)/Depend/.dir
539 $(VERB) $(Depend) $< | sed 's|$*\.o *|$(BUILD_ROOT)/Release/& $(BUILD_ROOT)/Profile/& $(BUILD_ROOT)/Debug/& $(BUILD_ROOT)/Depend/$(@F)|g' > $@
541 # Create dependencies for the *.c files...
543 $(BUILD_ROOT)/Depend/%.d: $(SourceDir)%.c $(BUILD_ROOT)/Depend/.dir
544 $(VERB) $(DependC) $< | sed 's|$*\.o *|Release/& Profile/& Debug/& Depend/$(@F)|g' > $@
546 ifneq ($(SourceDepend),)
547 -include $(SourceDepend)