Cross-compiling and packaging of
RISC OS
applications with GCCSDK is
supported. List the zips to be created:
That indicates that a zip called
out/foo-riscos.zip is to be built.
By default, a zip only contains one application,
with the same name as the zip, but you can list
multiple applications explicitly:
foo_apps += fullapp
foo_apps += viewer
By default, an application appears in a
directory of the same name, e.g.,
out/riscos/fullapp/ and
out/riscos/viewer/. You can specify
an alternative name:
fullapp_appname=!Foo
viewer_appname=!FooViewer
So now the application will appear in
out/riscos/!Foo/ and
out/riscos/!FooViewer/.
The contents of each application must be
listed. You can specify source files, to be
copied from src/obj/:
# From src/obj/bar.c
fullapp_rof += Source/c/bar,fff
# From src/obj/bar.h
fullapp_rof += Source/h/bar,fff
You can specify exported header files, also
copied from src/obj/:
# From src/obj/foo/bar.h
fullapp_rof += Library/foo/h/bar,fff
# From src/obj/foo/bar.hh
fullapp_rof += Library/foo/hh/bar,fff
If you already have lists of the files
relative to src/obj/, you can
generate the equivalent
RISC OS
names like this:
# List headers to install.
headers += foo/bar.h
headers += foo/bar.hh
# Find source files which are not installed headers.
SOURCES:=$(filter-out $(headers),$(shell $(FIND) src/obj \( -name "*.c" -o -name "*.cc" -o -name "*.h" -o -name "*.hh" \) -printf '%P\n'))
# Installed headers should also be part of the RISC OS application fullapp.
fullapp_rof += $(call riscos_hdr,$(headers))
# Source files should be included in the RISC OS application fullapp.
fullapp_rof += $(call riscos_src,$(SOURCES))
Copying of source and header files should work
on hierarchies of any depth. Copying of library
archives only works at the top level,
however:
# From out/libfoo.a
fullapp_rof += Library/o/foo,ffd
More generally, you can generate the
RISC OS
names of libraries like this:
fullapp_rof += $(call riscos_lib,$(libraries))
This will work even if a library has an alias
set with foo_libname.
Some files come from special locations:
# From docs/README.html
fullapp_rof += README,faf
# From docs/COPYING
fullapp_rof += COPYING,fff
# From docs/VERSION
fullapp_rof += VERSION,fff
# From docs/HISTORY
fullapp_rof += HISTORY,fff
For an application runimage:
ELF2AIF=elf2aif
# Converted from out/prog
fullapp_runimage += prog
For a compiled command:
# From out/myprog
fullapp_rof += Library/myprog,ff8
For all binary executables:
fullapp_rof += $(call riscos_bin,$(EXPORT_BINARIES@default))
Everything else is copied from
src/riscos/fullapp/:
# From src/riscos/fullapp/!Boot,feb
fullapp_rof += !Boot,feb
# From src/riscos/fullapp/Messages,fff
fullapp_rof += Messages,fff
# From src/riscos/fullapp/Templates,fec
fullapp_rof += Templates,fec
To make the applications in
out/riscos/:
To make the zips in out/ as
well:
You will likely want to add one of these to
your default target, e.g.:
To install:
RISC OS
relocatable modules
A submodel called riscos-rm
is predefined with the following:
SUBMODEL_SFX@riscos-rm=.rm
SUBMODEL_OBJSFX@riscos-rm ?= .mo
SUBMODEL_LABEL@riscos-rm=RISC OS RM
CPPFLAGS@riscos-rm += -mlibscl -mmodule
CPPFLAGS@riscos-rm += -mfloat-abi=$(FPABI@riscos-rm)
ASFLAGS@riscos-rm += -mfloat-abi=$(FPABI@riscos-rm)
FPABI@riscos-rm ?= hard
Rules exist to generate
file.s and
file.h from
file.cmhg, which
describes a module. At the moment,
file.cmhg does not
get preprocessed. You can then define the
module from that together with (say)
foo.c and bar.c
with:
test_binaries.c@riscos-rm += mymodule
mymodule_obj += file
mymodule_obj += foo
mymodule_obj += bar
To make the relocatable module
mymodule part of an application
directory:
riscos_zips += myproj
myproj_apps += system
system_appname=!System
system.mymodule.modloc=Modules/310/MyModule
This simply specifies that
out/mymodule.rm should be copied
to
out/riscos/!System/Modules/310/MyModule,ffa.