2004-04-16 06:56:28 +00:00
|
|
|
# This file is used by Makefile and declares common build rules,
|
2002-11-21 04:08:37 +00:00
|
|
|
# a list of common object files etc.
|
2008-02-25 14:09:04 +00:00
|
|
|
#
|
|
|
|
# $URL$
|
|
|
|
# $Id$
|
2002-04-26 13:39:31 +00:00
|
|
|
|
2003-09-08 15:33:26 +00:00
|
|
|
######################################################################
|
2007-06-15 18:42:00 +00:00
|
|
|
# The default build target: just build the scummvm executable
|
2003-09-08 15:33:26 +00:00
|
|
|
######################################################################
|
|
|
|
|
2007-12-16 21:41:10 +00:00
|
|
|
all: $(EXECUTABLE) plugins
|
2002-04-26 13:39:31 +00:00
|
|
|
|
2003-09-08 15:33:26 +00:00
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# Module settings
|
|
|
|
######################################################################
|
2003-04-26 11:44:13 +00:00
|
|
|
|
2008-05-02 14:30:06 +00:00
|
|
|
PLUGINS :=
|
2006-03-29 10:35:45 +00:00
|
|
|
MODULES := test tools base $(MODULES)
|
2003-09-17 22:41:01 +00:00
|
|
|
|
2006-09-23 00:42:35 +00:00
|
|
|
-include $(srcdir)/engines/engines.mk
|
2006-02-11 12:54:56 +00:00
|
|
|
|
2003-09-08 15:33:26 +00:00
|
|
|
# After the game specific modules follow the shared modules
|
2002-11-21 04:08:37 +00:00
|
|
|
MODULES += \
|
2009-03-17 22:41:54 +00:00
|
|
|
engines \
|
2003-03-07 16:21:28 +00:00
|
|
|
gui \
|
2004-03-21 21:20:25 +00:00
|
|
|
graphics \
|
2003-09-08 22:38:21 +00:00
|
|
|
sound \
|
2009-01-30 04:04:10 +00:00
|
|
|
backends \
|
2009-01-30 03:35:47 +00:00
|
|
|
common \
|
2002-07-06 13:05:42 +00:00
|
|
|
|
2004-11-06 01:41:32 +00:00
|
|
|
ifdef USE_MT32EMU
|
2004-12-25 18:34:44 +00:00
|
|
|
MODULES += sound/softsynth/mt32
|
2004-11-06 01:41:32 +00:00
|
|
|
endif
|
2003-09-08 15:33:26 +00:00
|
|
|
|
2005-06-27 21:44:40 +00:00
|
|
|
ifdef DISABLE_SCALERS
|
|
|
|
DEFINES += -DDISABLE_SCALERS
|
|
|
|
endif
|
|
|
|
|
2005-05-14 22:56:41 +00:00
|
|
|
ifdef DISABLE_HQ_SCALERS
|
|
|
|
DEFINES += -DDISABLE_HQ_SCALERS
|
|
|
|
endif
|
|
|
|
|
2007-12-16 21:41:10 +00:00
|
|
|
|
2003-09-08 15:33:26 +00:00
|
|
|
######################################################################
|
|
|
|
# The build rules follow - normally you should have no need to
|
|
|
|
# touch whatever comes after here.
|
|
|
|
######################################################################
|
|
|
|
|
2003-04-26 11:44:13 +00:00
|
|
|
# Concat DEFINES and INCLUDES to form the CPPFLAGS
|
2007-12-16 21:41:10 +00:00
|
|
|
CPPFLAGS := $(DEFINES) $(INCLUDES)
|
2003-04-26 11:44:13 +00:00
|
|
|
|
2002-11-21 04:08:37 +00:00
|
|
|
# Include the build instructions for all modules
|
2004-01-30 21:54:28 +00:00
|
|
|
-include $(addprefix $(srcdir)/, $(addsuffix /module.mk,$(MODULES)))
|
2002-08-21 16:07:07 +00:00
|
|
|
|
2003-09-19 21:23:23 +00:00
|
|
|
# Depdir information
|
2006-06-24 10:14:18 +00:00
|
|
|
DEPDIRS = $(addsuffix $(DEPDIR),$(MODULE_DIRS))
|
2008-01-27 19:47:41 +00:00
|
|
|
DEPFILES =
|
2003-09-19 21:23:23 +00:00
|
|
|
|
2006-04-08 11:36:49 +00:00
|
|
|
# Make base/version.o depend on all other object files. This way if anything is
|
|
|
|
# changed, it causes version.cpp to be recompiled. This in turn ensures that
|
2003-07-15 02:16:33 +00:00
|
|
|
# the build date in gScummVMBuildDate is correct.
|
2006-04-08 11:36:49 +00:00
|
|
|
base/version.o: $(filter-out base/libbase.a,$(OBJS))
|
2002-08-21 16:07:07 +00:00
|
|
|
|
2009-08-22 11:03:00 +00:00
|
|
|
# Replace regular output with quiet messages
|
|
|
|
ifneq ($(findstring $(MAKEFLAGS),s),s)
|
|
|
|
ifneq ($(VERBOSE_BUILD),1)
|
|
|
|
ifneq ($(VERBOSE_BUILD),yes)
|
|
|
|
QUIET_CXX = @echo ' ' C++ ' ' $@;
|
2009-08-22 16:30:20 +00:00
|
|
|
QUIET_AS = @echo ' ' AS ' ' $@;
|
2009-08-22 11:03:00 +00:00
|
|
|
QUIET_NASM = @echo ' ' NASM ' ' $@;
|
|
|
|
QUIET_AR = @echo ' ' AR ' ' $@;
|
|
|
|
QUIET_RANLIB = @echo ' ' RANLIB ' ' $@;
|
|
|
|
QUIET_PLUGIN = @echo ' ' PLUGIN ' ' $@;
|
|
|
|
QUIET_LINK = @echo ' ' LINK ' ' $@;
|
|
|
|
QUIET = @
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2003-09-17 22:41:01 +00:00
|
|
|
# The build rule for the ScummVM executable
|
2007-12-16 21:41:10 +00:00
|
|
|
$(EXECUTABLE): $(OBJS)
|
2009-10-09 11:38:13 +00:00
|
|
|
$(QUIET_LINK)$(LD) $(LDFLAGS) $(PRE_OBJS_FLAGS) $+ $(POST_OBJS_FLAGS) $(LIBS) -o $@
|
2002-07-06 13:05:42 +00:00
|
|
|
|
2003-09-19 21:23:23 +00:00
|
|
|
distclean: clean
|
2007-02-08 22:27:47 +00:00
|
|
|
$(RM) config.h config.mk config.log
|
2003-09-19 21:23:23 +00:00
|
|
|
|
2002-07-06 13:05:42 +00:00
|
|
|
clean:
|
2008-02-17 18:30:18 +00:00
|
|
|
$(RM_REC) $(DEPDIRS)
|
2005-01-11 22:02:05 +00:00
|
|
|
$(RM) $(OBJS) $(EXECUTABLE)
|
2002-07-06 13:05:42 +00:00
|
|
|
|
2009-09-25 12:11:27 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# The build rules for object files.
|
|
|
|
#
|
|
|
|
|
|
|
|
ifdef CXX_UPDATE_DEP_FLAG
|
|
|
|
|
|
|
|
# Build rule for C++ files. Makes use of CXX_UPDATE_DEP_FLAG for advanced
|
2008-01-27 19:47:41 +00:00
|
|
|
# dependency tracking.
|
2008-01-13 17:05:43 +00:00
|
|
|
%.o: %.cpp
|
2009-08-22 11:03:00 +00:00
|
|
|
$(QUIET)$(MKDIR) $(*D)/$(DEPDIR)
|
2009-09-25 12:11:27 +00:00
|
|
|
$(QUIET_CXX)$(CXX) $(CXX_UPDATE_DEP_FLAG) $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
|
|
|
|
|
|
|
|
# Build rule for Objective-C files. Strictly speaking, this is for OS X only.
|
2008-01-13 17:05:43 +00:00
|
|
|
%.o: %.m
|
2009-08-22 11:03:00 +00:00
|
|
|
$(QUIET)$(MKDIR) $(*D)/$(DEPDIR)
|
2009-09-25 12:11:27 +00:00
|
|
|
$(QUIET_CXX)$(CXX) $(CXX_UPDATE_DEP_FLAG) $(OBJCFLAGS) -c $(<) -o $*.o
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
# Dumb compile rule, for C++ compilers that don't allow dependency tracking or
|
|
|
|
# where it is broken (such as GCC 2.95).
|
|
|
|
.cpp.o:
|
|
|
|
$(QUIET_CXX)$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
|
|
|
|
|
2003-08-02 09:21:34 +00:00
|
|
|
endif
|
2002-08-21 16:53:11 +00:00
|
|
|
|
2009-09-25 12:11:27 +00:00
|
|
|
|
2009-08-22 16:30:20 +00:00
|
|
|
%.o: %.s
|
2009-10-04 23:21:01 +00:00
|
|
|
$(QUIET)$(MKDIR) $(*D)
|
2009-08-22 16:30:20 +00:00
|
|
|
$(QUIET_AS)$(AS) $(ASFLAGS) $(<) -o $*.o
|
|
|
|
|
2009-10-10 12:35:20 +00:00
|
|
|
%.o: %.S
|
|
|
|
$(QUIET)$(MKDIR) $(*D)/$(DEPDIR)
|
|
|
|
$(QUIET_AS)$(CXX) $(CXX_UPDATE_DEP_FLAG) $(ASFLAGS) -c $(<) -o $*.o
|
|
|
|
|
2004-05-21 02:08:48 +00:00
|
|
|
ifdef HAVE_NASM
|
2008-01-13 17:05:43 +00:00
|
|
|
%.o: %.asm
|
2009-10-04 23:21:01 +00:00
|
|
|
$(QUIET)$(MKDIR) $(*D)
|
2009-08-22 11:03:00 +00:00
|
|
|
$(QUIET_NASM)$(NASM) -O1 $(NASMFLAGS) -g -o $*.o $(<)
|
2004-05-21 02:08:48 +00:00
|
|
|
endif
|
|
|
|
|
2007-09-29 11:20:07 +00:00
|
|
|
# Include the dependency tracking files.
|
|
|
|
-include $(wildcard $(addsuffix /*.d,$(DEPDIRS)))
|
2007-12-16 21:41:10 +00:00
|
|
|
|
2009-10-28 13:43:57 +00:00
|
|
|
.PHONY: $(wildcard $(addsuffix /*.d,$(DEPDIRS))) $(addprefix $(srcdir)/, $(addsuffix /module.mk,$(MODULES))) \
|
|
|
|
$(srcdir)/$(port_mk) $(srcdir)/rules.mk $(srcdir)/engines/engines.mk
|
2007-12-16 21:41:10 +00:00
|
|
|
|
|
|
|
######################################################################
|
2009-03-19 18:39:47 +00:00
|
|
|
# Get the current version information
|
2007-12-16 21:41:10 +00:00
|
|
|
######################################################################
|
|
|
|
|
2009-03-28 23:39:59 +00:00
|
|
|
# AmigaOS4's grep has a problem with "./" in pathnames, so use cat.
|
|
|
|
VERSION = $(shell cat "${srcdir}/base/internal_version.h" | grep SCUMMVM_VERSION | cut -d\" -f2)
|
2007-12-16 21:41:10 +00:00
|
|
|
VER_MAJOR = $(shell echo $(VERSION) | cut -d. -f 1)
|
|
|
|
VER_MINOR = $(shell echo $(VERSION) | cut -d. -f 2)
|
|
|
|
VER_PATCH = $(shell echo $(VERSION) | cut -d. -f 3 | cut -c1)
|
|
|
|
VER_EXTRA = $(shell echo $(VERSION) | cut -d. -f 3 | cut -c2-)
|
|
|
|
|
2009-03-19 18:39:47 +00:00
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# Get Subversion's working copy information
|
|
|
|
######################################################################
|
|
|
|
|
2009-04-03 15:08:26 +00:00
|
|
|
ifeq ($(shell LANG=C svn stat $(srcdir) 2>&1 | grep "is not a working copy"),)
|
2009-03-19 18:39:47 +00:00
|
|
|
SVNROOT := $(srcdir)
|
|
|
|
ifeq ($(origin SVNREV), undefined)
|
|
|
|
# Get the working copy base revision
|
2009-04-03 15:08:26 +00:00
|
|
|
VER_SVNREV := $(shell LANG=C svn info $(SVNROOT) | grep "^Revision" | cut -d ' ' -f 2)
|
2009-03-19 18:39:47 +00:00
|
|
|
endif
|
|
|
|
else
|
|
|
|
SVNROOT := https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk/
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Define the Subversion revision if available, either autodetected or
|
|
|
|
# specified by the user
|
|
|
|
ifneq ($(origin VER_SVNREV), undefined)
|
|
|
|
CXXFLAGS+= -DSCUMMVM_SVN_REVISION=\"$(VER_SVNREV)\"
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2007-12-16 21:41:10 +00:00
|
|
|
######################################################################
|
|
|
|
# Distribution settings
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
ifeq ($(VER_EXTRA),svn)
|
2009-03-19 19:42:22 +00:00
|
|
|
ifeq ($(origin VER_SVNREV), undefined)
|
2007-12-16 21:41:10 +00:00
|
|
|
DISTVERSION = $(shell date '+%Y-%m-%d')
|
|
|
|
else
|
2009-03-19 19:42:22 +00:00
|
|
|
DISTVERSION = svn$(VER_SVNREV)
|
|
|
|
endif
|
|
|
|
else
|
2007-12-16 21:41:10 +00:00
|
|
|
DISTVERSION = $(VERSION)
|
|
|
|
endif
|
|
|
|
|
|
|
|
DISTNAME := scummvm-$(DISTVERSION)
|
|
|
|
DISTDIR := dist
|
|
|
|
VERFILE := $(DISTDIR)/$(DISTNAME)/base/internal_version.h
|
|
|
|
|
|
|
|
$(VERFILE): $(srcdir)/base/internal_version.h
|
|
|
|
@$(RM_REC) $(DISTDIR)
|
|
|
|
@$(MKDIR) $(DISTDIR)
|
|
|
|
svn export $(SVNROOT) $(DISTDIR)/$(DISTNAME)
|
2009-03-19 19:42:22 +00:00
|
|
|
ifneq ($(origin VER_SVNREV), undefined)
|
|
|
|
@# Use the current SVN revision as a default for the snapshot sources
|
|
|
|
@svn cat $(SVNROOT)/base/internal_version.h | sed -e \
|
|
|
|
"s/^#define SCUMMVM_SVN_REVISION$$/#define SCUMMVM_SVN_REVISION \"$(VER_SVNREV)\"/g" \
|
|
|
|
> $(VERFILE)
|
|
|
|
endif
|
2007-12-16 21:41:10 +00:00
|
|
|
|
|
|
|
$(DISTDIR)/$(DISTNAME).tar.gz: $(VERFILE)
|
|
|
|
cd $(DISTDIR); tar zcf $(DISTNAME).tar.gz $(DISTNAME)
|
|
|
|
|
|
|
|
$(DISTDIR)/$(DISTNAME).tar.bz2: $(VERFILE)
|
|
|
|
cd $(DISTDIR); tar jcf $(DISTNAME).tar.bz2 $(DISTNAME)
|
|
|
|
|
|
|
|
$(DISTDIR)/$(DISTNAME).zip: $(VERFILE)
|
|
|
|
cd $(DISTDIR); zip -qr9 $(DISTNAME).zip $(DISTNAME)
|
|
|
|
|
|
|
|
dist-src: \
|
|
|
|
$(DISTDIR)/$(DISTNAME).tar.gz \
|
|
|
|
$(DISTDIR)/$(DISTNAME).tar.bz2 \
|
|
|
|
$(DISTDIR)/$(DISTNAME).zip
|
|
|
|
@#RPM-src?
|
|
|
|
@#DEB-src?
|
|
|
|
|
2009-06-18 18:40:38 +00:00
|
|
|
# Common files
|
|
|
|
DIST_FILES_DOCS:=$(addprefix $(srcdir)/,AUTHORS COPYING COPYING.LGPL COPYRIGHT NEWS README)
|
2008-01-06 14:08:53 +00:00
|
|
|
|
|
|
|
# Themes files
|
2009-02-20 12:32:48 +00:00
|
|
|
DIST_FILES_THEMES:=$(addprefix $(srcdir)/gui/themes/,scummmodern.zip)
|
2008-01-06 14:08:53 +00:00
|
|
|
|
|
|
|
# Engine data files
|
|
|
|
DIST_FILES_ENGINEDATA=
|
2008-06-09 12:23:56 +00:00
|
|
|
ifdef ENABLE_DRASCULA
|
|
|
|
DIST_FILES_ENGINEDATA+=drascula.dat
|
|
|
|
endif
|
2008-05-06 03:00:26 +00:00
|
|
|
ifdef ENABLE_IGOR
|
2008-01-06 14:08:53 +00:00
|
|
|
DIST_FILES_ENGINEDATA+=igor.tbl
|
|
|
|
endif
|
2008-05-06 03:00:26 +00:00
|
|
|
ifdef ENABLE_KYRA
|
2008-01-06 14:08:53 +00:00
|
|
|
DIST_FILES_ENGINEDATA+=kyra.dat
|
|
|
|
endif
|
2008-05-06 03:00:26 +00:00
|
|
|
ifdef ENABLE_LURE
|
2008-01-06 14:08:53 +00:00
|
|
|
DIST_FILES_ENGINEDATA+=lure.dat
|
|
|
|
endif
|
2008-05-06 03:00:26 +00:00
|
|
|
ifdef ENABLE_M4
|
2008-04-21 03:55:10 +00:00
|
|
|
DIST_FILES_ENGINEDATA+=m4.dat
|
|
|
|
endif
|
2008-05-06 03:00:26 +00:00
|
|
|
ifdef ENABLE_QUEEN
|
2008-01-06 14:08:53 +00:00
|
|
|
DIST_FILES_ENGINEDATA+=queen.tbl
|
|
|
|
endif
|
2008-05-06 03:00:26 +00:00
|
|
|
ifdef ENABLE_SKY
|
2008-01-06 14:08:53 +00:00
|
|
|
DIST_FILES_ENGINEDATA+=sky.cpt
|
|
|
|
endif
|
2009-09-05 08:24:36 +00:00
|
|
|
ifdef ENABLE_TEENAGENT
|
|
|
|
DIST_FILES_ENGINEDATA+=teenagent.dat
|
|
|
|
endif
|
2008-01-06 14:13:40 +00:00
|
|
|
DIST_FILES_ENGINEDATA:=$(addprefix $(srcdir)/dists/engine-data/,$(DIST_FILES_ENGINEDATA))
|
2008-01-06 14:08:53 +00:00
|
|
|
|
2009-06-18 19:39:12 +00:00
|
|
|
# pred.dic is currently only used for the AGI engine
|
|
|
|
ifdef ENABLE_AGI
|
|
|
|
DIST_FILES_ENGINEDATA+=$(srcdir)/dists/pred.dic
|
|
|
|
endif
|
|
|
|
|
2008-05-02 14:30:06 +00:00
|
|
|
# Plugin files
|
|
|
|
DIST_FILES_PLUGINS:=$(addprefix $(srcdir)/,$(PLUGINS))
|
|
|
|
|
2007-12-16 21:41:10 +00:00
|
|
|
.PHONY: all clean distclean plugins dist-src
|