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
|
|
|
#
|
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
|
|
|
######################################################################
|
|
|
|
|
2018-12-19 01:09:09 +00:00
|
|
|
all: $(EXECUTABLE) plugins
|
2002-04-26 13:39:31 +00:00
|
|
|
|
2017-11-01 22:15:35 +00:00
|
|
|
ifdef SPLIT_DWARF
|
|
|
|
all: $(EXECUTABLE).dwp
|
|
|
|
endif
|
2003-09-08 15:33:26 +00:00
|
|
|
|
2018-12-19 01:09:09 +00:00
|
|
|
ifdef USE_PANDOC
|
2020-04-26 14:35:34 +00:00
|
|
|
all: PANDOC_CONVERT
|
2018-12-19 01:09:09 +00:00
|
|
|
endif
|
|
|
|
|
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 :=
|
2011-04-09 21:47:35 +00:00
|
|
|
MODULES := test devtools base $(MODULES)
|
2003-09-17 22:41:01 +00:00
|
|
|
|
2013-11-07 11:58:34 +00:00
|
|
|
-include 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 += \
|
2020-02-16 15:45:46 +00:00
|
|
|
engines \
|
2003-03-07 16:21:28 +00:00
|
|
|
gui \
|
2009-01-30 04:04:10 +00:00
|
|
|
backends \
|
2011-01-23 17:14:43 +00:00
|
|
|
video \
|
2014-02-28 02:27:23 +00:00
|
|
|
image \
|
2017-05-12 17:44:44 +00:00
|
|
|
graphics \
|
2011-02-09 01:09:01 +00:00
|
|
|
audio \
|
2011-09-10 15:46:07 +00:00
|
|
|
math \
|
2009-01-30 03:35:47 +00:00
|
|
|
common \
|
2020-10-05 00:48:22 +00:00
|
|
|
po \
|
|
|
|
doc
|
2002-07-06 13:05:42 +00:00
|
|
|
|
2004-11-06 01:41:32 +00:00
|
|
|
ifdef USE_MT32EMU
|
2011-02-09 01:09:01 +00:00
|
|
|
MODULES += audio/softsynth/mt32
|
2004-11-06 01:41:32 +00:00
|
|
|
endif
|
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
|
|
|
|
2020-08-25 12:19:36 +00:00
|
|
|
# Store original info
|
|
|
|
MODULES_ORIG:= $(MODULES)
|
|
|
|
MODULE_DIRS_ORIG := $(MODULE_DIRS)
|
|
|
|
KYRARPG_COMMON_OBJ_ORIG := $(KYRARPG_COMMON_OBJ)
|
|
|
|
|
2020-09-30 06:38:18 +00:00
|
|
|
# Skip rules for these files, by resetting the LOAD_RULES_MK
|
|
|
|
LOAD_RULES_MK :=
|
2020-08-25 12:19:36 +00:00
|
|
|
|
2020-12-06 14:28:08 +00:00
|
|
|
ifdef DETECTION_FULL
|
2020-08-25 12:19:36 +00:00
|
|
|
# Reset detection objects, which uptill now are filled with only
|
|
|
|
# enabled engines.
|
|
|
|
DETECT_OBJS :=
|
|
|
|
|
|
|
|
# Include all engine's module files, which populate DETECT_OBJS
|
|
|
|
-include $(srcdir)/engines/*/module.mk
|
2020-12-06 14:28:08 +00:00
|
|
|
endif
|
2020-08-25 12:19:36 +00:00
|
|
|
|
|
|
|
# Reset stuff
|
|
|
|
MODULES := $(MODULES_ORIG)
|
|
|
|
MODULE :=
|
|
|
|
MODULE_OBJS :=
|
|
|
|
MODULE_DIRS := $(MODULE_DIRS_ORIG)
|
|
|
|
PLUGIN :=
|
|
|
|
KYRARPG_COMMON_OBJ := $(KYRARPG_COMMON_OBJ_ORIG)
|
|
|
|
|
|
|
|
# Enable-rules again
|
2020-09-30 06:38:18 +00:00
|
|
|
LOAD_RULES_MK := 1
|
2020-08-25 12:19:36 +00:00
|
|
|
|
2020-09-30 06:41:05 +00:00
|
|
|
ifneq ($(DETECTION_STATIC), 1)
|
2020-12-04 22:20:38 +00:00
|
|
|
-include $(srcdir)/base/detection/module.mk
|
2020-10-03 16:52:39 +00:00
|
|
|
else
|
|
|
|
MODULE_DIRS += $(sort $(dir $(DETECT_OBJS)))
|
2020-08-25 14:06:22 +00:00
|
|
|
endif
|
|
|
|
|
2003-09-19 21:23:23 +00:00
|
|
|
# Depdir information
|
2021-04-06 19:17:08 +00:00
|
|
|
DEPDIRS = $(addsuffix $(DEPDIR),$(MODULE_DIRS)) dists/$(DEPDIR)
|
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
|
|
|
|
2010-09-15 07:44:08 +00:00
|
|
|
ifdef USE_ELF_LOADER
|
|
|
|
backends/plugins/elf/version.o: $(filter-out base/libbase.a,$(filter-out backends/libbackends.a,$(OBJS)))
|
|
|
|
endif
|
|
|
|
|
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)
|
2014-01-10 22:53:29 +00:00
|
|
|
QUIET_CC = @echo ' ' C ' ' $@;
|
2011-05-05 18:24:57 +00:00
|
|
|
QUIET_CXX = @echo ' ' C++ ' ' $@;
|
|
|
|
QUIET_AS = @echo ' ' AS ' ' $@;
|
|
|
|
QUIET_NASM = @echo ' ' NASM ' ' $@;
|
2018-12-18 06:14:15 +00:00
|
|
|
QUIET_PANDOC = @echo ' ' PANDOC ' ' $@;
|
2011-05-05 18:24:57 +00:00
|
|
|
QUIET_AR = @echo ' ' AR ' ' $@;
|
|
|
|
QUIET_RANLIB = @echo ' ' RANLIB ' ' $@;
|
|
|
|
QUIET_PLUGIN = @echo ' ' PLUGIN ' ' $@;
|
|
|
|
QUIET_LINK = @echo ' ' LINK ' ' $@;
|
2017-11-01 22:15:35 +00:00
|
|
|
QUIET_DWP = @echo ' ' DWP ' ' $@;
|
2011-05-05 18:24:57 +00:00
|
|
|
QUIET_WINDRES = @echo ' ' WINDRES '' $@;
|
|
|
|
QUIET = @
|
2009-08-22 11:03:00 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2003-09-17 22:41:01 +00:00
|
|
|
# The build rule for the ScummVM executable
|
2020-10-04 20:07:59 +00:00
|
|
|
$(EXECUTABLE): $(DETECT_OBJS) $(OBJS)
|
2021-01-10 10:14:30 +00:00
|
|
|
+$(QUIET_LINK)$(LD) $(LDFLAGS) $(PRE_OBJS_FLAGS) $+ $(POST_OBJS_FLAGS) $(LIBS) -o $@
|
2002-07-06 13:05:42 +00:00
|
|
|
|
2017-11-01 22:15:35 +00:00
|
|
|
ifdef SPLIT_DWARF
|
|
|
|
$(EXECUTABLE).dwp: $(EXECUTABLE)
|
|
|
|
$(QUIET_DWP)$(DWP) -e $(EXECUTABLE)
|
|
|
|
endif
|
|
|
|
|
2013-05-15 12:42:08 +00:00
|
|
|
distclean: clean clean-devtools
|
2021-08-23 12:53:46 +00:00
|
|
|
$(RM) config.h config.mk config.log configure.stamp engines/engines.mk engines/detection_table.h engines/plugins_table.h
|
2003-09-19 21:23:23 +00:00
|
|
|
|
2020-12-12 19:38:57 +00:00
|
|
|
clean: clean-toplevel
|
|
|
|
clean-toplevel:
|
2008-02-17 18:30:18 +00:00
|
|
|
$(RM_REC) $(DEPDIRS)
|
2020-07-15 20:45:59 +00:00
|
|
|
$(RM) $(OBJS) $(DETECT_OBJS) $(EXECUTABLE)
|
2017-11-01 22:15:35 +00:00
|
|
|
ifdef SPLIT_DWARF
|
2020-11-09 07:01:04 +00:00
|
|
|
$(RM) $(OBJS:.o=.dwo) $(DETECT_OBJS:.o=.dwo)
|
2017-11-01 22:15:35 +00:00
|
|
|
$(RM) $(EXECUTABLE).dwp
|
|
|
|
endif
|
2002-07-06 13:05:42 +00:00
|
|
|
|
2009-09-25 12:11:27 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# The build rules for object files.
|
|
|
|
#
|
|
|
|
|
2021-04-03 21:02:34 +00:00
|
|
|
base/plugins.o: config.mk
|
|
|
|
|
2009-09-25 12:11:27 +00:00
|
|
|
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.
|
2014-01-10 22:53:29 +00:00
|
|
|
%.o: %.c
|
|
|
|
$(QUIET)$(MKDIR) $(*D)/$(DEPDIR)
|
2021-03-30 12:28:00 +00:00
|
|
|
$(QUIET_CC)$(CC) $(CXX_UPDATE_DEP_FLAG) $(CFLAGS) $(CPPFLAGS) -c $(<) -o $@
|
2008-01-13 17:05:43 +00:00
|
|
|
%.o: %.cpp
|
2009-08-22 11:03:00 +00:00
|
|
|
$(QUIET)$(MKDIR) $(*D)/$(DEPDIR)
|
2021-03-30 12:28:00 +00:00
|
|
|
$(QUIET_CXX)$(CXX) $(CXX_UPDATE_DEP_FLAG) $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $@
|
2009-09-25 12:11:27 +00:00
|
|
|
|
2009-12-26 13:35:57 +00:00
|
|
|
|
|
|
|
# Build rules for Objective-C and Objective-C++ files. Strictly speaking, this is for OS X only.
|
|
|
|
%.o: %.mm
|
|
|
|
$(QUIET)$(MKDIR) $(*D)/$(DEPDIR)
|
2021-03-30 12:28:00 +00:00
|
|
|
$(QUIET_CXX)$(CXX) $(CXX_UPDATE_DEP_FLAG) $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $@
|
2009-12-26 13:35:57 +00:00
|
|
|
|
2008-01-13 17:05:43 +00:00
|
|
|
%.o: %.m
|
2009-08-22 11:03:00 +00:00
|
|
|
$(QUIET)$(MKDIR) $(*D)/$(DEPDIR)
|
2021-03-30 12:28:00 +00:00
|
|
|
$(QUIET_CXX)$(CXX) $(CXX_UPDATE_DEP_FLAG) $(CPPFLAGS) $(OBJCFLAGS) -c $(<) -o $@
|
2009-09-25 12:11:27 +00:00
|
|
|
|
2010-03-09 00:45:24 +00:00
|
|
|
# Build rule for assembler files with preprocessing
|
|
|
|
%.o: %.S
|
|
|
|
$(QUIET)$(MKDIR) $(*D)/$(DEPDIR)
|
2021-03-30 12:28:00 +00:00
|
|
|
$(QUIET_AS)$(CXX) $(CXX_UPDATE_DEP_FLAG) $(ASFLAGS) -c $(<) -o $@
|
2010-03-09 00:45:24 +00:00
|
|
|
|
2019-11-24 17:28:37 +00:00
|
|
|
base/version.o: base/version.cpp
|
|
|
|
$(QUIET)$(MKDIR) $(*D)/$(DEPDIR)
|
2021-03-30 12:28:00 +00:00
|
|
|
$(QUIET_CXX)$(CXX) $(CXX_UPDATE_DEP_FLAG) $(CXXFLAGS) $(VERFLAGS) $(CPPFLAGS) -c $(<) -o $@
|
2019-11-24 17:28:37 +00:00
|
|
|
|
2009-09-25 12:11:27 +00:00
|
|
|
else
|
|
|
|
|
|
|
|
# Dumb compile rule, for C++ compilers that don't allow dependency tracking or
|
|
|
|
# where it is broken (such as GCC 2.95).
|
2021-03-30 12:28:00 +00:00
|
|
|
%.o: %.cpp
|
2010-03-09 00:43:31 +00:00
|
|
|
$(QUIET)$(MKDIR) $(*D)
|
2021-03-30 12:28:00 +00:00
|
|
|
$(QUIET_CXX)$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $@
|
2009-09-25 12:11:27 +00:00
|
|
|
|
2010-03-09 00:45:24 +00:00
|
|
|
# Build rule for assembler files with preprocessing
|
|
|
|
%.o: %.S
|
|
|
|
$(QUIET)$(MKDIR) $(*D)
|
2021-03-30 12:28:00 +00:00
|
|
|
$(QUIET_AS)$(CXX) $(ASFLAGS) -c $(<) -o $@
|
2010-03-09 00:45:24 +00:00
|
|
|
|
2019-11-24 17:28:37 +00:00
|
|
|
base/version.o: base/version.cpp
|
|
|
|
$(QUIET)$(MKDIR) $(*D)
|
2021-03-30 12:28:00 +00:00
|
|
|
$(QUIET_CXX)$(CXX) $(CXXFLAGS) $(VERFLAGS) $(CPPFLAGS) -c $(<) -o $@
|
2003-08-02 09:21:34 +00:00
|
|
|
endif
|
2002-08-21 16:53:11 +00:00
|
|
|
|
2009-11-18 23:34:40 +00:00
|
|
|
# Build rule for assembler files
|
2009-08-22 16:30:20 +00:00
|
|
|
%.o: %.s
|
2009-10-04 23:21:01 +00:00
|
|
|
$(QUIET)$(MKDIR) $(*D)
|
2021-03-30 12:28:00 +00:00
|
|
|
$(QUIET_AS)$(AS) $(ASFLAGS) $(<) -o $@
|
2009-08-22 16:30:20 +00:00
|
|
|
|
2018-12-15 00:11:05 +00:00
|
|
|
# Build rule for Windows resource files
|
2021-04-06 19:17:08 +00:00
|
|
|
# The regular expression is a portable form of ^(.*\s(FILE|ICON|RT_MANIFEST|DATA)|#include)\s+"([^"]*)".*$
|
|
|
|
# This finds lines in the form '... FILE "path/file.ext" ...' (and also ICON and #include)
|
|
|
|
# and replaces them with the $(srcdir)/path/file.ext \
|
|
|
|
# The second sed removes winresrc.h (system include) and config.h (not in srcdir, printed
|
|
|
|
# by the echo before sed), and strips the trailing backslash on the last line.
|
2018-12-15 00:11:05 +00:00
|
|
|
%.o: %.rc
|
|
|
|
$(QUIET)$(MKDIR) $(*D)
|
2021-04-06 19:17:08 +00:00
|
|
|
$(QUIET)$(MKDIR) $(*D)/$(DEPDIR)
|
|
|
|
$(QUIET)echo "$@: $< config.h config.mk \\" > $(*D)/$(DEPDIR)/scummvm.d
|
|
|
|
$(QUIET)sed -n 's:^\(.*[[:space:]]\(FILE\|ICON\|RT_MANIFEST\|DATA\)\|#include\)[[:space:]][[:space:]]*"\([^"]*\)".*$$: $(srcdir)/\3 \\:p; ' $(<) | \
|
|
|
|
sed '/winresrc\.h\|config\.h/d; $$ s/ \\//' >> $(*D)/$(DEPDIR)/scummvm.d
|
2021-03-30 12:28:00 +00:00
|
|
|
$(QUIET_WINDRES)$(WINDRES) $(WINDRESFLAGS) $(CPPFLAGS) $(<) -o $@
|
2018-12-15 00:11:05 +00:00
|
|
|
|
2010-03-08 23:56:59 +00:00
|
|
|
ifdef USE_NASM
|
2009-11-18 23:35:50 +00:00
|
|
|
# Build rule for NASM assembler files
|
2008-01-13 17:05:43 +00:00
|
|
|
%.o: %.asm
|
2009-10-04 23:21:01 +00:00
|
|
|
$(QUIET)$(MKDIR) $(*D)
|
2021-03-30 12:28:00 +00:00
|
|
|
$(QUIET_NASM)$(NASM) $(NASMFLAGS) -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-11-18 23:34:40 +00:00
|
|
|
# Mark *.d files and most *.mk files as PHONY. This stops make from trying to
|
|
|
|
# recreate them (which it can't), and in particular from looking for potential
|
|
|
|
# source files. This can save quite a bit of disk access time.
|
2009-10-28 13:43:57 +00:00
|
|
|
.PHONY: $(wildcard $(addsuffix /*.d,$(DEPDIRS))) $(addprefix $(srcdir)/, $(addsuffix /module.mk,$(MODULES))) \
|
2013-11-07 11:58:34 +00:00
|
|
|
$(srcdir)/$(port_mk) $(srcdir)/rules.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
|
|
|
######################################################################
|
|
|
|
|
2020-11-26 14:10:01 +00:00
|
|
|
# AmigaOS grep command has a problem with "./" in pathnames, so use cat piped into grep instead.
|
2012-03-04 01:26:57 +00:00
|
|
|
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-)
|
|
|
|
|
2016-09-10 20:32:37 +00:00
|
|
|
ifdef AMIGAOS
|
2020-11-26 14:10:01 +00:00
|
|
|
# AmigaOS needs the date in a specific format for the version cookie.
|
2016-09-10 20:19:32 +00:00
|
|
|
AMIGA_DATE = $(shell gdate '+%d.%m.%Y')
|
2019-11-24 17:28:37 +00:00
|
|
|
VERFLAGS += -DAMIGA_DATE=\"$(AMIGA_DATE)\"
|
2016-09-10 20:32:37 +00:00
|
|
|
endif
|
2020-08-07 17:22:13 +00:00
|
|
|
ifdef MORPHOS
|
2020-11-26 14:10:01 +00:00
|
|
|
# MorphOS needs the date in a specific format for the version cookie.
|
2020-08-07 17:22:13 +00:00
|
|
|
AMIGA_DATE = $(shell date +"%-d.%-m.%Y")
|
|
|
|
VERFLAGS += -DAMIGA_DATE=\"$(AMIGA_DATE)\"
|
|
|
|
endif
|
2009-03-19 18:39:47 +00:00
|
|
|
|
|
|
|
######################################################################
|
2011-02-12 17:54:19 +00:00
|
|
|
# Get git's working copy information
|
2009-03-19 18:39:47 +00:00
|
|
|
######################################################################
|
|
|
|
|
2011-02-12 17:54:19 +00:00
|
|
|
ifneq ($(shell cd $(srcdir); git rev-parse --verify HEAD 1>/dev/null 2>&1 || echo "error"),error)
|
|
|
|
GITROOT := $(srcdir)
|
2011-02-12 16:43:57 +00:00
|
|
|
ifeq ($(origin VER_REV), undefined)
|
2021-03-09 11:49:22 +00:00
|
|
|
GIT_VER_MAJOR = $(shell git --version | sed 's/^git version //' | cut -d. -f 1)
|
2011-02-12 18:18:50 +00:00
|
|
|
# Are there uncommitted changes? (describe --dirty is only available since 1.6.6)
|
2021-03-09 11:49:22 +00:00
|
|
|
ifeq ($(GIT_VER_MAJOR),1)
|
2011-02-12 18:18:50 +00:00
|
|
|
VER_DIRTY := $(shell cd $(srcdir); git update-index --refresh --unmerged 1>/dev/null 2>&1; git diff-index --quiet HEAD || echo "-dirty")
|
2021-03-09 11:49:22 +00:00
|
|
|
else
|
|
|
|
GIT_DIRTY_FLAG = --dirty
|
|
|
|
endif
|
2009-03-19 18:39:47 +00:00
|
|
|
# Get the working copy base revision
|
2021-03-09 11:49:22 +00:00
|
|
|
VER_REV := $(shell cd $(srcdir); git describe $(GIT_DIRTY_FLAG) --long --match desc/\* | cut -d '-' -f 2-)$(VER_DIRTY)
|
2009-03-19 18:39:47 +00:00
|
|
|
endif
|
|
|
|
else
|
2011-02-12 17:54:19 +00:00
|
|
|
GITROOT := git://github.com/scummvm/scummvm.git
|
2009-03-19 18:39:47 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
# Define the Subversion revision if available, either autodetected or
|
2010-08-11 12:50:18 +00:00
|
|
|
# specified by the user, but only for base/version.cpp.
|
2011-02-12 16:43:57 +00:00
|
|
|
ifneq ($(origin VER_REV), undefined)
|
2019-11-24 17:28:37 +00:00
|
|
|
VERFLAGS += -DSCUMMVM_REVISION=\"$(VER_REV)\"
|
2009-03-19 18:39:47 +00:00
|
|
|
endif
|
|
|
|
|
2007-12-16 21:41:10 +00:00
|
|
|
######################################################################
|
|
|
|
# Distribution settings
|
|
|
|
######################################################################
|
|
|
|
|
2011-02-12 17:54:19 +00:00
|
|
|
ifeq ($(VER_EXTRA),git)
|
2011-02-12 16:43:57 +00:00
|
|
|
ifeq ($(origin VER_REV), undefined)
|
2007-12-16 21:41:10 +00:00
|
|
|
DISTVERSION = $(shell date '+%Y-%m-%d')
|
|
|
|
else
|
2011-02-12 17:54:19 +00:00
|
|
|
DISTVERSION = git$(VER_REV)
|
2009-03-19 19:42:22 +00:00
|
|
|
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
|
|
|
|
|
2018-12-19 01:09:09 +00:00
|
|
|
ifdef USE_PANDOC
|
2019-03-20 18:26:38 +00:00
|
|
|
# Convert README.md and NEWS.md to plain text for any platform that might require it
|
2020-04-26 14:35:34 +00:00
|
|
|
PANDOC_CONVERT: README$(PANDOCEXT) CONTRIBUTING$(PANDOCEXT) NEWS$(PANDOCEXT) doc/de/NEUES$(PANDOCEXT)
|
|
|
|
@sed -i'' -e "s/NEWS.md/NEWS$(PANDOCEXT)/g" README$(PANDOCEXT)
|
|
|
|
@sed -i'' -e "s/CONTRIBUTING.md/CONTRIBUTING$(PANDOCEXT)/g" README$(PANDOCEXT)
|
|
|
|
|
2019-05-18 13:02:25 +00:00
|
|
|
%$(PANDOCEXT): %.md
|
2019-05-18 12:03:43 +00:00
|
|
|
$(QUIET)$(MKDIR) $(*D)
|
|
|
|
$(QUIET_PANDOC)$(PANDOC) -f gfm -t $(PANDOCFORMAT) --metadata pagetitle=$(basename $(notdir $@)) -s -o $@ $<
|
2018-12-19 01:09:09 +00:00
|
|
|
endif
|
2018-12-18 06:14:15 +00:00
|
|
|
|
2011-02-12 17:54:19 +00:00
|
|
|
# TODO git via $(GITROOT)
|
2007-12-16 21:41:10 +00:00
|
|
|
$(VERFILE): $(srcdir)/base/internal_version.h
|
|
|
|
@$(RM_REC) $(DISTDIR)
|
|
|
|
@$(MKDIR) $(DISTDIR)
|
|
|
|
svn export $(SVNROOT) $(DISTDIR)/$(DISTNAME)
|
2011-02-12 16:43:57 +00:00
|
|
|
ifneq ($(origin VER_REV), undefined)
|
2009-03-19 19:42:22 +00:00
|
|
|
@# Use the current SVN revision as a default for the snapshot sources
|
|
|
|
@svn cat $(SVNROOT)/base/internal_version.h | sed -e \
|
2011-02-12 16:43:57 +00:00
|
|
|
"s/^#define SCUMMVM_REVISION$$/#define SCUMMVM_REVISION \"$(VER_REV)\"/g" \
|
2009-03-19 19:42:22 +00:00
|
|
|
> $(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
|
2020-10-04 14:10:09 +00:00
|
|
|
DIST_FILES_DOCS:=$(addprefix $(srcdir)/,AUTHORS COPYING COPYING.BSD COPYING.LGPL COPYING.FREEFONT COPYING.OFL COPYING.ISC COPYING.LUA COPYING.MIT COPYING.TINYGL COPYRIGHT NEWS.md README.md CONTRIBUTING.md)
|
2018-12-18 06:14:15 +00:00
|
|
|
ifdef USE_PANDOC
|
2020-04-26 14:35:01 +00:00
|
|
|
DIST_FILES_DOCS+=README$(PANDOCEXT) NEWS$(PANDOCEXT) CONTRIBUTING$(PANDOCEXT)
|
2018-12-18 06:14:15 +00:00
|
|
|
endif
|
2008-01-06 14:08:53 +00:00
|
|
|
|
2018-06-15 21:48:31 +00:00
|
|
|
DIST_FILES_DOCS_languages=cz da de es fr it no-nb se
|
|
|
|
DIST_FILES_DOCS_cz:=$(addprefix $(srcdir)/doc/cz/,PrectiMe)
|
|
|
|
DIST_FILES_DOCS_da:=$(addprefix $(srcdir)/doc/da/,HurtigStart)
|
2019-05-18 12:03:43 +00:00
|
|
|
DIST_FILES_DOCS_de:=$(addprefix $(srcdir)/doc/de/,LIESMICH NEUES.md Schnellstart)
|
|
|
|
ifdef USE_PANDOC
|
|
|
|
DIST_FILES_DOCS_de+=doc/de/NEUES$(PANDOCEXT)
|
|
|
|
endif
|
2018-06-15 21:48:31 +00:00
|
|
|
DIST_FILES_DOCS_es:=$(addprefix $(srcdir)/doc/es/,InicioRapido)
|
|
|
|
DIST_FILES_DOCS_fr:=$(addprefix $(srcdir)/doc/fr/,DemarrageRapide)
|
|
|
|
DIST_FILES_DOCS_it:=$(addprefix $(srcdir)/doc/it/,GuidaRapida)
|
|
|
|
DIST_FILES_DOCS_no-nb:=$(addprefix $(srcdir)/doc/no-nb/,HurtigStart)
|
|
|
|
DIST_FILES_DOCS_se:=$(addprefix $(srcdir)/doc/se/,LasMig Snabbstart)
|
|
|
|
|
2008-01-06 14:08:53 +00:00
|
|
|
# Themes files
|
2020-10-09 17:04:07 +00:00
|
|
|
DIST_FILES_THEMES=scummmodern.zip scummclassic.zip scummremastered.zip residualvm.zip
|
2010-08-19 11:46:55 +00:00
|
|
|
ifdef USE_TRANSLATION
|
|
|
|
DIST_FILES_THEMES+=translations.dat
|
|
|
|
endif
|
|
|
|
DIST_FILES_THEMES:=$(addprefix $(srcdir)/gui/themes/,$(DIST_FILES_THEMES))
|
2008-01-06 14:08:53 +00:00
|
|
|
|
2016-09-05 22:39:34 +00:00
|
|
|
# Networking files
|
|
|
|
DIST_FILES_NETWORKING=
|
|
|
|
ifdef USE_SDL_NET
|
2016-09-05 23:43:25 +00:00
|
|
|
DIST_FILES_NETWORKING:=$(addprefix $(srcdir)/dists/networking/,wwwroot.zip)
|
2016-09-05 22:39:34 +00:00
|
|
|
endif
|
|
|
|
|
2019-07-02 21:49:03 +00:00
|
|
|
# Virtual keyboard files
|
|
|
|
DIST_FILES_VKEYBD=
|
|
|
|
ifdef ENABLE_VKEYBD
|
|
|
|
DIST_FILES_VKEYBD:=$(addprefix $(srcdir)/backends/vkeybd/packs/,vkeybd_default.zip vkeybd_small.zip)
|
|
|
|
endif
|
|
|
|
|
2008-01-06 14:08:53 +00:00
|
|
|
# Engine data files
|
|
|
|
DIST_FILES_ENGINEDATA=
|
2015-11-29 11:49:50 +00:00
|
|
|
ifdef ENABLE_ACCESS
|
|
|
|
DIST_FILES_ENGINEDATA+=access.dat
|
|
|
|
endif
|
2017-02-12 20:25:01 +00:00
|
|
|
ifdef ENABLE_CRYO
|
2017-02-12 20:18:49 +00:00
|
|
|
DIST_FILES_ENGINEDATA+=cryo.dat
|
|
|
|
endif
|
2019-06-23 07:31:37 +00:00
|
|
|
ifdef ENABLE_CRYOMNI3D
|
|
|
|
DIST_FILES_ENGINEDATA+=cryomni3d.dat
|
|
|
|
endif
|
2008-06-09 12:23:56 +00:00
|
|
|
ifdef ENABLE_DRASCULA
|
|
|
|
DIST_FILES_ENGINEDATA+=drascula.dat
|
|
|
|
endif
|
2020-12-09 23:07:34 +00:00
|
|
|
ifdef ENABLE_HADESCH
|
|
|
|
DIST_FILES_ENGINEDATA+=hadesch_translations.dat
|
|
|
|
endif
|
2010-08-17 09:28:20 +00:00
|
|
|
ifdef ENABLE_HUGO
|
|
|
|
DIST_FILES_ENGINEDATA+=hugo.dat
|
|
|
|
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
|
2020-09-02 19:24:06 +00:00
|
|
|
ifdef ENABLE_MACVENTURE
|
|
|
|
DIST_FILES_ENGINEDATA+=macventure.dat
|
|
|
|
endif
|
2013-07-04 21:46:52 +00:00
|
|
|
ifdef ENABLE_MORTEVIELLE
|
|
|
|
DIST_FILES_ENGINEDATA+=mort.dat
|
|
|
|
endif
|
2013-05-20 09:49:23 +00:00
|
|
|
ifdef ENABLE_NEVERHOOD
|
|
|
|
DIST_FILES_ENGINEDATA+=neverhood.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
|
2018-01-23 22:50:39 +00:00
|
|
|
ifdef ENABLE_SUPERNOVA
|
|
|
|
DIST_FILES_ENGINEDATA+=supernova.dat
|
|
|
|
endif
|
2009-09-05 08:24:36 +00:00
|
|
|
ifdef ENABLE_TEENAGENT
|
|
|
|
DIST_FILES_ENGINEDATA+=teenagent.dat
|
|
|
|
endif
|
2017-07-02 21:08:26 +00:00
|
|
|
ifdef ENABLE_TITANIC
|
|
|
|
DIST_FILES_ENGINEDATA+=titanic.dat
|
|
|
|
endif
|
2013-06-05 20:32:32 +00:00
|
|
|
ifdef ENABLE_TONY
|
|
|
|
DIST_FILES_ENGINEDATA+=tony.dat
|
|
|
|
endif
|
2010-10-10 11:40:16 +00:00
|
|
|
ifdef ENABLE_TOON
|
|
|
|
DIST_FILES_ENGINEDATA+=toon.dat
|
|
|
|
endif
|
2020-02-02 21:34:58 +00:00
|
|
|
ifdef ENABLE_ULTIMA
|
|
|
|
DIST_FILES_ENGINEDATA+=ultima.dat
|
|
|
|
endif
|
2013-01-28 08:19:57 +00:00
|
|
|
ifdef ENABLE_WINTERMUTE
|
|
|
|
DIST_FILES_ENGINEDATA+=wintermute.zip
|
|
|
|
endif
|
2018-02-20 23:50:17 +00:00
|
|
|
ifdef ENABLE_XEEN
|
|
|
|
DIST_FILES_ENGINEDATA+=xeen.ccs
|
|
|
|
endif
|
2018-12-09 13:10:39 +00:00
|
|
|
ifdef USE_FREETYPE2
|
|
|
|
DIST_FILES_ENGINEDATA+=fonts.dat
|
|
|
|
endif
|
2020-09-02 19:24:06 +00:00
|
|
|
DIST_FILES_ENGINEDATA+=macgui.dat
|
2012-01-28 09:44:25 +00:00
|
|
|
ifdef ENABLE_GRIM
|
2020-11-01 13:10:09 +00:00
|
|
|
DIST_FILES_ENGINEDATA+=grim-patch.lab
|
2012-01-28 09:44:25 +00:00
|
|
|
endif
|
2013-10-06 13:40:14 +00:00
|
|
|
ifdef ENABLE_MONKEY4
|
2020-11-01 13:10:09 +00:00
|
|
|
DIST_FILES_ENGINEDATA+=monkey4-patch.m4b
|
2013-10-06 13:40:14 +00:00
|
|
|
endif
|
2016-08-21 07:24:35 +00:00
|
|
|
ifdef ENABLE_MYST3
|
|
|
|
DIST_FILES_ENGINEDATA+=myst3.dat
|
|
|
|
endif
|
2021-06-04 00:52:44 +00:00
|
|
|
DIST_FILES_ENGINEDATA+=achievements.dat
|
2020-11-15 15:20:35 +00:00
|
|
|
DIST_FILES_ENGINEDATA+=encoding.dat
|
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
|
|
|
|
|
2020-10-12 16:26:41 +00:00
|
|
|
# Shaders: install if USE_OPENGL_SHADERS or USE_GLES2 defined
|
2012-12-06 21:47:48 +00:00
|
|
|
DIST_FILES_SHADERS=
|
2020-10-12 16:26:41 +00:00
|
|
|
ifneq ($(USE_OPENGL_SHADERS)$(USE_GLES2),)
|
2014-01-30 22:41:26 +00:00
|
|
|
ifdef ENABLE_GRIM
|
2012-12-06 21:47:48 +00:00
|
|
|
DIST_FILES_SHADERS+=$(wildcard $(srcdir)/engines/grim/shaders/*)
|
|
|
|
endif
|
2014-01-13 23:42:06 +00:00
|
|
|
ifdef ENABLE_MYST3
|
|
|
|
DIST_FILES_SHADERS+=$(wildcard $(srcdir)/engines/myst3/shaders/*)
|
|
|
|
endif
|
2016-01-05 17:49:19 +00:00
|
|
|
ifdef ENABLE_STARK
|
|
|
|
DIST_FILES_SHADERS+=$(wildcard $(srcdir)/engines/stark/shaders/*)
|
|
|
|
endif
|
2020-09-20 20:12:38 +00:00
|
|
|
ifdef ENABLE_WINTERMUTE
|
|
|
|
DIST_FILES_SHADERS+=$(wildcard $(srcdir)/engines/wintermute/base/gfx/opengl/shaders/*)
|
|
|
|
endif
|
2014-01-30 22:41:26 +00:00
|
|
|
endif
|
2012-12-06 21:47:48 +00:00
|
|
|
|
2020-12-12 19:38:57 +00:00
|
|
|
.PHONY: all clean distclean plugins dist-src clean-toplevel
|