summaryrefslogtreecommitdiffstatshomepage
path: root/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'makefile')
-rw-r--r--makefile17
1 files changed, 16 insertions, 1 deletions
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)