aboutsummaryrefslogtreecommitdiff
path: root/Makefile.common
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.common')
-rw-r--r--Makefile.common135
1 files changed, 34 insertions, 101 deletions
diff --git a/Makefile.common b/Makefile.common
index b39b5aad62..a4748bfd0c 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -1,117 +1,45 @@
# $Header$
-# This file is used by Makefile, Makefile.irix, Makefile.macosx and declares
-# common rules, a list of common object files etc.
+# This file is used by Makefile and Makefile.mingw and declares common build rules,
+# a list of common object files etc.
-# List of all sub modules
-MODULES += backends/fs/posix common gui scumm simon sound scumm/smush
+# The defaul build target: just build the scummvm executable
+all: scummvm$(EXEEXT)
+
+# Files that are to be included in the archive built by "make dist"
+DISTFILES := \
+ Makefile Makefile.common Makefile.mingw \
+ NEWS README COPYING scummvm.6 Info.plist \
+ scumm.dsp scummvm.dsp scummvm.dsw scummvm.icns scummvm.ico \
+ scummvm.proj scummvm.rc scummvm.spec scummvm.xpm simon.dsp
+# The dist file name
ZIPFILE := scummvm-`date '+%Y-%m-%d'`.zip
-INCS = scumm/scumm.h common/scummsys.h common/stdafx.h
-
-BACKEND_OBJS = \
- backends/fs/posix/posix-fs.o \
- backends/fs/morphos/abox-fs.o \
- backends/fs/windows/windows-fs.o
-
-COMMON_OBJS = \
- common/config-file.o \
- common/engine.o \
- common/file.o \
- common/gameDetector.o \
- common/main.o \
- common/scaler.o \
- common/str.o \
- common/timer.o \
- common/util.o
-
-GUI_OBJS = \
- gui/browser.o \
- gui/dialog.o \
- gui/launcher.o \
- gui/ListWidget.o \
- gui/message.o \
- gui/newgui.o \
- gui/ScrollBarWidget.o \
- gui/widget.o \
-
-SCUMM_OBJS = \
- scumm/actor.o \
- scumm/akos.o \
- scumm/boxes.o \
- scumm/bundle.o \
- scumm/costume.o \
- scumm/debug.o \
- scumm/debugrl.o \
- scumm/dialogs.o \
- scumm/gfx.o \
- scumm/imuse.o \
- scumm/object.o \
- scumm/resource.o \
- scumm/resource_v2.o \
- scumm/resource_v3.o \
- scumm/resource_v4.o \
- scumm/saveload.o \
- scumm/script.o \
- scumm/script_v1.o \
- scumm/script_v2.o \
- scumm/scummvm.o \
- scumm/sound.o \
- scumm/string.o \
- scumm/vars.o \
- scumm/verbs.o \
-
-SIMON_OBJS = \
- simon/debug.o \
- simon/items.o \
- simon/midi.o \
- simon/res.o \
- simon/simon.o \
- simon/verb.o \
- simon/vga.o
-
-SMUSH_OBJS = \
- scumm/smush/blitter.o \
- scumm/smush/brenderer.o \
- scumm/smush/chunk.o \
- scumm/smush/codec1.o \
- scumm/smush/codec37.o \
- scumm/smush/codec44.o \
- scumm/smush/codec47.o \
- scumm/smush/color.o \
- scumm/smush/frenderer.o \
- scumm/smush/imuse_channel.o \
- scumm/smush/player.o \
- scumm/smush/saud_channel.o \
- scumm/smush/scumm_renderer.o
-
-SOUND_OBJS = sound/fmopl.o sound/mididrv.o sound/mixer.o
-
-OBJS += $(BACKEND_OBJS) $(COMMON_OBJS) $(GUI_OBJS) scumm/libscumm.a simon/libsimon.a $(SOUND_OBJS)
-
-DISTFILES=$(OBJS:.o=.cpp) Makefile scumm.h scummsys.h stdafx.h stdafx.cpp \
- debugrl.h NEWS README COPYING \
- scummvm.dsp scummvm.dsw sound/fmopl.h gui.h sound.h
+# The name for the directory used for depenency tracking
+DEPDIR := .deps
-all: scummvm$(EXEEXT)
+# List of all sub modules.
+# TODO - the nested ones (scumm/smus, backends/...) should be handled from the
+# module.mk of their parents. In fact the only reason they are listed here is to ensure the
+# DEPDIRS directive works correctly.
+MODULES += \
+ backends common gui scumm simon sound \
+ scumm/smush backends/fs/posix backends/fs/morphos backends/fs/windows
-scummvm$(EXEEXT): $(OBJS)
- $(CXX) $(LDFLAGS) -o $(@) $(OBJS) $(LIBS)
+# Include the build instructions for all modules
+-include $(patsubst %,%/module.mk,$(MODULES))
-scumm/libscumm.a: $(SCUMM_OBJS) $(SMUSH_OBJS)
- $(AR) $@ $+
- $(RANLIB) $@
-simon/libsimon.a: $(SIMON_OBJS)
- $(AR) $@ $+
- $(RANLIB) $@
+scummvm$(EXEEXT): $(OBJS)
+ $(CXX) $(LDFLAGS) -o $@ $+ $(LIBS)
clean:
- $(RM) $(OBJS) $(SCUMM_OBJS) $(SIMON_OBJS) $(SMUSH_OBJS) scummvm$(EXEEXT)
+ $(RM) scummvm$(EXEEXT)
.PHONY: all clean dist distclean
# Default (dumb) compile & dependcy rules
+#INCS = scumm/scumm.h common/scummsys.h common/stdafx.h
#.cpp.o:
# $(CXX) $(CFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
#$(OBJS): $(INCS)
@@ -119,9 +47,8 @@ clean:
# If you use GCC, disable the above and enable this for intelligent
# dependency tracking.
-DEPDIR := .deps
DEPDIRS = $(patsubst %,%/$(DEPDIR),$(MODULES))
-DEPFILES = $(wildcard $(patsubst %,%/$(DEPDIR)/*.d,$(MODULES)))
+DEPFILES = $(wildcard $(patsubst %,%/*.d,$(DEPDIRS)))
.cpp.o:
$(MKDIR) $(*D)/$(DEPDIR)
@@ -130,6 +57,12 @@ DEPFILES = $(wildcard $(patsubst %,%/$(DEPDIR)/*.d,$(MODULES)))
$(CAT) "$(*D)/$(DEPDIR)/$(*F).d2" >> "$(*D)/$(DEPDIR)/$(*F).d"
$(RM) "$(*D)/$(DEPDIR)/$(*F).d2"
+# If you even have GCC 3.x, you can use this build rule, which is safer; the above
+# rule can get you into a bad state if you Ctrl-C it in the wrong moment.
+#.cpp.o:
+# $(MKDIR) $(*D)/$(DEPDIR)
+# $(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(CFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
+
-include $(DEPFILES) /dev/null
distclean: clean