-# TOOLEXENAME* - These compute the output filenames to generate...
-TOOLEXENAME_G := $(BUILD_ROOT_TOP)/tools/Debug/$(TOOLNAME)
-TOOLEXENAME_O := $(BUILD_ROOT_TOP)/tools/Release/$(TOOLNAME)
-TOOLEXENAMES := $(TOOLEXENAME_G)
-ifdef ENABLE_OPTIMIZED
-TOOLEXENAMES += $(TOOLEXENAME_O)
-endif
-
-# USED_LIBS_OPTIONS - Compute the options line that add -llib1 -llib2, etc.
-USED_LIBS_OPTIONS := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS)))
-USED_LIBS_OPTIONS_G := $(patsubst %.o, $(LIBDEBUG)/%.o, $(USED_LIBS_OPTIONS))
-USED_LIBS_OPTIONS_O := $(patsubst %.o, $(LIBRELEASE)/%.o,$(USED_LIBS_OPTIONS))
-
-
-# USED_LIB_PATHS - Compute the path of the libraries used so that tools are
-# rebuilt if libraries change. This has to make sure to handle .a/.so and .o
-# files seperately.
-#
-STATICUSEDLIBS := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(USEDLIBS)))
-USED_LIB_PATHS_G := $(addprefix $(LIBDEBUG)/, $(STATICUSEDLIBS))
-USED_LIB_PATHS_O := $(addprefix $(LIBRELEASE)/, $(STATICUSEDLIBS))
-
-all:: $(TOOLEXENAMES)
-clean::
- $(VERB) rm -f $(TOOLEXENAMES)
-
-$(TOOLEXENAME_G): $(ObjectsG) $(USED_LIB_PATHS_G) $(BUILD_ROOT_TOP)/tools/Debug/.dir
- @echo ======= Linking $(TOOLNAME) debug executable =======
- $(VERB) $(LinkG) -o $@ $(ObjectsG) $(USED_LIBS_OPTIONS_G) $(TOOLLINKOPTS)
-
-$(TOOLEXENAME_O): $(ObjectsO) $(USED_LIB_PATHS_O) $(BUILD_ROOT_TOP)/tools/Release/.dir
- @echo ======= Linking $(TOOLNAME) release executable =======
- $(VERB) $(LinkO) -o $@ $(ObjectsG) $(USED_LIBS_OPTIONS_O) $(TOOLLINKOPTS)
-
-endif
-
-
-
-#---------------------------------------------------------
-.PRECIOUS: $(BUILD_ROOT)/Depend/.dir
-.PRECIOUS: $(BUILD_ROOT)/Debug/.dir $(BUILD_ROOT)/Release/.dir
-
-# Create dependencies for the *.cpp files...
-$(BUILD_ROOT)/Depend/%.d: %.cpp $(BUILD_ROOT)/Depend/.dir
- $(VERB) $(Depend) $< | sed 's|$*\.o *|$(BUILD_ROOT)/Release/& $(BUILD_ROOT)/Debug/& $(BUILD_ROOT)/Depend/$(@F)|g' > $@
-
-# Create dependencies for the *.c files...
-$(BUILD_ROOT)/Depend/%.d: %.c $(BUILD_ROOT)/Depend/.dir
- $(VERB) $(Depend) $< | sed 's|$*\.o *|Release/& Debug/& Depend/$(@F)|g' > $@
-
-# Create .o files in the ObjectFiles directory from the .cpp and .c files...
-$(BUILD_ROOT)/Release/%.o: %.cpp $(BUILD_ROOT)/Release/.dir
- @echo "Compiling $<"
- $(VERB) $(CompileO) $< -o $@
-
-#Release/%.o: %.c Release/.dir Depend/.dir
-# $(CompileOC) $< -o $@
-
-$(BUILD_ROOT)/Debug/%.o: %.cpp $(BUILD_ROOT)/Debug/.dir
- @echo "Compiling $<"
- $(VERB) $(CompileG) $< -o $@
-
-#Debug/%.o: %.c Debug/.dir
-# $(CompileGC) $< -o $@
-
-# Create a .cpp source file from a flex input file... this uses sed to cut down
-# on the warnings emited by GCC...
-%.cpp: %.l
- flex -t $< | sed '/^find_rule/d' | sed 's/void yyunput/inline void yyunput/' | sed 's/void \*yy_flex_realloc/inline void *yy_flex_realloc/' > $@
-
-# Rule for building the bison parsers...
-
-%.cpp %.h : %.y
- $(VERB) bison -v -d -p $(<:%Parser.y=%) $(basename $@).y
- $(VERB) mv -f $(basename $@).tab.c $(basename $@).cpp
- $(VERB) mv -f $(basename $@).tab.h $(basename $@).h
-
-# To create the directories...
-%/.dir:
- $(VERB) mkdir -p $(@D)
- @date > $@
-
-# Clean nukes the tree
-clean::
- $(VERB) rm -rf $(BUILD_ROOT)/Debug $(BUILD_ROOT)/Release $(BUILD_ROOT)/Depend
- $(VERB) rm -f core *.o *.d *.so *~ *.flc
-
-# If dependancies were generated for the file that included this file,
-# include the dependancies now...
-#
-SourceDepend := $(addsuffix .d,$(addprefix $(BUILD_ROOT)/Depend/,$(basename $(filter-out Debug/%, $(Source)))))
-ifneq ($(SourceDepend),)
-include $(SourceDepend)
-endif