BSP and Device Driver Development Guide
When building a BSP or an application using that BSP, it is necessary
to tailor the compilation arguments to account for compiler flags, use
custom linker scripts, include the RTEMS libraries, etc.. The BSP
must be built using this information. Later, once the BSP is installed
with the toolset, this same information must be used when building the
application. So a BSP must include a build configuration file. The
configuration file is make/custom/BSP.cfg
.
The configuration file is taken into account when building one's
application using the RTEMS template Makefiles (make/templates
).
These application template Makefiles have been included with the
RTEMS source distribution since the early 1990's. However there is
a desire in the RTEMS user community to move all provided examples to
GNU autoconf. They are included in the 4.9 release series and used for
all examples provided with RTEMS. There is no definite time table for
obsoleting them. You are free to use these but be warned they have
fallen out of favor with many in the RTEMS community and may disappear
in the future.
The following is a slightly shortened version of the make customization
file for the gen68340 BSP. The original source for this file can be
found in the make/custom
directory.
# The RTEMS CPU Family and Model RTEMS_CPU=m68k RTEMS_CPU_MODEL=m68340 include $(RTEMS_ROOT)/make/custom/default.cfg # This is the actual bsp directory used during the build process. RTEMS_BSP_FAMILY=gen68340 # This contains the compiler options necessary to select the CPU model # and (hopefully) optimize for it. CPU_CFLAGS = -mcpu=cpu32 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer
The make customization files have generally grown simpler and simpler
with each RTEMS release. Beginning in the 4.9 release series, the rules
for linking an RTEMS application are shared by all BSPs. Only BSPs which
need to perform a transformation from linked ELF file to a downloadable
format have any additional actions for program link time. In 4.8 and
older, every BSP specified the "make executable" or make-exe
rule and duplicated the same actions.
It is generally easier to copy a make/custom
file from a
BSP similar to the one being developed.
BSP and Device Driver Development Guide
Copyright © 1988-2008 OAR Corporation