2005-06-29 13:11:03 +00:00
|
|
|
##============================================================================
|
|
|
|
##
|
|
|
|
## SSSS tt lll lll
|
|
|
|
## SS SS tt ll ll
|
|
|
|
## SS tttttt eeee ll ll aaaa
|
|
|
|
## SSSS tt ee ee ll ll aa
|
|
|
|
## SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
|
|
|
## SS SS tt ee ll ll aa aa
|
|
|
|
## SSSS ttt eeeee llll llll aaaaa
|
|
|
|
##
|
2011-01-01 16:04:32 +00:00
|
|
|
## Copyright (c) 1995-2011 by Bradford W. Mott, Stephen Anthony
|
2010-04-10 21:37:23 +00:00
|
|
|
## and the Stella Team
|
2005-06-29 13:11:03 +00:00
|
|
|
##
|
2010-01-10 03:23:32 +00:00
|
|
|
## See the file "License.txt" for information on usage and redistribution of
|
2005-06-29 13:11:03 +00:00
|
|
|
## this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
|
|
|
##
|
2009-01-11 21:31:21 +00:00
|
|
|
## $Id: Makefile,v 1.37 2009-01-11 21:31:21 stephena Exp $
|
2005-06-29 13:11:03 +00:00
|
|
|
##
|
|
|
|
## Based on code from ScummVM - Scumm Interpreter
|
|
|
|
## Copyright (C) 2002-2004 The ScummVM project
|
|
|
|
##============================================================================
|
2005-06-28 18:56:49 +00:00
|
|
|
|
|
|
|
#######################################################################
|
|
|
|
# Default compilation parameters. Normally don't edit these #
|
|
|
|
#######################################################################
|
|
|
|
|
|
|
|
srcdir ?= .
|
|
|
|
|
|
|
|
DEFINES :=
|
|
|
|
LDFLAGS :=
|
|
|
|
INCLUDES :=
|
2006-06-11 21:49:10 +00:00
|
|
|
LIBS :=
|
2005-06-28 18:56:49 +00:00
|
|
|
OBJS :=
|
2006-02-01 13:53:25 +00:00
|
|
|
PROF :=
|
2005-06-28 18:56:49 +00:00
|
|
|
|
|
|
|
MODULES :=
|
|
|
|
MODULE_DIRS :=
|
|
|
|
|
2005-10-22 20:33:57 +00:00
|
|
|
DISTNAME := stella-snapshot
|
|
|
|
|
2005-06-28 18:56:49 +00:00
|
|
|
# Load the make rules generated by configure
|
|
|
|
include config.mak
|
|
|
|
|
|
|
|
# Uncomment this for stricter compile time code verification
|
|
|
|
# CXXFLAGS+= -Werror
|
|
|
|
|
2005-06-29 13:11:03 +00:00
|
|
|
ifdef CXXFLAGS
|
|
|
|
CXXFLAGS:= $(CXXFLAGS)
|
|
|
|
else
|
2005-10-25 21:21:15 +00:00
|
|
|
CXXFLAGS:= -O2
|
2005-06-29 13:11:03 +00:00
|
|
|
endif
|
2006-02-01 13:53:25 +00:00
|
|
|
CXXFLAGS+= -Wall -Wno-multichar -Wunused -fno-rtti
|
|
|
|
|
|
|
|
ifdef PROFILE
|
|
|
|
PROF:= -g -pg -fprofile-arcs -ftest-coverage
|
|
|
|
CXXFLAGS+= $(PROF)
|
|
|
|
else
|
|
|
|
CXXFLAGS+= -fomit-frame-pointer
|
|
|
|
endif
|
|
|
|
|
2005-06-28 18:56:49 +00:00
|
|
|
# Even more warnings...
|
|
|
|
#CXXFLAGS+= -pedantic -Wpointer-arith -Wcast-qual -Wconversion
|
|
|
|
#CXXFLAGS+= -Wshadow -Wimplicit -Wundef -Wnon-virtual-dtor
|
|
|
|
#CXXFLAGS+= -Wno-reorder -Wwrite-strings -fcheck-new -Wctor-dtor-privacy
|
|
|
|
|
|
|
|
#######################################################################
|
|
|
|
# Misc stuff - you should never have to edit this #
|
|
|
|
#######################################################################
|
|
|
|
|
|
|
|
EXECUTABLE := stella$(EXEEXT)
|
|
|
|
|
2006-06-09 02:45:11 +00:00
|
|
|
all: tags $(EXECUTABLE)
|
2005-06-28 23:18:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# Various minor settings
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
# The name for the directory used for dependency tracking
|
|
|
|
DEPDIR := .deps
|
|
|
|
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# Module settings
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
MODULES := $(MODULES)
|
|
|
|
|
|
|
|
# After the game specific modules follow the shared modules
|
|
|
|
MODULES += \
|
|
|
|
src/emucore \
|
|
|
|
src/gui \
|
2005-07-01 13:59:40 +00:00
|
|
|
src/common
|
2005-06-28 23:18:16 +00:00
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# The build rules follow - normally you should have no need to
|
|
|
|
# touch whatever comes after here.
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
# Concat DEFINES and INCLUDES to form the CPPFLAGS
|
|
|
|
CPPFLAGS:= $(DEFINES) $(INCLUDES)
|
|
|
|
|
|
|
|
# Include the build instructions for all modules
|
|
|
|
-include $(addprefix $(srcdir)/, $(addsuffix /module.mk,$(MODULES)))
|
|
|
|
|
|
|
|
# Depdir information
|
|
|
|
DEPDIRS = $(addsuffix /$(DEPDIR),$(MODULE_DIRS))
|
|
|
|
DEPFILES =
|
|
|
|
|
|
|
|
# The build rule for the Stella executable
|
2006-06-11 21:49:10 +00:00
|
|
|
$(EXECUTABLE): $(OBJS)
|
2006-02-01 13:53:25 +00:00
|
|
|
$(LD) $(LDFLAGS) $(PRE_OBJS_FLAGS) $+ $(POST_OBJS_FLAGS) $(LIBS) $(PROF) -o $@
|
2005-06-28 23:18:16 +00:00
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
$(RM_REC) $(DEPDIRS)
|
|
|
|
$(RM) build.rules config.h config.mak config.log
|
|
|
|
|
|
|
|
clean:
|
|
|
|
$(RM) $(OBJS) $(EXECUTABLE)
|
|
|
|
|
2005-09-30 22:12:18 +00:00
|
|
|
.PHONY: all clean dist distclean
|
2005-06-28 23:18:16 +00:00
|
|
|
|
|
|
|
.SUFFIXES: .cxx
|
|
|
|
ifndef HAVE_GCC3
|
|
|
|
# If you use GCC, disable the above and enable this for intelligent
|
|
|
|
# dependency tracking.
|
|
|
|
.cxx.o:
|
|
|
|
$(MKDIR) $(*D)/$(DEPDIR)
|
|
|
|
$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d2" $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
|
|
|
|
$(ECHO) "$(*D)/" > $(*D)/$(DEPDIR)/$(*F).d
|
|
|
|
$(CAT) "$(*D)/$(DEPDIR)/$(*F).d2" >> "$(*D)/$(DEPDIR)/$(*F).d"
|
|
|
|
$(RM) "$(*D)/$(DEPDIR)/$(*F).d2"
|
2005-06-29 13:11:03 +00:00
|
|
|
|
|
|
|
.c.o:
|
|
|
|
$(MKDIR) $(*D)/$(DEPDIR)
|
|
|
|
$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d2" $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
|
|
|
|
$(ECHO) "$(*D)/" > $(*D)/$(DEPDIR)/$(*F).d
|
|
|
|
$(CAT) "$(*D)/$(DEPDIR)/$(*F).d2" >> "$(*D)/$(DEPDIR)/$(*F).d"
|
|
|
|
$(RM) "$(*D)/$(DEPDIR)/$(*F).d2"
|
2005-06-28 23:18:16 +00:00
|
|
|
else
|
|
|
|
# If you even have GCC 3.x, you can use this build rule, which is safer; the above
|
|
|
|
# rule can get you into a bad state if you Ctrl-C at the wrong moment.
|
|
|
|
# Also, with this GCC inserts additional dummy rules for the involved headers,
|
|
|
|
# which ensures a smooth compilation even if said headers become obsolete.
|
|
|
|
.cxx.o:
|
|
|
|
$(MKDIR) $(*D)/$(DEPDIR)
|
|
|
|
$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
|
2005-06-29 13:11:03 +00:00
|
|
|
|
|
|
|
.c.o:
|
|
|
|
$(MKDIR) $(*D)/$(DEPDIR)
|
|
|
|
$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
|
2005-06-28 23:18:16 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
# Include the dependency tracking files. We add /dev/null at the end
|
|
|
|
# of the list to avoid a warning/error if no .d file exist
|
|
|
|
-include $(wildcard $(addsuffix /*.d,$(DEPDIRS))) /dev/null
|
2005-06-28 18:56:49 +00:00
|
|
|
|
|
|
|
# check if configure has been run or has been changed since last run
|
|
|
|
config.mak: $(srcdir)/configure
|
|
|
|
@echo "You need to run ./configure before you can run make"
|
|
|
|
@echo "Either you haven't run it before or it has changed."
|
|
|
|
@exit 1
|
|
|
|
|
|
|
|
install: all
|
|
|
|
$(INSTALL) -d "$(DESTDIR)$(BINDIR)"
|
2005-09-30 22:12:18 +00:00
|
|
|
$(INSTALL) -c -s -m 755 "$(srcdir)/stella$(EXEEXT)" "$(DESTDIR)$(BINDIR)/stella$(EXEEXT)"
|
|
|
|
$(INSTALL) -d "$(DESTDIR)$(DOCDIR)"
|
2006-03-19 20:57:55 +00:00
|
|
|
$(INSTALL) -c -m 644 "$(srcdir)/Announce.txt" "$(srcdir)/Changes.txt" "$(srcdir)/Copyright.txt" "$(srcdir)/License.txt" "$(srcdir)/README-SDL.txt" "$(srcdir)/Readme.txt" "$(srcdir)/Todo.txt" "$(srcdir)/docs/index.html" "$(srcdir)/docs/debugger.html" "$(DESTDIR)$(DOCDIR)/"
|
2005-09-30 22:12:18 +00:00
|
|
|
$(INSTALL) -d "$(DESTDIR)$(DOCDIR)/graphics"
|
2007-08-16 16:42:46 +00:00
|
|
|
$(INSTALL) -c -m 644 $(wildcard $(srcdir)/docs/graphics/*.png) "$(DESTDIR)$(DOCDIR)/graphics"
|
2006-11-09 03:06:42 +00:00
|
|
|
$(INSTALL) -d "$(DESTDIR)$(DATADIR)/applications"
|
|
|
|
$(INSTALL) -c -m 644 "$(srcdir)/src/unix/stella.desktop" "$(DESTDIR)$(DATADIR)/applications"
|
2005-10-03 00:53:20 +00:00
|
|
|
$(INSTALL) -d "$(DESTDIR)$(DATADIR)/icons"
|
2006-09-08 14:35:21 +00:00
|
|
|
$(INSTALL) -d "$(DESTDIR)$(DATADIR)/icons/mini"
|
|
|
|
$(INSTALL) -d "$(DESTDIR)$(DATADIR)/icons/large"
|
2007-07-25 13:07:15 +00:00
|
|
|
$(INSTALL) -c -m 644 "$(srcdir)/src/common/stella.png" "$(DESTDIR)$(DATADIR)/icons"
|
|
|
|
$(INSTALL) -c -m 644 "$(srcdir)/src/common/stella.png" "$(DESTDIR)$(DATADIR)/icons/mini"
|
|
|
|
$(INSTALL) -c -m 644 "$(srcdir)/src/common/stella.png" "$(DESTDIR)$(DATADIR)/icons/large"
|
2006-03-19 20:57:55 +00:00
|
|
|
|
2005-09-30 22:12:18 +00:00
|
|
|
install-strip: install
|
2008-03-09 15:30:27 +00:00
|
|
|
$(STRIP) stella$(EXEEXT)
|
2005-06-28 18:56:49 +00:00
|
|
|
|
|
|
|
uninstall:
|
2005-10-03 00:53:20 +00:00
|
|
|
rm -f "$(DESTDIR)$(BINDIR)/stella$(EXEEXT)"
|
2005-09-30 22:12:18 +00:00
|
|
|
rm -rf "$(DESTDIR)$(DOCDIR)/"
|
2006-11-09 03:06:42 +00:00
|
|
|
rm -f "$(DESTDIR)$(DATADIR)/applications/stella.desktop"
|
2007-07-25 13:07:15 +00:00
|
|
|
rm -f "$(DESTDIR)$(DATADIR)/icons/stella.png"
|
|
|
|
rm -f "$(DESTDIR)$(DATADIR)/icons/mini/stella.png"
|
|
|
|
rm -f "$(DESTDIR)$(DATADIR)/icons/large/stella.png"
|
2005-09-30 22:12:18 +00:00
|
|
|
|
Added rule for recompiling the M6502.m4 script to the Makefile, because I'm
tired of doing it manually every time it changes.
Tweaked the handling of JSR, RTI and RTS commands, so they don't erroneously
mark associated addresses as CODE when in fact they're never actually
executed.
Several parts of the Distella code were marking areas as DATA, even though
it depending on knowing the values for the X and Y registers (which it
doesn't, as it's a static analysis). As such, these areas are now marked
as ROW instead, since that's as precise as a static analysis can do. The
processing blocks are left there, though, in case Distella is improved in
a future release.
All the above changes allow for better disassembly with less
'false positives' (ie, areas marked as CODE or DATA when they really aren't).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2172 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-11-07 22:52:42 +00:00
|
|
|
# Special rule for M6502.ins, generated from m4 (there's probably a better way to do this ...)
|
|
|
|
src/emucore/M6502.ins: src/emucore/M6502.m4
|
|
|
|
m4 src/emucore/M6502.m4 > src/emucore/M6502.ins
|
|
|
|
|
2005-10-22 20:33:57 +00:00
|
|
|
# Special rule for Win32 icon stuff (there's probably a better way to do this ...)
|
|
|
|
src/win32/stella_icon.o: src/win32/stella.ico src/win32/stella.rc
|
2008-03-09 14:17:03 +00:00
|
|
|
$(WINDRES) --include-dir src/win32 src/win32/stella.rc src/win32/stella_icon.o
|
2005-10-22 20:33:57 +00:00
|
|
|
|
|
|
|
# Special target to create a Win32 snapshot package
|
|
|
|
win32dist: stella$(EXEEXT)
|
|
|
|
rm -rf $(DISTNAME)
|
|
|
|
mkdir -p $(DISTNAME)/docs/graphics
|
2008-03-09 17:52:40 +00:00
|
|
|
$(STRIP) stella$(EXEEXT) -o $(DISTNAME)/Stella$(EXEEXT)
|
2009-01-11 21:31:21 +00:00
|
|
|
cp /bin/SDL.dll $(DISTNAME)
|
2006-03-19 20:57:55 +00:00
|
|
|
cp Announce.txt Changes.txt Copyright.txt License.txt README-SDL.txt Readme.txt Todo.txt $(DISTNAME)/docs
|
2005-10-22 20:33:57 +00:00
|
|
|
cp -r docs/*.html $(DISTNAME)/docs
|
|
|
|
cp -r docs/graphics/*.png $(DISTNAME)/docs/graphics
|
2008-04-02 23:24:21 +00:00
|
|
|
# flip -m $(DISTNAME)/docs/*.txt
|
|
|
|
# zip -r $(DISTNAME)-win32.zip $(DISTNAME)
|
2006-02-15 03:12:12 +00:00
|
|
|
|
|
|
|
# GP2X organize: groups necessary files into a gp2x folder for easy access.
|
|
|
|
gp2x-organize:
|
|
|
|
mkdir -p "$(srcdir)/gp2x"
|
2006-03-02 13:10:53 +00:00
|
|
|
mkdir -p "$(srcdir)/gp2x/docs"
|
2006-02-15 03:12:12 +00:00
|
|
|
cp -v $(srcdir)/stella $(srcdir)/gp2x
|
|
|
|
cp -v $(srcdir)/src/gp2x/stella.gpe $(srcdir)/gp2x
|
2006-03-02 13:10:53 +00:00
|
|
|
cp -v $(srcdir)/README-GP2X.txt $(srcdir)/gp2x
|
|
|
|
cp -v -r $(srcdir)/docs/* $(srcdir)/gp2x/docs
|
2008-03-09 15:30:27 +00:00
|
|
|
$(STRIP) $(srcdir)/gp2x/stella
|
|
|
|
|
2005-10-22 20:33:57 +00:00
|
|
|
.PHONY: deb bundle test win32dist install uninstall
|
2006-06-09 02:45:11 +00:00
|
|
|
|
|
|
|
# Use Exuberant ctags (the one from Slackware's vim package, for instance),
|
|
|
|
# not the one from emacs!
|
|
|
|
tags:
|
|
|
|
ctags `find . -name '*.[ch]xx' -o -name '*.c' -o -name '*.y'` || true
|