2001-11-09 18:57:46 +00:00
|
|
|
# $Header$
|
2001-11-06 22:59:59 +00:00
|
|
|
|
2002-10-23 00:20:11 +00:00
|
|
|
#######################################################################
|
|
|
|
# Default compilation parameters. Normally don't edit these #
|
|
|
|
#######################################################################
|
|
|
|
|
2004-01-30 21:54:28 +00:00
|
|
|
srcdir ?= .
|
|
|
|
|
2003-09-28 10:44:31 +00:00
|
|
|
DEFINES := -DHAVE_CONFIG_H
|
|
|
|
LDFLAGS :=
|
2005-06-24 15:26:06 +00:00
|
|
|
INCLUDES := -I. -I$(srcdir)
|
2003-09-28 10:44:31 +00:00
|
|
|
LIBS :=
|
|
|
|
OBJS :=
|
2002-08-21 17:35:46 +00:00
|
|
|
|
2003-09-28 10:44:31 +00:00
|
|
|
MODULES :=
|
2003-09-17 21:53:13 +00:00
|
|
|
MODULE_DIRS :=
|
|
|
|
|
2003-08-10 06:56:53 +00:00
|
|
|
# Load the make rules generated by configure
|
2004-01-31 00:05:08 +00:00
|
|
|
include config.mak
|
2003-07-16 20:36:38 +00:00
|
|
|
|
2003-08-10 06:56:53 +00:00
|
|
|
# Uncomment this for stricter compile time code verification
|
2005-05-10 06:13:07 +00:00
|
|
|
# CXXFLAGS+= -Werror
|
2003-04-26 11:44:13 +00:00
|
|
|
|
2003-12-24 16:17:13 +00:00
|
|
|
CXXFLAGS:= -Wall $(CXXFLAGS)
|
2005-05-10 06:13:07 +00:00
|
|
|
CXXFLAGS+= -O -Wuninitialized
|
2003-09-21 18:39:38 +00:00
|
|
|
CXXFLAGS+= -Wno-long-long -Wno-multichar -Wno-unknown-pragmas
|
2003-08-10 06:56:53 +00:00
|
|
|
# Even more warnings...
|
2003-09-21 18:39:38 +00:00
|
|
|
CXXFLAGS+= -pedantic -Wpointer-arith -Wcast-qual -Wconversion
|
2003-08-10 06:56:53 +00:00
|
|
|
CXXFLAGS+= -Wshadow -Wimplicit -Wundef -Wnon-virtual-dtor
|
2005-06-20 17:55:37 +00:00
|
|
|
CXXFLAGS+= -Wno-reorder -Wwrite-strings -fcheck-new
|
2003-04-26 11:44:13 +00:00
|
|
|
|
|
|
|
#######################################################################
|
2004-02-01 01:32:43 +00:00
|
|
|
# Misc stuff - you should never have to edit this #
|
2003-04-26 11:44:13 +00:00
|
|
|
#######################################################################
|
2001-10-09 14:30:12 +00:00
|
|
|
|
2004-02-01 01:32:43 +00:00
|
|
|
EXECUTABLE := scummvm$(EXEEXT)
|
|
|
|
|
2004-01-30 21:54:28 +00:00
|
|
|
include $(srcdir)/Makefile.common
|
2002-04-27 11:06:27 +00:00
|
|
|
|
2003-08-10 07:47:47 +00:00
|
|
|
# check if configure has been run or has been changed since last run
|
2004-01-31 00:05:08 +00:00
|
|
|
config.mak: $(srcdir)/configure
|
2003-08-10 07:52:23 +00:00
|
|
|
@echo "You need to run ./configure before you can run make"
|
|
|
|
@echo "Either you haven't run it before or it has changed."
|
2003-08-10 07:34:58 +00:00
|
|
|
@exit 1
|
|
|
|
|
2004-04-16 08:30:57 +00:00
|
|
|
install: all
|
2005-05-08 12:36:12 +00:00
|
|
|
$(INSTALL) -d "$(DESTDIR)$(BINDIR)"
|
|
|
|
$(INSTALL) -c -s -m 755 "$(srcdir)/scummvm$(EXEEXT)" "$(DESTDIR)$(BINDIR)/scummvm$(EXEEXT)"
|
|
|
|
$(INSTALL) -d "$(DESTDIR)$(MANDIR)/man6/"
|
|
|
|
$(INSTALL) -c -m 644 "$(srcdir)/scummvm.6" "$(DESTDIR)$(MANDIR)/man6/scummvm.6"
|
|
|
|
$(INSTALL) -d "$(DESTDIR)$(PREFIX)/share/pixmaps/"
|
|
|
|
$(INSTALL) -c -m 644 "$(srcdir)/scummvm.xpm" "$(DESTDIR)$(PREFIX)/share/pixmaps/scummvm.xpm"
|
|
|
|
$(INSTALL) -d "$(DESTDIR)$(PREFIX)/share/doc/scummvm/"
|
|
|
|
$(INSTALL) -c -m 644 "$(srcdir)/AUTHORS" "$(srcdir)/COPYING" "$(srcdir)/NEWS" "$(srcdir)/README" "$(DESTDIR)$(PREFIX)/share/doc/scummvm/"
|
2004-04-16 08:30:57 +00:00
|
|
|
|
|
|
|
uninstall:
|
2005-05-08 12:36:12 +00:00
|
|
|
rm -f "$(DESTDIR)$(BINDIR)/scummvm$(EXEEXT)"
|
|
|
|
rm -f "$(DESTDIR)$(MANDIR)/man6/scummvm.6"
|
|
|
|
rm -f "$(DESTDIR)$(PREFIX)/share/pixmaps/scummvm.xpm"
|
|
|
|
rm -rf "$(DESTDIR)$(PREFIX)/share/doc/scummvm/"
|
2004-04-16 08:30:57 +00:00
|
|
|
|
2004-03-17 09:14:41 +00:00
|
|
|
scummvmico.o: scummvm.ico
|
|
|
|
windres scummvm.rc scummvmico.o
|
|
|
|
|
2002-04-27 11:06:27 +00:00
|
|
|
dist:
|
2002-08-21 20:47:12 +00:00
|
|
|
$(RM) $(ZIPFILE)
|
|
|
|
$(ZIP) $(ZIPFILE) $(DISTFILES)
|
2002-08-21 17:35:46 +00:00
|
|
|
|
2002-11-01 18:05:06 +00:00
|
|
|
deb:
|
|
|
|
ln -sf dists/debian;
|
|
|
|
debian/prepare
|
|
|
|
fakeroot debian/rules binary
|
2002-11-10 22:07:06 +00:00
|
|
|
|
2003-12-24 16:17:13 +00:00
|
|
|
#######################################################################
|
|
|
|
# Unit/regression tests #
|
|
|
|
# In order to use 'make test' you have to install cxxtest inside the #
|
|
|
|
# test/cxxtest dir. Get it from http://cxxtest.sourceforge.net. #
|
|
|
|
#######################################################################
|
|
|
|
|
|
|
|
CXXTEST := test/cxxtest
|
|
|
|
TESTS := test/common/*.h
|
|
|
|
CPPFLAGS += -I$(CXXTEST)
|
|
|
|
test: runner
|
|
|
|
./runner
|
|
|
|
runner: runner.o common/libcommon.a
|
|
|
|
$(CXX) -o $@ $+
|
|
|
|
runner.cpp: $(TESTS)
|
|
|
|
$(CXXTEST)/cxxtestgen.py --error-printer -o $@ $+
|
|
|
|
|
|
|
|
|
|
|
|
|
2002-11-10 22:07:06 +00:00
|
|
|
# Special target to create a application wrapper for Mac OS X
|
|
|
|
bundle_name = ScummVM.app
|
2002-12-01 20:29:20 +00:00
|
|
|
bundle: scummvm-static
|
2002-11-10 22:07:06 +00:00
|
|
|
mkdir -p $(bundle_name)/Contents/MacOS
|
|
|
|
mkdir -p $(bundle_name)/Contents/Resources
|
|
|
|
echo "APPL????" > $(bundle_name)/Contents/PkgInfo
|
2004-01-31 00:05:08 +00:00
|
|
|
cp $(srcdir)/Info.plist $(bundle_name)/Contents/
|
|
|
|
cp $(srcdir)/scummvm.icns $(bundle_name)/Contents/Resources/
|
2005-03-22 20:16:27 +00:00
|
|
|
cp scummvm-static $(bundle_name)/Contents/MacOS/scummvm
|
|
|
|
$(srcdir)/tools/credits.pl --rtf > $(bundle_name)/Contents/Resources/Credits.rtf
|
2002-12-01 20:29:20 +00:00
|
|
|
strip $(bundle_name)/Contents/MacOS/scummvm
|
|
|
|
|
2004-03-29 11:59:09 +00:00
|
|
|
# location of additional libs for OS X usually /sw/ for fink or
|
|
|
|
# /opt/local/ for darwinports
|
|
|
|
OSXOPT=/sw
|
2002-12-01 20:29:20 +00:00
|
|
|
# Special target to create a static linked binary for Mac OS X
|
|
|
|
scummvm-static: $(OBJS)
|
2003-03-23 13:11:55 +00:00
|
|
|
$(CXX) $(LDFLAGS) -o scummvm-static $(OBJS) \
|
2004-03-03 23:39:23 +00:00
|
|
|
`sdl-config --static-libs` \
|
2004-03-29 11:59:09 +00:00
|
|
|
$(OSXOPT)/lib/libmad.a \
|
|
|
|
$(OSXOPT)/lib/libvorbisfile.a \
|
|
|
|
$(OSXOPT)/lib/libvorbis.a \
|
|
|
|
$(OSXOPT)/lib/libogg.a \
|
|
|
|
$(OSXOPT)/lib/libmpeg2.a \
|
|
|
|
$(OSXOPT)/lib/libFLAC.a \
|
2004-03-03 23:39:23 +00:00
|
|
|
-lz
|
2002-12-01 20:29:20 +00:00
|
|
|
|
2004-03-29 12:22:03 +00:00
|
|
|
# Special target to create a snapshot disk image for Mac OS X
|
|
|
|
osxsnap: bundle
|
|
|
|
mkdir ScummVM-snapshot
|
2004-12-20 21:06:08 +00:00
|
|
|
cp AUTHORS ./ScummVM-snapshot/ScummVM\ Authors
|
2004-03-29 12:22:03 +00:00
|
|
|
cp COPYING ./ScummVM-snapshot/License
|
2004-12-20 21:06:08 +00:00
|
|
|
cp NEWS ./ScummVM-snapshot/News
|
|
|
|
cp README ./ScummVM-snapshot/ScummVM\ ReadMe
|
2004-03-29 12:22:03 +00:00
|
|
|
/Developer/Tools/SetFile -t TEXT -c ttxt ./ScummVM-snapshot/*
|
|
|
|
/Developer/Tools/CpMac -r $(bundle_name) ./ScummVM-snapshot/
|
2004-04-03 07:19:10 +00:00
|
|
|
hdiutil create -ov -format UDZO -srcfolder ScummVM-snapshot ScummVM-snapshot.dmg
|
2004-03-29 12:22:03 +00:00
|
|
|
rm -rf ScummVM-snapshot
|
|
|
|
|
2004-03-21 00:26:23 +00:00
|
|
|
# Special target to create a win32 snapshot binary
|
2004-04-09 01:43:51 +00:00
|
|
|
win32dist: scummvm$(EXEEXT)
|
2004-03-21 00:26:23 +00:00
|
|
|
mkdir -p $(WIN32PATH)
|
2004-04-09 01:43:51 +00:00
|
|
|
strip scummvm.exe -o $(WIN32PATH)/scummvm$(EXEEXT)
|
2004-12-20 12:00:21 +00:00
|
|
|
cp AUTHORS $(WIN32PATH)/AUTHORS.txt
|
2004-12-20 21:06:08 +00:00
|
|
|
cp COPYING $(WIN32PATH)/COPYING.txt
|
2004-12-20 12:00:21 +00:00
|
|
|
cp NEWS $(WIN32PATH)/NEWS.txt
|
2004-12-20 21:06:08 +00:00
|
|
|
cp README $(WIN32PATH)/README.txt
|
2004-12-16 03:13:00 +00:00
|
|
|
cp /usr/local/README-SDL.txt $(WIN32PATH)
|
|
|
|
cp /usr/local/bin/SDL.dll $(WIN32PATH)
|
2004-03-21 00:26:23 +00:00
|
|
|
u2d $(WIN32PATH)/*.txt
|
|
|
|
|
|
|
|
|
2005-01-11 22:02:05 +00:00
|
|
|
.PHONY: deb bundle test osxsnap win32dist dist install uninstall
|