diff --git a/Makefiles/AAsmModule b/Makefiles/AAsmModule
index 263cfac0d84ef79df08b1b65317f0c7ffa0a08f5..e6053a83d61fed28c40c9b3bc4cddb53e0f1ecd9 100644
--- a/Makefiles/AAsmModule
+++ b/Makefiles/AAsmModule
@@ -14,6 +14,9 @@
 #
 # Makefile fragment for assembler modules targetted at ROMming, previously built
 # using AAsm but now using objasm.
+
+INCLUDED_AASMMODULE = YES
+
 #
 # $Id$
 #
diff --git a/Makefiles/AppLibs b/Makefiles/AppLibs
index c74cee00643421504892d5bdb7c7a31c0fec8739..8322d9ee1277851884273f8b03410f8a308c7712 100644
--- a/Makefiles/AppLibs
+++ b/Makefiles/AppLibs
@@ -13,6 +13,9 @@
 # limitations under the License.
 #
 # Makefile fragment for libraries linked against RAM applications
+
+INCLUDED_APPLIBS = YES
+
 #
 STDMAKEFILE=$Id$
 #
diff --git a/Makefiles/AppStdRule b/Makefiles/AppStdRule
index f5492ca3ddad7bff2401fc83a3e14d2207e189c0..0dfc872fed517af52e518f21d5cc763f2d9ef648 100644
--- a/Makefiles/AppStdRule
+++ b/Makefiles/AppStdRule
@@ -14,6 +14,9 @@
 #
 # Makefile fragment for defining standard rules for various tools
 # when building RAM applications
+
+INCLUDED_APPSTDRULE = YES
+
 #
 # $Id$
 #
diff --git a/Makefiles/BBEExport b/Makefiles/BBEExport
index 96cfc75d0c5175a961769b8bb630baec29eb5a47..6d64a7c6b020f9400c14621888515aadb710a6d7 100644
--- a/Makefiles/BBEExport
+++ b/Makefiles/BBEExport
@@ -13,6 +13,9 @@
 # limitations under the License.
 #
 # Makefile fragment for Binary Build Environment exporting.
+
+INCLUDED_BBEEXPORT = YES
+
 #
 # This Makefile is included directly by srcbuild as the core implementation
 # of the binary build environment phase.
diff --git a/Makefiles/CApp b/Makefiles/CApp
index 91df8ff74fe6026adabbb8d08d88d579104b6041..3fbc9e4c8ebbdecafef9f7dd3b182010b358a769 100644
--- a/Makefiles/CApp
+++ b/Makefiles/CApp
@@ -13,6 +13,9 @@
 # limitations under the License.
 #
 # Makefile fragment for C and C++ applications
+
+INCLUDED_CAPP = YES
+
 #
 # $Id$
 #
@@ -43,6 +46,7 @@
 # INSTTYPE     (opt) (use "tool" or "app" to install executable vs application - defaults to "tool")
 # INSTALLAPPFILES   (opt) (list of files to be installed in application directory - use InstRes specification rules)
 # INSTALLAPP_DEPEND (opt) (list of dependencies to be satisfied before doing application install - ${TARGET} assumed if in INSTALLAPPFILES)
+# CUSTOMLINK        (opt) (set to "custom" to override the link rule)
 # CUSTOMINSTALLAPP  (opt) (set to "custom" to override the install rule for resource files)
 # CUSTOMINSTALLTOOL (opt) (set to "custom" to override the install rule for target binary)
 #
@@ -84,16 +88,31 @@ INSTDIR      ?= ${INSTALLDIR}.${TARGET}
 DIRS         ?= o._dirs
 OBJS         ?= ${TARGET}
 DBG_OBJS     ?= ${OBJS}
+APP_LIBS     ?= ${LIBS}
 DBG_LIBS     ?= ${LIBS}
 ifeq (C++,${LINK_TYPE})
-LIBS         += ${C++LIB}
+APP_LIBS     += ${C++LIB}
 DBG_LIBS     += ${C++LIB}
 endif
-LIBS         += ${CLIB}
+APP_LIBS     += ${CLIB}
 DBG_LIBS     += ${DEBUGLIBS} ${CLIB}
 APP_OBJS     ?= $(addprefix o.,${OBJS})
 APP_DBG_OBJS ?= $(addprefix od.,${DBG_OBJS})
 
+ifeq ("${INCLUDED_STDTOOLS}","")
+include StdTools
+endif
+ifeq ("${INCLUDED_APPLIBS}","")
+include AppLibs
+endif
+
+ifeq ("${INCLUDED_APPSTDRULE}","")
+include AppStdRule
+endif
+ifeq ("${INCLUDED_DBGRULES}","")
+include DbgRules
+endif
+
 all: ${TARGET}
         @${ECHO} ${COMPONENT}: application built
 
@@ -136,11 +155,11 @@ install_tool${CUSTOMINSTALLTOOL}: ${TARGET}
 debug: ${DBG_TARGET}
         @${ECHO} ${COMPONENT}: debug application built
 
-${TARGET}: ${APP_OBJS} ${LIBS} ${DIRS}
-        ${LD} ${LDFLAGS} -o ${TARGET} ${APP_OBJS} ${LIBS}
+${TARGET}${CUSTOMLINK}: ${APP_OBJS} ${APP_LIBS} ${DIRS}
+        ${LD} ${LDFLAGS} -o ${TARGET} ${APP_OBJS} ${APP_LIBS}
         ${SQZ} ${SQZFLAGS} $@
 
-${DBG_TARGET}: ${APP_DBG_OBJS} ${DBG_LIBS} ${DIRS}
+${DBG_TARGET}${CUSTOMLINK}: ${APP_DBG_OBJS} ${DBG_LIBS} ${DIRS}
         ${LD} ${LDFLAGS} ${LDDFLAGS} -o ${DBG_TARGET} ${APP_DBG_OBJS} ${DBG_LIBS}
 
 # EOF
diff --git a/Makefiles/CLibrary b/Makefiles/CLibrary
index cffb4801cea4b238d00eac10456c021e16fd8bf2..796ffe888abfdb3e3627bc62d01b61848cd6229e 100644
--- a/Makefiles/CLibrary
+++ b/Makefiles/CLibrary
@@ -13,6 +13,9 @@
 # limitations under the License.
 #
 # Makefile fragment for C and C++ libraries for applications and modules
+
+INCLUDED_CLIBRARY = YES
+
 #
 # $Id$
 #
@@ -107,6 +110,17 @@ EXPORTING_ASMHDRS = $(addprefix expasm.,${ASMHDRS})
 EXPORTING_LIBS    = $(addprefix explib.,${LIBRARIES})
 TARGET_LIBS       = $(addprefix ${LIBEXT}.,${LIBRARIES})
 
+ifeq ("${INCLUDED_STDTOOLS}","")
+include StdTools
+endif
+
+ifeq ("${INCLUDED_STDRULES}","")
+include StdRules
+endif
+ifeq ("${INCLUDED_DBGRULES}","")
+include DbgRules
+endif
+
 all_libs: ${TARGET_LIBS}
         @${ECHO} ${COMPONENT}: library built
 
diff --git a/Makefiles/CModule b/Makefiles/CModule
index 0e862006f539e6e7f464eaa0b26cb7ead5cd58f6..3a25982c7f1dbb3a9e5a3eea516d46ad3f42204b 100644
--- a/Makefiles/CModule
+++ b/Makefiles/CModule
@@ -1,4 +1,7 @@
 # Makefile fragment for C and C++ modules
+
+INCLUDED_CMODULE = YES
+
 #
 # $Id$
 #
@@ -174,6 +177,19 @@ CDEFINES     += ${ROMCDEFINES}
 ASMDEFINES   += ${ROMASMDEFINES}
 endif
 
+ifeq ("${INCLUDED_STDTOOLS}","")
+include StdTools
+endif
+ifeq ("${INCLUDED_MODULELIBS}","")
+include ModuleLibs
+endif
+
+ifeq ("${INCLUDED_MODSTDRULE}","")
+include ModStdRule
+endif
+ifeq ("${INCLUDED_DBGRULES}","")
+include DbgRules
+endif
 
 # General rules
 
diff --git a/Makefiles/DbgRules b/Makefiles/DbgRules
index 104ee5a8ee690da8dd01bcea5f0322a6a4928631..eabecced613c6808d2d15386036955144faa8405 100644
--- a/Makefiles/DbgRules
+++ b/Makefiles/DbgRules
@@ -13,6 +13,9 @@
 # limitations under the License.
 #
 # Makefile fragment for defining standard debug rules for various tools
+
+INCLUDED_DBGRULES = YES
+
 #
 # $Id$
 #
diff --git a/Makefiles/HostTools b/Makefiles/HostTools
index afeba1564dc68840cd3edd955c51eb4d4ab6e20b..c5c5fde7b582c31e01992042438400ec860bedaa 100644
--- a/Makefiles/HostTools
+++ b/Makefiles/HostTools
@@ -14,6 +14,9 @@
 #
 # Makefile fragment for C applications that run on the build host but which
 # are built during the main build
+
+INCLUDED_HOSTTOOLS = YES
+
 #
 #
 # These are the tool definitions for RISC OS hosted builds.
diff --git a/Makefiles/ModStdRule b/Makefiles/ModStdRule
index 0db547d6b9fe05256b517526578c3fc23818ea9d..c64b8af5484e2410f03b625ba9c46f8f2a3592e2 100644
--- a/Makefiles/ModStdRule
+++ b/Makefiles/ModStdRule
@@ -14,6 +14,9 @@
 #
 # Makefile fragment for defining standard rules for various tools
 # when building modules
+
+INCLUDED_MODSTDRULE = YES
+
 #
 # $Id$
 #
diff --git a/Makefiles/ModuleLibs b/Makefiles/ModuleLibs
index 6102b3d85d25a8da2438787ecc7334cde9c32ccd..d2c59da3411c9673421f35645894e5fff17b9331 100644
--- a/Makefiles/ModuleLibs
+++ b/Makefiles/ModuleLibs
@@ -13,6 +13,9 @@
 # limitations under the License.
 #
 # Makefile fragment for libraries linked against modules (RAM or ROM)
+
+INCLUDED_MODULELIBS = YES
+
 #
 STDMAKEFILE=$Id$
 #
diff --git a/Makefiles/RAMCModule b/Makefiles/RAMCModule
index 0e0d5f0bdd485cd7d7514272c4cd52c092bbd1b5..defa6c9c3609a1979959e9fcaf42f0585ff932c3 100644
--- a/Makefiles/RAMCModule
+++ b/Makefiles/RAMCModule
@@ -13,6 +13,9 @@
 # limitations under the License.
 #
 # Makefile fragment for C and C++ modules targetted at RAM.
+
+INCLUED_RAMCMODULE = YES
+
 #
 # $Id$
 #
diff --git a/Makefiles/RAMModule b/Makefiles/RAMModule
index eabe2cb0953c2b0895e5842cddb81b6831b176d5..5c7b8d5d32d789a27030787f3f986541cc78815e 100644
--- a/Makefiles/RAMModule
+++ b/Makefiles/RAMModule
@@ -13,6 +13,9 @@
 # limitations under the License.
 #
 # Makefile fragment for assembler modules targetted at RAM, built using objasm
+
+INCLUDED_RAMMODULE = YES
+
 #
 # $Id$
 #
diff --git a/Makefiles/ROMCModule b/Makefiles/ROMCModule
index 63ac9bf4a7e6d4069f8e82cdb2671373b5717acb..eedb547c9b7babaa958a0e78787d79d0347aec31 100644
--- a/Makefiles/ROMCModule
+++ b/Makefiles/ROMCModule
@@ -13,6 +13,9 @@
 # limitations under the License.
 #
 # Makefile fragment for C and C++ modules targetted at ROMming.
+
+INCLUDED_ROMCMODULE = YES
+
 #
 # $Id$
 #
diff --git a/Makefiles/ROMModule b/Makefiles/ROMModule
index 49ae454de1e214f48cc1a38a953b8f03ba7e575b..296fbc3abbf948e4389ee098a96774cde42c261e 100644
--- a/Makefiles/ROMModule
+++ b/Makefiles/ROMModule
@@ -13,6 +13,9 @@
 # limitations under the License.
 #
 # Makefile fragment for assembler modules targetted at ROMming, built using objasm
+
+INCLUDED_ROMMODULE = YES
+
 #
 # $Id$
 #
diff --git a/Makefiles/StdRules b/Makefiles/StdRules
index 3c473bb00c33b9abc994ad6c99e2babdc8734d72..5f471fbf8bac1c64cd3a245ebc2d55b3d87bff3d 100644
--- a/Makefiles/StdRules
+++ b/Makefiles/StdRules
@@ -13,6 +13,9 @@
 # limitations under the License.
 #
 # Makefile fragment for defining standard rules for various tools
+
+INCLUDED_STDRULES = YES
+
 #
 # $Id$
 #
diff --git a/Makefiles/StdTools b/Makefiles/StdTools
index d0471eb75852cbe0f872a734f2dacd7a8217b6d2..17dabd71f7c242f8eb22bcb6ddcd22cb2408f893 100644
--- a/Makefiles/StdTools
+++ b/Makefiles/StdTools
@@ -13,6 +13,9 @@
 # limitations under the License.
 #
 # Makefile fragment for defining the various tools and their options
+
+INCLUDED_STDTOOLS = YES
+
 #
 # $Id$
 #
@@ -100,6 +103,8 @@ STDTOOLOPTIONS = -depend !Depend ${THROWBACK}
 
 AASMFLAGS += -Stamp -quit ${STDTOOLOPTIONS} ${AASMDEFINES} ${AASMINCLUDES}
 ASFLAGS +=  -Stamp -quit ${STDTOOLOPTIONS} ${ASMDEFINES} ${ASMINCLUDES}
+ASFLAGS += -ihdr -i<Hdr$Dir>.Global -i<Hdr$Dir>.Interface -i<Hdr$Dir>.Interface2
+ASFLAGS += -pd "APCS SETS \"${APCS}\"" -pd "Machine SETS \"${MACHINE}\"" -pd "UserIF SETS \"${USERIF}\""
 CFLAGS +=  -c ${STDTOOLOPTIONS} ${CDEFINES} ${CINCLUDES} ${C_NO_FNAMES} ${C_WARNINGS}
 C++INCLUDES += -ICPP:
 C++FLAGS += -c ${STDTOOLOPTIONS} ${C++DEFINES} ${C++INCLUDES}
diff --git a/VersionNum b/VersionNum
index 13143e5c83ef12729fe29c8123941edf7c2147bd..fddda45f36eb444a57db511915fc31514978d431 100644
--- a/VersionNum
+++ b/VersionNum
@@ -1,23 +1,23 @@
-/* (5.11)
+/* (5.12)
  *
  * This file is automatically maintained by srccommit, do not edit manually.
  * Last processed by srccommit version: 1.1.
  *
  */
-#define Module_MajorVersion_CMHG        5.11
+#define Module_MajorVersion_CMHG        5.12
 #define Module_MinorVersion_CMHG        
-#define Module_Date_CMHG                19 Mar 2011
+#define Module_Date_CMHG                31 Mar 2011
 
-#define Module_MajorVersion             "5.11"
-#define Module_Version                  511
+#define Module_MajorVersion             "5.12"
+#define Module_Version                  512
 #define Module_MinorVersion             ""
-#define Module_Date                     "19 Mar 2011"
+#define Module_Date                     "31 Mar 2011"
 
-#define Module_ApplicationDate          "19-Mar-11"
+#define Module_ApplicationDate          "31-Mar-11"
 
 #define Module_ComponentName            "BuildSys"
 #define Module_ComponentPath            "castle/RiscOS/BuildSys"
 
-#define Module_FullVersion              "5.11"
-#define Module_HelpVersion              "5.11 (19 Mar 2011)"
-#define Module_LibraryVersionInfo       "5:11"
+#define Module_FullVersion              "5.12"
+#define Module_HelpVersion              "5.12 (31 Mar 2011)"
+#define Module_LibraryVersionInfo       "5:12"