2006-02-11 13:27:07 +00:00
|
|
|
# $Id$
|
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.
|
2002-04-26 13:39:31 +00:00
|
|
|
|
2003-09-08 15:33:26 +00:00
|
|
|
######################################################################
|
2002-11-21 04:08:37 +00:00
|
|
|
# The defaul build target: just build the scummvm executable
|
2003-09-08 15:33:26 +00:00
|
|
|
######################################################################
|
2005-01-11 22:02:05 +00:00
|
|
|
all: $(EXECUTABLE) plugins
|
2002-11-21 04:08:37 +00:00
|
|
|
|
2003-09-08 15:33:26 +00:00
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# Various minor settings
|
|
|
|
######################################################################
|
|
|
|
|
2002-11-21 04:08:37 +00:00
|
|
|
# Files that are to be included in the archive built by "make dist"
|
|
|
|
DISTFILES := \
|
2004-04-16 06:56:28 +00:00
|
|
|
Makefile Makefile.common \
|
2006-12-07 11:31:53 +00:00
|
|
|
AUTHORS NEWS README COPYING
|
2002-08-21 16:28:19 +00:00
|
|
|
|
2002-11-21 04:08:37 +00:00
|
|
|
# The dist file name
|
2002-04-26 13:39:31 +00:00
|
|
|
ZIPFILE := scummvm-`date '+%Y-%m-%d'`.zip
|
|
|
|
|
2002-11-21 04:08:37 +00:00
|
|
|
# The name for the directory used for depenency tracking
|
|
|
|
DEPDIR := .deps
|
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
|
|
|
|
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 += \
|
2006-09-23 00:42:35 +00:00
|
|
|
engines \
|
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 \
|
|
|
|
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
|
|
|
|
|
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
|
|
|
|
CPPFLAGS:= $(DEFINES) $(INCLUDES)
|
|
|
|
|
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))
|
2003-09-19 21:23:23 +00:00
|
|
|
DEPFILES =
|
|
|
|
|
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
|
2003-09-18 13:03:56 +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
|
|
|
|
$(RM_REC) $(DEPDIRS)
|
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:
|
2005-01-11 22:02:05 +00:00
|
|
|
$(RM) $(OBJS) $(EXECUTABLE)
|
2002-07-06 13:05:42 +00:00
|
|
|
|
2003-09-28 10:53:28 +00:00
|
|
|
.PHONY: all clean dist distclean plugins
|
2002-07-06 13:05:42 +00:00
|
|
|
|
2003-09-08 15:33:26 +00:00
|
|
|
# Old (dumb) compile & dependcy rules
|
2002-11-21 04:08:37 +00:00
|
|
|
#INCS = scumm/scumm.h common/scummsys.h common/stdafx.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
|
|
|
|
# dependency tracking.
|
2002-11-21 20:36:33 +00:00
|
|
|
.cpp.o:
|
|
|
|
$(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.
|
2003-08-02 11:17:59 +00:00
|
|
|
.cpp.o:
|
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
|
|
|
|
endif
|
2002-08-21 16:53:11 +00:00
|
|
|
|
2004-05-21 02:08:48 +00:00
|
|
|
ifdef HAVE_NASM
|
|
|
|
.SUFFIXES: .asm
|
|
|
|
|
|
|
|
.asm.o:
|
|
|
|
$(NASM) -O1 $(NASMFLAGS) -g -o $*.o $(<)
|
|
|
|
endif
|
|
|
|
|
2003-09-19 21:23:23 +00:00
|
|
|
# Include the dependency tracking files. We add /dev/null at the end
|
|
|
|
# of the list to avoid a warning/error if no .d file exist
|
2004-02-01 17:07:23 +00:00
|
|
|
-include $(wildcard $(addsuffix /*.d,$(DEPDIRS))) /dev/null
|