# By default, strip symbol information from executable
ifdef KEEP_SYMBOLS
STRIP =
+WARN_MSG =
else
STRIP = -s
+WARN_MSG = "(without symbols) "
endif
# Allow gnu extensions...
# Compile a c file, don't link...
CompileC := $(CC) -c $(CPPFLAGS) $(CCFLAGS) $(CompileCommonOpts)
CompileCG := $(CompileC) -g -D_DEBUG
-CompileCO := $(CompileC) -O3 -DNDEBUG -finline-functions -felide-constructors -fshort-enums ## DISABLE -freg-struct-return because of gcc3.2 bug
+CompileCO := $(CompileC) -O3 -DNDEBUG -finline-functions -fshort-enums ## DISABLE -freg-struct-return because of gcc3.2 bug
CompileCP := $(CompileCO) $(PROFILE)
# source files...
# The local Makefile can list other Source files via ExtraSource = ...
#
+ifndef Source
Source := $(ExtraSource) $(wildcard *.cpp *.c *.y *.l)
+endif
Objs := $(sort $(patsubst Debug/%.o, %.o, $(addsuffix .o,$(basename $(Source)))))
ObjectsO := $(addprefix $(BUILD_ROOT)/Release/,$(Objs))
$(VERB) $(Relink) -o $@ $(ObjectsP) $(LibSubDirs)
$(LIBNAME_OBJG): $(ObjectsG) $(LibSubDirs) $(LIBDEBUG)/.dir
+ @echo "Linking $@"
$(VERB) $(Relink) -o $@ $(ObjectsG) $(LibSubDirs)
endif
$(VERB) rm -f $(TOOLEXENAMES)
$(TOOLEXENAME_G): $(ObjectsG) $(USED_LIB_PATHS_G) $(BUILD_ROOT_TOP)/tools/Debug/.dir
- @echo ======= Linking $(TOOLNAME) debug executable =======
+ @echo ======= Linking $(TOOLNAME) debug executable $(WARN_MSG) =======
$(VERB) $(LinkG) -o $@ $(ObjectsG) $(USED_LIBS_OPTIONS_G) $(TOOLLINKOPTS)
$(TOOLEXENAME_O): $(ObjectsO) $(USED_LIB_PATHS_O) $(BUILD_ROOT_TOP)/tools/Release/.dir
$(VERB) $(CompileO) $< -o $@
$(BUILD_ROOT)/Release/%.o: %.c $(BUILD_ROOT)/Release/.dir
- $(VERB) $(CompileOC) $< -o $@
+ $(VERB) $(CompileCO) $< -o $@
$(BUILD_ROOT)/Profile/%.o: %.cpp $(BUILD_ROOT)/Profile/.dir
@echo "Compiling $<"
#
SourceDepend := $(addsuffix .d,$(addprefix $(BUILD_ROOT)/Depend/,$(basename $(filter-out Debug/%, $(Source)))))
ifneq ($(SourceDepend),)
-include $(SourceDepend)
+-include $(SourceDepend)
endif