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 :=
|
2006-02-11 22:45:04 +00:00
|
|
|
INCLUDES := -I. -I$(srcdir) -I$(srcdir)/engines
|
2007-12-16 21:41:10 +00:00
|
|
|
LIBS :=
|
|
|
|
OBJS :=
|
|
|
|
DEPDIR := .deps
|
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 :=
|
|
|
|
|
2020-07-15 20:45:59 +00:00
|
|
|
# All game detection-related object files for engines
|
|
|
|
DETECT_OBJS :=
|
2020-08-25 08:30:45 +00:00
|
|
|
USE_RULES := 1
|
2020-07-15 20:45:59 +00:00
|
|
|
|
2003-08-10 06:56:53 +00:00
|
|
|
# Load the make rules generated by configure
|
2007-11-06 17:23:33 +00:00
|
|
|
-include config.mk
|
2009-09-25 12:11:27 +00:00
|
|
|
|
|
|
|
ifeq "$(HAVE_GCC)" "1"
|
|
|
|
CXXFLAGS:= -Wall $(CXXFLAGS)
|
|
|
|
# Turn off some annoying and not-so-useful warnings
|
|
|
|
CXXFLAGS+= -Wno-long-long -Wno-multichar -Wno-unknown-pragmas -Wno-reorder
|
|
|
|
# Enable even more warnings...
|
2010-07-01 23:12:45 +00:00
|
|
|
CXXFLAGS+= -Wpointer-arith -Wcast-qual
|
2011-03-29 18:34:26 +00:00
|
|
|
CXXFLAGS+= -Wshadow -Wnon-virtual-dtor -Wwrite-strings
|
2009-09-25 12:11:27 +00:00
|
|
|
|
|
|
|
# Currently we disable this gcc flag, since it will also warn in cases,
|
|
|
|
# where using GCC_PRINTF (means: __attribute__((format(printf, x, y))))
|
|
|
|
# is not possible, thus it would fail compiliation with -Werror without
|
|
|
|
# being helpful.
|
|
|
|
#CXXFLAGS+= -Wmissing-format-attribute
|
|
|
|
|
2020-08-01 12:42:45 +00:00
|
|
|
# Disable exceptions.
|
2013-10-23 21:45:29 +00:00
|
|
|
CXXFLAGS+= -fno-exceptions
|
2010-09-05 23:17:52 +00:00
|
|
|
|
|
|
|
ifneq "$(HAVE_CLANG)" "1"
|
|
|
|
# enable checking of pointers returned by "new", but only when we do not
|
|
|
|
# build with clang
|
|
|
|
CXXFLAGS+= -fcheck-new
|
|
|
|
endif
|
2009-09-25 12:11:27 +00:00
|
|
|
endif
|
2006-08-04 20:24:49 +00:00
|
|
|
|
2010-04-09 12:23:43 +00:00
|
|
|
ifeq "$(HAVE_CLANG)" "1"
|
|
|
|
CXXFLAGS+= -Wno-conversion -Wno-shorten-64-to-32 -Wno-sign-compare -Wno-four-char-constants
|
2013-07-01 14:28:19 +00:00
|
|
|
# We use a anonymous nested type declaration in an anonymous union in
|
|
|
|
# common/str.h. This is no standard construct and clang warns about it.
|
|
|
|
# It works for all our target systems though, thus we simply disable that
|
|
|
|
# warning.
|
|
|
|
CXXFLAGS+= -Wno-nested-anon-types
|
2010-04-09 12:23:43 +00:00
|
|
|
endif
|
|
|
|
|
2011-02-10 01:05:48 +00:00
|
|
|
ifeq "$(HAVE_ICC)" "1"
|
|
|
|
# Disable some warnings:
|
|
|
|
# 161: unrecognized #pragma
|
|
|
|
# 1899: multicharacter character literal (potential portability problem)
|
|
|
|
CXXFLAGS+= -diag-disable 161,1899
|
|
|
|
endif
|
|
|
|
|
2008-01-13 17:05:43 +00:00
|
|
|
#######################################################################
|
|
|
|
# Default commands - put the necessary replacements in config.mk #
|
|
|
|
#######################################################################
|
|
|
|
|
|
|
|
CAT ?= cat
|
|
|
|
CP ?= cp
|
|
|
|
ECHO ?= printf
|
|
|
|
INSTALL ?= install
|
|
|
|
MKDIR ?= mkdir -p
|
|
|
|
RM ?= rm -f
|
|
|
|
RM_REC ?= $(RM) -r
|
|
|
|
ZIP ?= zip -q
|
|
|
|
|
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
|
|
|
|
2011-02-06 14:29:22 +00:00
|
|
|
EXECUTABLE := $(EXEPRE)scummvm$(EXEEXT)
|
2004-02-01 01:32:43 +00:00
|
|
|
|
2004-01-30 21:54:28 +00:00
|
|
|
include $(srcdir)/Makefile.common
|
2002-04-27 11:06:27 +00:00
|
|
|
|
2013-11-07 11:58:33 +00:00
|
|
|
ENGINE_SUBDIRS_CONFIGURE := $(wildcard $(srcdir)/engines/*/configure.engine)
|
2018-11-16 17:21:57 +00:00
|
|
|
|
|
|
|
config.h:
|
|
|
|
SAVED_ENV_VARS = AR AS ASFLAGS CPPFLAGS CXX CXXFLAGS LD LDFLAGS RANLIB SDL_CONFIG STRIP WINDRES WINDRESFLAGS
|
|
|
|
|
|
|
|
# The environment variable PKG_CONFIG_LIBDIR has a different meaning
|
|
|
|
# for pkg-config when it is empty and when it is not defined.
|
|
|
|
# When PKG_CONFIG_LIBDIR is defined but empty, the .pc files cannot
|
|
|
|
# be found because the search path is empty.
|
|
|
|
# Here we make sure not to define PKG_CONFIG_LIBDIR when automatically
|
|
|
|
# running configure and it was not set for the previous run
|
|
|
|
# so pkg-config uses the system default search path for the .pc files.
|
|
|
|
ifneq ($(SAVED_PKG_CONFIG_LIBDIR),unset)
|
|
|
|
SAVED_ENV_VARS += PKG_CONFIG_LIBDIR
|
|
|
|
endif
|
|
|
|
|
|
|
|
# check if configure has been run or has been changed since last run
|
2013-11-07 11:58:34 +00:00
|
|
|
config.h: $(srcdir)/configure $(ENGINE_SUBDIRS_CONFIGURE)
|
2008-01-13 17:05:43 +00:00
|
|
|
ifeq "$(findstring config.mk,$(MAKEFILE_LIST))" "config.mk"
|
2007-11-06 17:23:33 +00:00
|
|
|
@echo "Running $(srcdir)/configure with the last specified parameters"
|
2009-03-20 22:16:57 +00:00
|
|
|
@sleep 2
|
2018-11-16 17:21:57 +00:00
|
|
|
|
|
|
|
$(foreach VAR,$(SAVED_ENV_VARS),$(VAR)="$(SAVED_$(VAR))") \
|
|
|
|
$(srcdir)/configure $(SAVED_CONFIGFLAGS)
|
2007-11-06 17:23:33 +00:00
|
|
|
else
|
|
|
|
$(error You need to run $(srcdir)/configure before you can run make. Check $(srcdir)/configure --help for a list of parameters)
|
|
|
|
endif
|
2003-08-10 07:34:58 +00:00
|
|
|
|
2013-11-07 11:58:34 +00:00
|
|
|
config.mk engines/plugins_table.h engines/engines.mk: config.h
|
|
|
|
@if test -f $@; then \
|
|
|
|
touch $@; \
|
|
|
|
else \
|
|
|
|
rm -f config.h; \
|
|
|
|
$(MAKE) config.h; \
|
|
|
|
fi
|
|
|
|
|
2009-09-27 14:59:40 +00:00
|
|
|
ifneq ($(origin port_mk), undefined)
|
|
|
|
include $(srcdir)/$(port_mk)
|
|
|
|
endif
|
2017-10-13 06:41:48 +00:00
|
|
|
|
2018-11-13 15:22:24 +00:00
|
|
|
.PHONY: print-dists print-executables print-version print-distversion
|
2017-10-13 06:41:48 +00:00
|
|
|
print-dists:
|
2019-07-02 21:49:03 +00:00
|
|
|
@echo $(DIST_FILES_DOCS) $(DIST_FILES_THEMES) $(DIST_FILES_NETWORKING) $(DIST_FILES_VKEYBD) $(DIST_FILES_ENGINEDATA) $(DIST_FILES_PLATFORM) $(srcdir)/doc
|
2017-10-13 06:41:48 +00:00
|
|
|
|
|
|
|
print-executables:
|
2017-10-28 17:20:02 +00:00
|
|
|
@echo $(if $(DIST_EXECUTABLES),$(DIST_EXECUTABLES),$(EXECUTABLE) $(PLUGINS))
|
2018-11-13 15:22:24 +00:00
|
|
|
|
|
|
|
print-version:
|
|
|
|
@echo $(VERSION)
|
|
|
|
|
|
|
|
print-distversion:
|
|
|
|
@echo $(DISTVERSION)
|