[Scummvm-cvs-logs] CVS: scummvm Makefile,1.49,1.50 Makefile.common,1.67,1.68 common.rules,1.8,1.9
Max Horn
fingolfin at users.sourceforge.net
Thu Sep 18 06:04:21 CEST 2003
Update of /cvsroot/scummvm/scummvm
In directory sc8-pr-cvs1:/tmp/cvs-serv17764
Modified Files:
Makefile Makefile.common common.rules
Log Message:
plugin work: right now, only with build rules for OS X. Once I can get it to work here, I'll add more build rules. Work in progress, a lot ain't work, but the plugin stuff is disabled by default, so no harm should arise
Index: Makefile
===================================================================
RCS file: /cvsroot/scummvm/scummvm/Makefile,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- Makefile 17 Sep 2003 22:13:38 -0000 1.49
+++ Makefile 18 Sep 2003 13:03:55 -0000 1.50
@@ -26,6 +26,8 @@
MODULES :=
MODULE_DIRS :=
+EXECUTABLE := scummvm$(EXEEXT)
+
# Load the make rules generated by configure
include config.mak
Index: Makefile.common
===================================================================
RCS file: /cvsroot/scummvm/scummvm/Makefile.common,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- Makefile.common 17 Sep 2003 23:59:13 -0000 1.67
+++ Makefile.common 18 Sep 2003 13:03:56 -0000 1.68
@@ -5,7 +5,7 @@
######################################################################
# The defaul build target: just build the scummvm executable
######################################################################
-all: scummvm$(EXEEXT)
+all: $(EXECUTABLE)
######################################################################
@@ -31,15 +31,21 @@
# Plugin settings
######################################################################
-# For now we only support "static" plugins
-STATIC_PLUGINS := 1
+# Whether to build plugins or now (TODO: should be set by configure script
+#BUILD_PLUGINS := 1
# Plugin prefix. Typically "lib" on Unix, and nothing everywhere else
PLUGIN_PREFIX := lib
# Plugin suffix. For static/shared libs this is typically ".so"/".a" on Unix,
# ".dll"/".lib" on Windows, ".bundle"/".a" on OS X, etc.
-PLUGIN_SUFFIX := .a
+PLUGIN_SUFFIX := .so
+ifdef BUILD_PLUGINS
+# FIXME/TODO: The following is OS X specific (and the '-m' is an evil hack
+# to work around the conflict between our operators new/delete and the
+# ones provided by libstdc++.a)
+LDFLAGS += -all_load -m
+endif
######################################################################
# Module settings
@@ -96,11 +102,11 @@
base/main.o: $(filter-out base/libbase.a,$(OBJS))
# The build rule for the ScummVM executable
-scummvm$(EXEEXT): $(OBJS)
- $(CXX) $(LDFLAGS) -o $@ $+ $(LIBS)
+$(EXECUTABLE): $(OBJS)
+ $(CXX) $(LDFLAGS) $+ $(LIBS) -o $@
clean:
- $(RM) $(OBJS) scummvm$(EXEEXT)
+ $(RM) $(OBJS) $(EXECUTABLE)
.PHONY: all clean dist distclean
Index: common.rules
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common.rules,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- common.rules 17 Sep 2003 23:34:56 -0000 1.8
+++ common.rules 18 Sep 2003 13:03:56 -0000 1.9
@@ -1,13 +1,32 @@
# Common build rules, used by the sub modules and their module.mk files
+MODULE_OBJS-$(MODULE) := $(MODULE_OBJS)
+MODULE_LIB-$(MODULE) := $(MODULE)/lib$(MODULE).a
+
+ifdef PLUGIN
+# Plugin build rule
+# TODO: Right now, for Mac OS X only. We either will have to generate this
+# via the configure script, or put in some 'if' statements to choose from
+# one of several build rules
+PLUGIN-$(MODULE) := $(MODULE)/$(PLUGIN_PREFIX)$(MODULE)$(PLUGIN_SUFFIX)
+$(PLUGIN-$(MODULE)): $(MODULE_OBJS) $(EXECUTABLE)
+ $(CXX) -bundle -bundle_loader $(EXECUTABLE) $(filter-out $(EXECUTABLE),$+) -o $@
+PLUGIN:=
+plugins: $(PLUGIN-$(MODULE))
+
+else
+
+# If not building as a plugin, add the object files to the main OBJS list
+OBJS += $(MODULE_LIB-$(MODULE))
+endif
+
+
# 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)/$(PLUGIN_PREFIX)$(MODULE)$(PLUGIN_SUFFIX)
clean: clean-$(MODULE)
clean-$(MODULE): clean-% :
- -$(RM) $(MODULE_OBJS-$*) $(MODULE_LIB-$*)
+ -$(RM) $(MODULE_OBJS-$*) $(MODULE_LIB-$*) $(PLUGIN-$*)
# Convenience library target
$(MODULE_LIB-$(MODULE)): $(MODULE_OBJS)
@@ -18,10 +37,5 @@
# Pseudo target for comfort, allows for "make common", "make gui" etc.
$(MODULE): $(MODULE_LIB-$(MODULE))
-
-ifdef STATIC_PLUGINS
-# Add static plugin object files to the main OBJS list
-OBJS += $(MODULE_LIB-$(MODULE))
-endif
.PHONY: clean-$(MODULE) $(MODULE)
More information about the Scummvm-git-logs
mailing list