diff options
author | Max Horn | 2004-05-06 09:58:48 +0000 |
---|---|---|
committer | Max Horn | 2004-05-06 09:58:48 +0000 |
commit | ee94e81392b7da14459e6d9a0f1e0c31bff948c2 (patch) | |
tree | 42b7c4d29b5c5ac8982cf35c2fd50d7683b4a136 | |
parent | 88fdb5a6274c8e4a832daaf7de00ba275e7d895e (diff) | |
download | scummvm-rg350-ee94e81392b7da14459e6d9a0f1e0c31bff948c2.tar.gz scummvm-rg350-ee94e81392b7da14459e6d9a0f1e0c31bff948c2.tar.bz2 scummvm-rg350-ee94e81392b7da14459e6d9a0f1e0c31bff948c2.zip |
Fixed & cleaned up common rules; this fixes the convenience target when doing a plugins build; and also fixes a bug which could cause plugins to be built against an old version of the main executable
svn-id: r13797
-rw-r--r-- | common.rules | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/common.rules b/common.rules index c533f0f070..e48bf98f1b 100644 --- a/common.rules +++ b/common.rules @@ -1,7 +1,9 @@ # Common build rules, used by the sub modules and their module.mk files +# Copy the list of objects to a new variable. The name of the new variable +# contains the module name, a trick we use so we can keep multiple different +# module object lists, one for each module. MODULE_OBJS-$(MODULE) := $(MODULE_OBJS) -MODULE_LIB-$(MODULE) := $(MODULE)/lib$(notdir $(MODULE)).a ifdef PLUGIN # Plugin build rule @@ -14,19 +16,15 @@ $(PLUGIN-$(MODULE)): $(MODULE_OBJS) $(EXECUTABLE) PLUGIN:= plugins: $(PLUGIN-$(MODULE)) +# Pseudo target for comfort, allows for "make common", "make gui" etc. +$(MODULE): $(PLUGIN-$(MODULE)) + else +MODULE_LIB-$(MODULE) := $(MODULE)/lib$(notdir $(MODULE)).a + # 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. -clean: clean-$(MODULE) -clean-$(MODULE): clean-% : - -$(RM) $(MODULE_OBJS-$*) $(MODULE_LIB-$*) $(PLUGIN-$*) # Convenience library target $(MODULE_LIB-$(MODULE)): $(MODULE_OBJS) @@ -34,8 +32,17 @@ $(MODULE_LIB-$(MODULE)): $(MODULE_OBJS) $(AR) $@ $+ $(RANLIB) $@ - # Pseudo target for comfort, allows for "make common", "make gui" etc. $(MODULE): $(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. +clean: clean-$(MODULE) +clean-$(MODULE): clean-% : + -$(RM) $(MODULE_OBJS-$*) $(MODULE_LIB-$*) $(PLUGIN-$*) + .PHONY: clean-$(MODULE) $(MODULE) |