[Scummvm-cvs-logs] CVS: scummvm common.rules,NONE,1.1 Makefile.common,1.32,1.33

Max Horn fingolfin at users.sourceforge.net
Wed Nov 20 20:09:03 CET 2002


Update of /cvsroot/scummvm/scummvm
In directory sc8-pr-cvs1:/tmp/cvs-serv24050

Modified Files:
	Makefile.common 
Added Files:
	common.rules 
Log Message:
revamped build system somewhat: 'modules' like scumm, simon, gui etc. now all build into a lib, and all have a module.mk file that lists all their file. Advantage: further modularizes the build system, seperating all parts of ScummVM

--- NEW FILE: common.rules ---
# Common build rules, used by the sub modules and their module.mk files

# Convenience library target
$(MODULE)/lib$(MODULE).a: $(MODULE_OBJS)
	$(AR) $@ $+
	$(RANLIB) $@ 

# Clean target, removes all object files. This looks a bit hackish, as we have to
# copy the content of MODULE_OBJS to another unique variable (the next module.mk
# will overwrite it after all). The same for the libMODULE.a library file.
MODULE_OBJS-$(MODULE) := $(MODULE_OBJS)
MODULE_LIB-$(MODULE) := $(MODULE)/lib$(MODULE).a
clean: clean-$(MODULE)
clean-$(MODULE): clean-% :
	-$(RM) $(MODULE_OBJS-$*) $(MODULE_LIB-$*)


# Pseudo target for comfort, allows for "make common", "make gui" etc.
$(MODULE): $(MODULE_OBJS)

# Add convenience library to main OBJS list
OBJS += $(MODULE)/lib$(MODULE).a

.PHONY: clean-$(MODULE) $(MODULE)

Index: Makefile.common
===================================================================
RCS file: /cvsroot/scummvm/scummvm/Makefile.common,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- Makefile.common	15 Nov 2002 15:12:30 -0000	1.32
+++ Makefile.common	21 Nov 2002 04:08:36 -0000	1.33
@@ -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.
-
-# List of all sub modules
-MODULES += backends/fs/posix common gui scumm simon sound scumm/smush
-
-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 \
+# This file is used by Makefile and Makefile.mingw and declares common build rules,
+# a list of common object files etc.
 
-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 \
+# The defaul build target: just build the scummvm executable
+all: scummvm$(EXEEXT)
 
-SIMON_OBJS = \
-	simon/debug.o \
-	simon/items.o \
-	simon/midi.o \
-	simon/res.o \
-	simon/simon.o \
-	simon/verb.o \
-	simon/vga.o
+# 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
 
-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
+# The dist file name
+ZIPFILE := scummvm-`date '+%Y-%m-%d'`.zip
 
-SOUND_OBJS = sound/fmopl.o sound/mididrv.o sound/mixer.o
+# The name for the directory used for depenency tracking
+DEPDIR := .deps
 
-OBJS	+= $(BACKEND_OBJS) $(COMMON_OBJS) $(GUI_OBJS) scumm/libscumm.a simon/libsimon.a $(SOUND_OBJS)
+# 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
 
-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
+# Include the build instructions for all modules
+-include $(patsubst %,%/module.mk,$(MODULES))
 
-all: scummvm$(EXEEXT)
 
 scummvm$(EXEEXT): $(OBJS)
-	$(CXX) $(LDFLAGS) -o $(@) $(OBJS) $(LIBS)
-
-scumm/libscumm.a: $(SCUMM_OBJS) $(SMUSH_OBJS)
-	$(AR) $@ $+
-	$(RANLIB) $@ 
-
-simon/libsimon.a: $(SIMON_OBJS)
-	$(AR) $@ $+
-	$(RANLIB) $@ 
+	$(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 @@
 
 # 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)
@@ -129,6 +56,12 @@
 	$(ECHO) "$(*D)/" > $(*D)/$(DEPDIR)/$(*F).d
 	$(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
 





More information about the Scummvm-git-logs mailing list