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 += \
|
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 \
|
2006-06-24 08:07:48 +00:00
|
|
|
common \
|
2008-05-06 03:00:26 +00:00
|
|
|
engines \
|
2006-06-24 08:07:48 +00:00
|
|
|
backends
|
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
|
|
|
|
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)
|
2004-02-25 10:31:53 +00:00
|
|
|
$(CXX) $(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
|
|
|
|
2003-09-08 15:33:26 +00:00
|
|
|
# Old (dumb) compile & dependcy rules
|
2007-09-19 08:40:12 +00:00
|
|
|
#INCS = scumm/scumm.h common/scummsys.h
|
2002-08-21 16:28:19 +00:00
|
|
|
#.cpp.o:
|
2002-12-09 13:38:01 +00:00
|
|
|
# $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
|
2002-08-21 16:28:19 +00:00
|
|
|
#$(OBJS): $(INCS)
|
2002-07-06 13:02:57 +00:00
|
|
|
|
2003-08-02 11:17:11 +00:00
|
|
|
ifndef HAVE_GCC3
|
|
|
|
# If you use GCC, disable the above and enable this for intelligent
|
2008-01-27 19:47:41 +00:00
|
|
|
# dependency tracking.
|
2008-01-13 17:05:43 +00:00
|
|
|
%.o: %.cpp
|
2002-11-21 20:36:33 +00:00
|
|
|
$(MKDIR) $(*D)/$(DEPDIR)
|
2002-12-09 13:38:01 +00:00
|
|
|
$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d2" $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
|
2002-11-21 20:36:33 +00:00
|
|
|
$(ECHO) "$(*D)/" > $(*D)/$(DEPDIR)/$(*F).d
|
|
|
|
$(CAT) "$(*D)/$(DEPDIR)/$(*F).d2" >> "$(*D)/$(DEPDIR)/$(*F).d"
|
|
|
|
$(RM) "$(*D)/$(DEPDIR)/$(*F).d2"
|
2003-08-02 09:21:34 +00:00
|
|
|
else
|
2002-11-21 04:08:37 +00:00
|
|
|
# If you even have GCC 3.x, you can use this build rule, which is safer; the above
|
2003-07-31 18:41:05 +00:00
|
|
|
# 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.
|
2008-01-13 17:05:43 +00:00
|
|
|
%.o: %.cpp
|
2003-08-02 09:21:34 +00:00
|
|
|
$(MKDIR) $(*D)/$(DEPDIR)
|
|
|
|
$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
|
2008-01-13 17:05:43 +00:00
|
|
|
%.o: %.m
|
2007-11-13 08:06:15 +00:00
|
|
|
$(MKDIR) $(*D)/$(DEPDIR)
|
|
|
|
$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(OBJCFLAGS) -c $(<) -o $*.o
|
2003-08-02 09:21:34 +00:00
|
|
|
endif
|
2002-08-21 16:53:11 +00:00
|
|
|
|
2004-05-21 02:08:48 +00:00
|
|
|
ifdef HAVE_NASM
|
2008-01-13 17:05:43 +00:00
|
|
|
%.o: %.asm
|
2004-05-21 02:08:48 +00:00
|
|
|
$(NASM) -O1 $(NASMFLAGS) -g -o $*.o $(<)
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# Create the files that depend on the version
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
VERSION_FILES = \
|
|
|
|
$(srcdir)/dists/iphone/Info.plist \
|
|
|
|
$(srcdir)/dists/macosx/Info.plist
|
|
|
|
|
|
|
|
VERSION = $(shell cat "${srcdir}/base/internal_version.h" | cut -d\" -f2)
|
|
|
|
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-)
|
|
|
|
|
|
|
|
$(VERSION_FILES): %: %.in
|
|
|
|
@echo "Creating $@"
|
|
|
|
@cat $< | sed \
|
|
|
|
-e "s/@VER_MAJOR@/$(VER_MAJOR)/g" \
|
|
|
|
-e "s/@VER_MINOR@/$(VER_MINOR)/g" \
|
|
|
|
-e "s/@VER_PATCH@/$(VER_PATCH)/g" \
|
|
|
|
-e "s/@VER_EXTRA@/$(VER_EXTRA)/g" \
|
|
|
|
-e "s/@VERSION@/$(VERSION)/g" \
|
|
|
|
> $@
|
|
|
|
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# Distribution settings
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
ifeq ($(VER_EXTRA),svn)
|
|
|
|
DISTVERSION = $(shell date '+%Y-%m-%d')
|
|
|
|
else
|
|
|
|
DISTVERSION = $(VERSION)
|
|
|
|
endif
|
|
|
|
|
|
|
|
DISTNAME := scummvm-$(DISTVERSION)
|
|
|
|
DISTDIR := dist
|
|
|
|
VERFILE := $(DISTDIR)/$(DISTNAME)/base/internal_version.h
|
|
|
|
|
|
|
|
ifeq ($(shell svn stat $(srcdir) 2>&1 | grep "is not a working copy"),)
|
|
|
|
SVNROOT := $(srcdir)
|
|
|
|
else
|
|
|
|
SVNROOT := https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk/
|
|
|
|
endif
|
|
|
|
|
|
|
|
$(VERFILE): $(srcdir)/base/internal_version.h
|
|
|
|
@$(RM_REC) $(DISTDIR)
|
|
|
|
@$(MKDIR) $(DISTDIR)
|
|
|
|
svn export $(SVNROOT) $(DISTDIR)/$(DISTNAME)
|
|
|
|
|
|
|
|
$(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?
|
|
|
|
|
2008-01-06 14:08:53 +00:00
|
|
|
|
|
|
|
# Themes files
|
2008-05-02 14:30:06 +00:00
|
|
|
DIST_FILES_THEMES:=$(addprefix $(srcdir)/gui/themes/,modern.ini modern.zip classic080.ini)
|
2008-01-06 14:08:53 +00:00
|
|
|
|
|
|
|
# Engine data files
|
|
|
|
DIST_FILES_ENGINEDATA=
|
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
|
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
|
|
|
|
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
|