Commit cfc0ecf2 authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Improvements to resources phase rules

AAsmModule:
The preferred override is now 'CUSTOMRES' to match CModule, though the former 'RESOURCES' is still accepted as a transitional step.
The internal phoney targets (like resources-None) can no longer be augmented with :: since that doesn't make sense.
Copied some block comments from CModule so they're easier to compare.
Fixed the resourcesno/resourcesNo never appearing, this is because when CUSTOMRES=no you end up with two rules called resourcesno and no rule called resources.
CModule:
Added resources_res and resources_messages and resources_templates as well as RESOURCEEXTRA support (from AAsmModule).
Copied some block comments from AAsmModule so they're easier to compare.

Tested in an IOMD ROM resources phase.

Version 6.48. Tagged as 'BuildSys-6_48'
parent bad70deb
......@@ -12,8 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Makefile fragment for assembler modules targetted at ROMming, previously built
# using AAsm but now using objasm.
# Makefile fragment for assembler modules, previously built using AAsm but now using objasm
INCLUDED_AASMMODULE = YES
......@@ -44,6 +43,7 @@ INCLUDED_AASMMODULE = YES
# ROM_DEPEND (opt) (any extra dependency to assert on ROM_TARGET)
# SA_DEPEND (opt) (any extra dependency to assert on SA_TARGET and DBG_TARGET)
# CUSTOMEXP (opt) (set to "custom" to override the export rules)
# CUSTOMRES (opt) (set to "custom" to override the resources rules, or "no" for no resources)
# CUSTOMROM (opt) (set to "custom" to override the rom rules)
# CUSTOMSA (opt) (set to "custom" to override the standalone rules)
# CUSTOMDBG (opt) (set to "custom" to override the debug rules)
......@@ -105,6 +105,9 @@ TOKENS ?= Hdr:Tokens
TOKENSOURCE ?= s.TokHelpSrc
ifneq (${RESOURCES},)
CUSTOMRES = ${RESOURCES} # The old name for CUSTOMRES
endif
#
# Exported headers
......@@ -120,7 +123,7 @@ CHEADER3 ?= _!_x_!_
#
# RISC OS ROM build rules:
# ROM build rules
#
rom${CUSTOMROM}: ${ROM_MODULE}
@${ECHO} ${COMPONENT}: rom module built
......@@ -130,9 +133,6 @@ install_rom${CUSTOMROM}: ${ROM_MODULE}
${CP} ${ROM_MODULE}_gpa ${INSTDIR}.${TARGET}_gpa ${CPFLAGS}
@${ECHO} ${COMPONENT}: rom module installed
#
# Actually make the linked ROM target
#
${ROM_MODULE}: ${ROM_OBJECT} ${ROM_LIBS} ${DIRS} ${ROM_DEPEND}
${MKDIR} rm.${MACHINE}
${LD} -rmf -o $@ ${ROM_OBJECT} ${ROM_LIBS}
......@@ -194,7 +194,6 @@ ${GPA_AIF}: ${DBG_OBJECT}
${MKDIR} aif.${MACHINE}
${LD} -aif -bin -d -o ${GPA_AIF} ${DBG_OBJECT}
#
# Clean the module
#
......@@ -254,35 +253,36 @@ ${C_EXP_HDR}.${CHEADER3} :: h.${CHEADER3}
${CP} h.${CHEADER3} $@ ${CPFLAGS}
#
# Resources
# Resources rules
#
resources${CUSTOMRES}:: ${RESOURCEEXTRA} resources-${CMDHELP}
@${ECHO} ${COMPONENT}: resources copied to Messages module
ifeq (${CUSTOMRES},no)
resources:
@${ECHO} ${COMPONENT}: no resources to export
endif
resources_common::
${MKDIR} ${RESFSDIR}
${TOKENCHECK} LocalRes:Messages
${CP} LocalRes:Messages ${RESFSDIR}.Messages ${CPFLAGS}
resources-None:: resources_common
resources-None: resources_common
@|
resources-:: resources_common
resources-: resources_common
IfThere LocalRes:CmdHelp Then ${TOKENCHECK} LocalRes:CmdHelp
IfThere LocalRes:CmdHelp Then ${CAT} LocalRes:CmdHelp { >> ${RESFSDIR}.Messages }
resources${RESOURCES} :: ${RESOURCEEXTRA} resources-${CMDHELP}
@${ECHO} ${COMPONENT}: resources copied to Messages module
resources_res ::
resources_res::
${CP} LocalRes:Res ${RESFSDIR}.Res ${CPFLAGS}
resources_messages ::
resources_messages::
${CP} LocalRes:Messages ${RESFSDIR}.Messages ${CPFLAGS}
resources_templates ::
resources_templates::
${CP} LocalRes:Templates ${RESFSDIR}.Templates ${CPFLAGS}
resourcesno resourcesNo ::
@${ECHO} ${COMPONENT}: no resources to export
#
# Build the help tokens
......
......@@ -203,8 +203,9 @@ ifeq ("${INCLUDED_DBGRULES}","")
include DbgRules
endif
#
# General rules
#
all: aof.${ROM_TARGET} rm.${SA_TARGET} rm.${DBG_TARGET}
@${ECHO} ${COMPONENT}: all built
......@@ -219,6 +220,9 @@ ${DIRS} ::
${MKDIR} rm
${TOUCH} $@
#
# Clean the module
#
clean ::
@IfThere aif Then ${ECHO} ${WIPE} aif ${WFLAGS}
@IfThere aif Then ${WIPE} aif ${WFLAGS}
......@@ -240,8 +244,9 @@ clean ::
@IfThere h.${CMHGFILE} Then ${RM} h.${CMHGFILE}
@${ECHO} ${COMPONENT}: cleaned
# Export rules
#
# Export phases
#
export${CUSTOMEXP}: export_${PHASE}
@${NOP}
......@@ -284,24 +289,38 @@ export_hdrs${CUSTOMEXP}: ${EXPORTING_ASMCHDRS} ${EXPORTING_ASMHDRS} ${EXPORTING_
export_libs${CUSTOMEXP}:
@${ECHO} ${COMPONENT}: no exported libraries
#
# Resources rules
resources${CUSTOMRES}: resources-${CMDHELP}
#
resources${CUSTOMRES}:: ${RESOURCEEXTRA} resources-${CMDHELP}
@${ECHO} ${COMPONENT}: resources copied to Messages module
ifeq (${CUSTOMRES},no)
resources:
@${ECHO} ${COMPONENT}: no resources to export
endif
resources_common:
${MKDIR} ${RESFSDIR}
${TOKENCHECK} LocalRes:Messages
${CP} LocalRes:Messages ${RESFSDIR}.Messages ${CPFLAGS}
resources-None: resources_common
${CP} LocalRes:Messages ${RESFSDIR}.Messages ${CPFLAGS}
@|
resources-: resources_common
IfThere LocalRes:CmdHelp Then ${TOKENCHECK} LocalRes:CmdHelp
IfThere LocalRes:CmdHelp Then FAppend ${RESFSDIR}.Messages LocalRes:Messages LocalRes:CmdHelp
resources_res::
${CP} LocalRes:Res ${RESFSDIR}.Res ${CPFLAGS}
resources_messages::
${CP} LocalRes:Messages ${RESFSDIR}.Messages ${CPFLAGS}
resources_templates::
${CP} LocalRes:Templates ${RESFSDIR}.Templates ${CPFLAGS}
${MERGEDMSGS}: LocalRes:Messages
${MKDIR} ${MERGEDMDIR}
${TOKENCHECK} LocalRes:Messages
......@@ -316,8 +335,9 @@ od.${RES_OBJ}: o.${RES_OBJ} ${DIRS}
${CP} o.${RES_OBJ} od.${RES_OBJ} ${CPFLAGS}
endif
# ROM rules
#
# ROM build rules
#
rom${CUSTOMROM}: aof.${ROM_TARGET}
@${ECHO} ${COMPONENT}: rom module built
......@@ -332,9 +352,9 @@ aof.${ROM_TARGET}: ${ROM_OBJS_} ${ROM_LIBS} ${ROMCSTUBS} ${DIRS} ${ROM_DEPEND}
linked.${LNK_TARGET}: aof.${ROM_TARGET} ${ABSSYM} ${FORCEROMLINK}
${LD} ${LDFLAGS} ${LDLINKFLAGS} -o $@ -rmf -base ${ADDRESS} aof.${ROM_TARGET} ${ABSSYM} -Symbols linked.${LNK_TARGET}_sym
#
# Standalone rules
#
install${CUSTOMSA}: rm.${SA_TARGET}
${MKDIR} ${INSTDIR}
${CP} rm.${SA_TARGET} ${INSTDIR}.${TARGET} ${CPFLAGS}
......
......@@ -144,11 +144,11 @@ root.
AAsmModule provides the "resources" rule invoked by srcbuild to export
resources. If you want to prevent AAsmModule's rule from being invoked, you
must define the macro RESOURCES to a non-empty value. AAsmModule defines a
rule for "resources${RESOURCES}", so by setting RESOURCES, you change the
must define the macro CUSTOMRES to "custom". AAsmModule defines a
rule for "resources${CUSTOMRES}", so by setting CUSTOMRES, you change the
rule that it is defining, thus allowing you to substitute your own resources
rule. It is suggested that the value be set to something like "-private".
If there are no resources, simply define RESOURCES as "no". AAsmModule will
rule.
If there are no resources, simply define CUSTOMRES as "no". AAsmModule will
then provide a rule that echos a message saying that there are no resources
for this component during builds.
......
/* (6.47)
/* (6.48)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 6.47
#define Module_MajorVersion_CMHG 6.48
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 20 Jul 2014
#define Module_Date_CMHG 18 Sep 2014
#define Module_MajorVersion "6.47"
#define Module_Version 647
#define Module_MajorVersion "6.48"
#define Module_Version 648
#define Module_MinorVersion ""
#define Module_Date "20 Jul 2014"
#define Module_Date "18 Sep 2014"
#define Module_ApplicationDate "20-Jul-14"
#define Module_ApplicationDate "18-Sep-14"
#define Module_ComponentName "BuildSys"
#define Module_ComponentPath "castle/RiscOS/BuildSys"
#define Module_FullVersion "6.47"
#define Module_HelpVersion "6.47 (20 Jul 2014)"
#define Module_LibraryVersionInfo "6:47"
#define Module_FullVersion "6.48"
#define Module_HelpVersion "6.48 (18 Sep 2014)"
#define Module_LibraryVersionInfo "6:48"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment