From 717a11337e363de3fa75af8f7a4daee1d438fb65 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Thu, 8 Apr 2010 06:10:18 +0000 Subject: Added gprof support to the makefile. [Bryan Ischo] Added a check for the OPTION_READCONFIG option before executing the code which would attempt to incorporate configuration file settings into the current configuration, because if OPTION_READCONFIG is set to false, then there is no reason to even try to do this as every single configuration file will be ignored (because config files have been turned off by OPTION_READCONFIG). [Bryan Ischo] Fixed small memory leak in mame.c. [Bryan Ischo] Fixed double-free error in render.c. [Bryan Ischo] Made core_strdup use osd_malloc instead of malloc. [Bryan Ischo] --- makefile | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'makefile') diff --git a/makefile b/makefile index 4af5a4c03e0..15367e3cd6b 100644 --- a/makefile +++ b/makefile @@ -177,6 +177,9 @@ endif # uncomment next line to include the internal profiler # PROFILER = 1 +# uncomment next line to include gprof profiler support +# GPROF = 1 + # uncomment the force the universal DRC to always use the C backend # you may need to do this if your target architecture does not have # a native backend @@ -247,6 +250,12 @@ PROFILER = 1 endif endif +# allow gprof profiling as well, which overrides the internal PROFILER +ifdef GPROF +CCOMFLAGS += -pg +PROFILER = +# LIBS += -lc_p +endif #------------------------------------------------- @@ -284,6 +293,7 @@ RM = @rm -f PREFIXSDL = SUFFIX64 = SUFFIXDEBUG = +SUFFIXGPROF = # Windows SDL builds get an SDL prefix ifeq ($(OSD),sdl) @@ -302,6 +312,11 @@ ifdef DEBUG SUFFIXDEBUG = d endif +# gprof builds get an addition 'p' suffix +ifdef GPROF +SUFFIXGPROF = p +endif + # the name is just 'target' if no subtarget; otherwise it is # the concatenation of the two (e.g., mametiny) ifeq ($(TARGET),$(SUBTARGET)) @@ -311,7 +326,7 @@ NAME = $(TARGET)$(SUBTARGET) endif # fullname is prefix+name+suffix+suffix64+suffixdebug -FULLNAME = $(PREFIX)$(PREFIXSDL)$(NAME)$(SUFFIX)$(SUFFIX64)$(SUFFIXDEBUG) +FULLNAME = $(PREFIX)$(PREFIXSDL)$(NAME)$(SUFFIX)$(SUFFIX64)$(SUFFIXDEBUG)$(SUFFIXGPROF) # add an EXE suffix to get the final emulator name EMULATOR = $(FULLNAME)$(EXE) -- cgit v1.2.3