2008-02-25 14:09:04 +00:00
|
|
|
# $URL$
|
2006-02-11 13:27:07 +00:00
|
|
|
# $Id$
|
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
|
2009-09-25 12:11:27 +00:00
|
|
|
CXXFLAGS+= -Wshadow -Wimplicit -Wnon-virtual-dtor -Wwrite-strings
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2010-09-05 23:17:52 +00:00
|
|
|
# Disable RTTI and exceptions
|
|
|
|
CXXFLAGS+= -fno-rtti -fno-exceptions
|
|
|
|
|
|
|
|
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
|
|
|
|
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
|
|
|
|
|
2010-08-11 13:29:49 +00:00
|
|
|
# Warn if global constructors are used. Only available in GCC with LLVM backend
|
|
|
|
# (and maybe clang?), hence off by default.
|
|
|
|
#CXXFLAGS+= -Wglobal-constructors
|
|
|
|
|
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
|
|
|
|
2004-02-01 01:32:43 +00:00
|
|
|
EXECUTABLE := scummvm$(EXEEXT)
|
|
|
|
|
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
|
2008-01-13 17:05:43 +00:00
|
|
|
config.h config.mk: $(srcdir)/configure
|
|
|
|
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)" \
|
|
|
|
$(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
|
|
|
|
2009-09-27 14:59:40 +00:00
|
|
|
ifneq ($(origin port_mk), undefined)
|
|
|
|
include $(srcdir)/$(port_mk)
|
|
|
|
endif
|
|
|
|
|