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 :=
|
|
|
|
|
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
|
|
|
|
|
2013-06-25 11:08:55 +00:00
|
|
|
ifneq "$(BACKEND)" "tizen"
|
2013-10-23 21:45:29 +00:00
|
|
|
# Disable exceptions. This setting causes tizen apps to crash
|
|
|
|
# TODO: Does this still apply after enabling RTTI again?
|
|
|
|
CXXFLAGS+= -fno-exceptions
|
2013-06-25 11:08:55 +00:00
|
|
|
endif
|
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
|
|
|
|
2003-08-10 07:47:47 +00:00
|
|
|
# check if configure has been run or has been changed since last run
|
2013-11-07 11:58:33 +00:00
|
|
|
ENGINE_SUBDIRS_CONFIGURE := $(wildcard $(srcdir)/engines/*/configure.engine)
|
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
|
2009-09-11 18:13:27 +00:00
|
|
|
LDFLAGS="$(SAVED_LDFLAGS)" CXX="$(SAVED_CXX)" \
|
|
|
|
CXXFLAGS="$(SAVED_CXXFLAGS)" CPPFLAGS="$(SAVED_CPPFLAGS)" \
|
|
|
|
ASFLAGS="$(SAVED_ASFLAGS)" WINDRESFLAGS="$(SAVED_WINDRESFLAGS)" \
|
2015-01-25 17:41:57 +00:00
|
|
|
SDL_CONFIG="$(SAVED_SDL_CONFIG)" \
|
2009-09-11 18:13:27 +00:00
|
|
|
$(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
|