Added profile support to configure/Makefile (--enable-profile). If you

know what this is, you'll know how to use it :)


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@996 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2006-02-01 13:53:25 +00:00
parent d91443ed89
commit a30149355a
2 changed files with 29 additions and 3 deletions

View File

@ -13,7 +13,7 @@
## See the file "license" for information on usage and redistribution of
## this file, and for a DISCLAIMER OF ALL WARRANTIES.
##
## $Id: Makefile,v 1.17 2006-01-15 21:02:22 stephena Exp $
## $Id: Makefile,v 1.18 2006-02-01 13:53:25 stephena Exp $
##
## Based on code from ScummVM - Scumm Interpreter
## Copyright (C) 2002-2004 The ScummVM project
@ -30,6 +30,7 @@ LDFLAGS :=
INCLUDES :=
LIBS :=
OBJS :=
PROF :=
MODULES :=
MODULE_DIRS :=
@ -47,7 +48,15 @@ ifdef CXXFLAGS
else
CXXFLAGS:= -O2
endif
CXXFLAGS+= -Wall -Wno-multichar -Wunused -fomit-frame-pointer -fno-rtti
CXXFLAGS+= -Wall -Wno-multichar -Wunused -fno-rtti
ifdef PROFILE
PROF:= -g -pg -fprofile-arcs -ftest-coverage
CXXFLAGS+= $(PROF)
else
CXXFLAGS+= -fomit-frame-pointer
endif
# Even more warnings...
#CXXFLAGS+= -pedantic -Wpointer-arith -Wcast-qual -Wconversion
#CXXFLAGS+= -Wshadow -Wimplicit -Wundef -Wnon-virtual-dtor
@ -100,7 +109,7 @@ DEPFILES =
# The build rule for the Stella executable
$(EXECUTABLE): $(OBJS)
$(LD) $(LDFLAGS) $(PRE_OBJS_FLAGS) $+ $(POST_OBJS_FLAGS) $(LIBS) -o $@
$(LD) $(LDFLAGS) $(PRE_OBJS_FLAGS) $+ $(POST_OBJS_FLAGS) $(LIBS) $(PROF) -o $@
distclean: clean
$(RM_REC) $(DEPDIRS)

17
stella/configure vendored
View File

@ -26,6 +26,7 @@ _build_snapshot=yes
_build_joystick=yes
_build_cheats=yes
_build_static=no
_build_profile=no
# more defaults
_ranlib=ranlib
@ -267,6 +268,8 @@ Optional Features:
--enable-shared build shared binary [enabled]
--enable-static build static binary (if possible) [disabled]
--disable-static
--enable-profile build binary with profiling info [disabled]
--disable-profile
Optional Libraries:
--with-zlib-prefix=DIR Prefix where zlib is installed (optional)
@ -318,6 +321,8 @@ for ac_option in $@; do
--enable-shared) _build_static=no ;;
--enable-static) _build_static=yes ;;
--disable-static) _build_static=no ;;
--enable-profile) _build_profile=yes ;;
--disable-profile) _build_profile=no ;;
--with-zlib-prefix=*)
_prefix=`echo $ac_option | cut -d '=' -f 2`
ZLIB_CFLAGS="-I$_prefix/include"
@ -742,6 +747,14 @@ else
echo
fi
if test "$_build_profile" = yes ; then
echo_n " Profiling enabled"
echo
else
echo_n " Profiling disabled"
echo
fi
#
# Now, add the appropriate defines/libraries/headers
@ -862,6 +875,9 @@ if test "$_build_cheats" = yes ; then
INCLUDES="$INCLUDES -I$CHEAT"
fi
if test "$_build_profile" = no ; then
_build_profile=
fi
# 20051003 bkw: fix static Linux build.
# No guarantee this will work for anyone other than me, and no
@ -909,6 +925,7 @@ PREFIX := $_prefix
BINDIR := $_bindir
DOCDIR := $_docdir
DATADIR := $_datadir
PROFILE := $_build_profile
$_make_def_HAVE_GCC3
#$_make_def_HAVE_NASM