aboutsummaryrefslogtreecommitdiff
path: root/common.rules
diff options
context:
space:
mode:
authorMax Horn2003-09-18 13:03:56 +0000
committerMax Horn2003-09-18 13:03:56 +0000
commita15fdcea21272fbc53ee47f7ced7ac0a093b52cc (patch)
tree08bed827bf4fc938d78beeec37925d41306333d7 /common.rules
parentdbb20eaee5c7837d10e02661b83f5360ea7db395 (diff)
downloadscummvm-rg350-a15fdcea21272fbc53ee47f7ced7ac0a093b52cc.tar.gz
scummvm-rg350-a15fdcea21272fbc53ee47f7ced7ac0a093b52cc.tar.bz2
scummvm-rg350-a15fdcea21272fbc53ee47f7ced7ac0a093b52cc.zip
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
svn-id: r10292
Diffstat (limited to 'common.rules')
-rw-r--r--common.rules30
1 files changed, 22 insertions, 8 deletions
diff --git a/common.rules b/common.rules
index 97e7507d99..3c7b732728 100644
--- a/common.rules
+++ b/common.rules
@@ -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)
@@ -19,9 +38,4 @@ $(MODULE_LIB-$(MODULE)): $(MODULE_OBJS)
# 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)