Commit eda4759d authored by Ben Avison's avatar Ben Avison Committed by ROOL

CModule: Allow a component to use RISC_OSLib's modulewrap facility

parent a90f4c23
......@@ -67,6 +67,7 @@ INCLUDED_CMODULE = YES
# RAMASMDEFINES (opt) (additions to ASMDEFINES for RAM builds - requires ModStdRule to be included later)
# ROMASMDEFINES (opt) (additions to ASMDEFINES for ROM builds - requires ModStdRule to be included later)
# CMHGDEPENDS (opt) (source files which need to include the .h file autogenerated from the CMHG file)
# MODULEWRAP (opt) (set to "yes" to build and link with the modulewrap veneer from RISC_OSLib)
#
#
# It relies on the following from the build system:
......@@ -149,6 +150,9 @@ RESFSDIR ?= ${RESDIR}/${TARGET}
CMHGFILE ?= ${TARGET}Hdr
CMHGFILE_SWIPREFIX ?= ${TARGET}
OBJS ?= ${TARGET}
ifeq ("${MODULEWRAP}","yes")
OBJS += modulewrap
endif
ROM_OBJS ?= ${OBJS}
SA_OBJS ?= ${OBJS}
DBG_OBJS ?= ${OBJS}
......@@ -297,6 +301,11 @@ CMHGDEPENDS_ = $(addsuffix .o,${CMHGDEPENDS}) $(addsuffix .od,${CMHGDEPENDS}) $(
${CMHGDEPENDS_}: ${CMHGFILE}.h
endif
ifeq ("${MODULEWRAP}","yes")
modulewrap.s: ${LIBDIR}/RISC_OSLib/modulewrap.s
${CP} $^ $@
endif
.SUFFIXES: .exphdr .expasm .expasmc .h .hdr
.h.exphdr:; ${CP} $< ${C_EXP_HDR}/$<
.hdr.expasm:; ${CP} $< ${EXP_HDR}/$*
......
......@@ -83,6 +83,7 @@ INCLUDED_CMODULE = YES
# RAMASMDEFINES (opt) (additions to ASMDEFINES for RAM builds - requires ModStdRule to be included later)
# ROMASMDEFINES (opt) (additions to ASMDEFINES for ROM builds - requires ModStdRule to be included later)
# CMHGDEPENDS (opt) (source files which need to include the .h file autogenerated from the CMHG file)
# MODULEWRAP (opt) (set to "yes" to build and link with the modulewrap veneer from RISC_OSLib)
#
#
# It relies on the following from the build system:
......@@ -170,6 +171,9 @@ RESFSDIR ?= ${RESDIR}.${TARGET}
CMHGFILE ?= ${TARGET}Hdr
CMHGFILE_SWIPREFIX ?= ${TARGET}
OBJS ?= ${TARGET}
ifeq ("${MODULEWRAP}","yes")
OBJS += modulewrap
endif
ROM_OBJS ?= ${OBJS}
SA_OBJS ?= ${OBJS}
DBG_OBJS ?= ${OBJS}
......@@ -267,6 +271,9 @@ clean ::
@IfThere rm Then ${WIPE} rm ${WFLAGS}
@IfThere h.${CMHGFILE} Then ${ECHO} ${RM} h.${CMHGFILE}
@IfThere h.${CMHGFILE} Then ${RM} h.${CMHGFILE}
ifeq ("${MODULEWRAP}","yes")
@-${RM} s.modulewrap
endif
@${ECHO} ${COMPONENT}: cleaned
#
......@@ -303,6 +310,14 @@ CMHGDEPENDS_ = $(addprefix o.,${CMHGDEPENDS}) $(addprefix od.,${CMHGDEPENDS}) $(
${CMHGDEPENDS_}: h.${CMHGFILE}
endif
ifeq ("${MODULEWRAP}","yes")
s.modulewrap: RISCOSLIB:s.modulewrap
${CP} RISCOSLIB:s.modulewrap $@ ${CPFLAGS}
o.modulewrap od.modulewrap: s.modulewrap
${AS} ${ASFLAGS} -o $@ s.modulewrap
endif
.SUFFIXES: .exphdr .expasm .expasmc .h .hdr
.h.exphdr:; @${ECHO} ${CP} $< ${C_EXP_HDR}.$(subst h.,,$<) ${CPFLAGS} ; ${CP} $< ${C_EXP_HDR}.$(subst h.,,$<) ${CPFLAGS}
.hdr.expasm:; @${ECHO} ${CP} $< ${EXP_HDR}.$(subst hdr.,,$<) ${CPFLAGS} ; ${CP} $< ${EXP_HDR}.$(subst hdr.,,$<) ${CPFLAGS}
......
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