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
|
|
|
|
##
|
|
|
|
## Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team
|
|
|
|
##
|
|
|
|
## See the file "license" for information on usage and redistribution of
|
|
|
|
## this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
|
|
|
##
|
2006-03-11 21:34:37 +00:00
|
|
|
## $Id: Makefile,v 1.22 2006-03-11 21:34:37 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 :=
|
|
|
|
LIBS :=
|
|
|
|
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)
|
|
|
|
|
2005-06-28 23:18:16 +00:00
|
|
|
all: $(EXECUTABLE)
|
|
|
|
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# 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/emucore/m6502 \
|
|
|
|
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
|
|
|
|
$(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
|
|
|
|
|
|
|
|
ifdef HAVE_NASM
|
|
|
|
.SUFFIXES: .asm
|
|
|
|
.asm.o:
|
|
|
|
$(NASM) -O1 $(NASMFLAGS) -g -o $*.o $(<)
|
|
|
|
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)"
|
|
|
|
$(INSTALL) -c -m 644 "$(srcdir)/Announce.txt" "$(srcdir)/Changes.txt" "$(srcdir)/Copyright.txt" "$(srcdir)/License.txt" "$(srcdir)/README-PSP.txt" "$(srcdir)/README-SDL.txt" "$(srcdir)/Readme.txt" "$(srcdir)/Todo.txt" "$(srcdir)/docs/stella.html" "$(srcdir)/docs/debugger.html" "$(DESTDIR)$(DOCDIR)/"
|
|
|
|
$(INSTALL) -d "$(DESTDIR)$(DOCDIR)/graphics"
|
|
|
|
$(INSTALL) -c -m 644 "$(srcdir)/docs/graphics/chucky_cheese.png" "$(srcdir)/docs/graphics/circuit.png" "$(srcdir)/docs/graphics/console.png" "$(srcdir)/docs/graphics/eventmapping.png" "$(srcdir)/docs/graphics/eventmapping_remap.png" "$(srcdir)/docs/graphics/jr_pacman.png" "$(srcdir)/docs/graphics/launcher_options_rom.png" "$(srcdir)/docs/graphics/launcher_options_snap.png" "$(srcdir)/docs/graphics/launcher.png" "$(srcdir)/docs/graphics/options_about.png" "$(srcdir)/docs/graphics/options_audio.png" "$(srcdir)/docs/graphics/options_gameinfo.png" "$(srcdir)/docs/graphics/options_help.png" "$(srcdir)/docs/graphics/options_video.png" "$(srcdir)/docs/graphics/pacman.png" "$(srcdir)/docs/graphics/rom_browser.png" "$(srcdir)/docs/graphics/secret_quest.png" "$(srcdir)/docs/graphics/space_invaders.png" "$(DESTDIR)$(DOCDIR)/graphics"
|
2005-10-03 00:53:20 +00:00
|
|
|
$(INSTALL) -d "$(DESTDIR)$(DATADIR)/icons"
|
|
|
|
$(INSTALL) -c -m 644 "$(srcdir)/src/common/stella.xpm" "$(DESTDIR)$(DATADIR)/icons"
|
2006-01-15 21:02:22 +00:00
|
|
|
$(INSTALL) -d "$(DESTDIR)$(DATADIR)/stella"
|
2006-03-11 21:34:37 +00:00
|
|
|
# $(INSTALL) -c -m 644 "$(srcdir)/src/emucore/stella.pro" "$(DESTDIR)$(DATADIR)/stella"
|
2006-01-15 21:02:22 +00:00
|
|
|
@echo $(PROPDIR)
|
2005-09-30 22:12:18 +00:00
|
|
|
install-strip: install
|
|
|
|
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)/"
|
2005-10-03 00:53:20 +00:00
|
|
|
rm -f "$(DESTDIR)$(DATADIR)/icons/stella.xpm"
|
2006-01-15 21:02:22 +00:00
|
|
|
rm -rf "$(DESTDIR)$(DATADIR)/stella"
|
2005-09-30 22:12:18 +00:00
|
|
|
|
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
|
|
|
|
windres --include-dir src/win32 src/win32/stella.rc src/win32/stella_icon.o
|
|
|
|
|
|
|
|
# Special target to create a Win32 snapshot package
|
|
|
|
win32dist: stella$(EXEEXT)
|
|
|
|
rm -rf $(DISTNAME)
|
|
|
|
mkdir -p $(DISTNAME)/docs/graphics
|
|
|
|
strip stella$(EXEEXT) -o $(DISTNAME)/stella$(EXEEXT)
|
2006-03-11 21:34:37 +00:00
|
|
|
# cp src/emucore/stella.pro $(DISTNAME)
|
2005-10-22 20:33:57 +00:00
|
|
|
cp Announce.txt Changes.txt Copyright.txt License.txt README-PSP.txt README-SDL.txt Readme.txt Todo.txt $(DISTNAME)/docs
|
|
|
|
cp -r docs/*.html $(DISTNAME)/docs
|
|
|
|
cp -r docs/graphics/*.png $(DISTNAME)/docs/graphics
|
|
|
|
cp /usr/bin/SDL.dll /mingw/bin/libpng12.dll /mingw/bin/zlib1.dll $(DISTNAME)
|
|
|
|
# u2d $(DISTNAME)/*.txt
|
|
|
|
# zip $(DISTNAME)-win32.zip $(DISTNAME)
|
2005-06-28 18:56:49 +00:00
|
|
|
|
2005-08-25 15:19:17 +00:00
|
|
|
# Special target to create psp stuff
|
|
|
|
psp-package: $(EXECUTABLE)
|
|
|
|
$(MKSFO) 'Stella' PARAM.SFO
|
|
|
|
mkdir -p "psp/stella"
|
2005-09-18 14:28:17 +00:00
|
|
|
$(PSP-FIX) stella.elf
|
2005-08-25 15:19:17 +00:00
|
|
|
$(PSP-STRIP) stella.elf -o psp/stella/EBOOT.PBP
|
|
|
|
mkdir -p "psp/stella%"
|
|
|
|
$(PACK-PBP) "psp/stella%/EBOOT.PBP" PARAM.SFO src/psp/data/ICON0.PNG NULL NULL src/psp/data/PIC1.PNG NULL NULL NULL
|
|
|
|
rm -f PARAM.SFO
|
|
|
|
|
|
|
|
psp-upload: psp-package
|
|
|
|
mount | grep $(PSP-MOUNTPOINT) || mount $(PSP-MOUNTPOINT)
|
|
|
|
cp -rv "psp/stella" "psp/stella%" $(PSP-MOUNTPOINT)/psp/game/
|
|
|
|
umount $(PSP-MOUNTPOINT)
|
|
|
|
|
|
|
|
psp-debug:
|
|
|
|
mount | grep \$(PSP-MOUNTPOINT) || mount $(PSP-MOUNTPOINT)
|
|
|
|
@cat $(PSP-MOUNTPOINT)/stderr.txt
|
|
|
|
@echo -e "\n\n------------------------------------------------------------"
|
|
|
|
@cat $(PSP-MOUNTPOINT)/stdout.txt
|
|
|
|
umount $(PSP-MOUNTPOINT)
|
|
|
|
|
|
|
|
psp-cleanup:
|
|
|
|
rm -rf psp
|
|
|
|
mount | grep $(PSP-MOUNTPOINT) || mount $(PSP-MOUNTPOINT)
|
|
|
|
rm -rf $(PSP-MOUNTPOINT)/std*
|
|
|
|
umount $(PSP-MOUNTPOINT)
|
|
|
|
|
|
|
|
psp-layout:
|
|
|
|
mount | grep $(PSP-MOUNTPOINT) || mount $(PSP-MOUNTPOINT)
|
|
|
|
mkdir -p $(PSP-MOUNTPOINT)/stella/roms
|
|
|
|
mkdir -p $(PSP-MOUNTPOINT)/stella/snapshots
|
|
|
|
cp -v src/psp/data/stellarc.psp $(PSP-MOUNTPOINT)/stella/stellarc
|
|
|
|
umount $(PSP-MOUNTPOINT)
|
|
|
|
|
2006-01-08 02:28:04 +00:00
|
|
|
# GP2X exec needs strip
|
|
|
|
gp2x-strip: $(EXECUTABLE)
|
2006-02-15 03:12:12 +00:00
|
|
|
$(GP2X-STRIP) stella
|
|
|
|
|
|
|
|
# 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-11 21:34:37 +00:00
|
|
|
# cp -v $(srcdir)/src/emucore/stella.pro $(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
|
2006-02-15 03:12:12 +00:00
|
|
|
|
2005-10-22 20:33:57 +00:00
|
|
|
.PHONY: deb bundle test win32dist install uninstall
|