Thanks again for the suggestion! The following is what works for me.
I have files:
unix.dbd ( has base.dbd and common stuff)
appInclude.dbd ( has unix.dbd )
vxworksInclude.dbd ( has unix.dbd and vxworksOnly stuff )
rtemsInclude.dbd (has unix.dbd and rtemsOnly stuff)
Makefile has the following:
# <name>_registerRecordDeviceDriver.cpp is created from <name>.dbd
app_SRCS_DEFAULT += unix_registerRecordDeviceDriver.cpp
app_SRCS_RTEMS += rtems_registerRecordDeviceDriver.cpp
app_SRCS_vxWorks += vxworks_registerRecordDeviceDriver.cpp
app_SRCS_DEFAULT += appMain.cpp
app_LIBS += $(EPICS_BASE_IOC_LIBS)
DBD += app.db vxworks.db rtems.db
My st.cmd for my vxworks ioc will use:
# load module for <app>
ld< appV/bin/mv2700/app.munch
# Register all support components for <app>
dbLoadDatabase ("appV/dbd/vxworks.dbd")
vxworks_registerRecordDeviceDriver(pdbbase)
My st.cmd for my rtems ioc will use:
# load module for <app>
ld< appV/bin/RTEMS-pc386/app.obj
# Register all support components for <app>
dbLoadDatabase ("appV/dbd/rtems.dbd")
rtems_registerRecordDeviceDriver(pdbbase)
Andrew Johnson wrote:
I have an application that will run on a vxWorks ioc and an RTEMS
ioc. Obviously, there are some functions that are peculiar to
vxWorks.
The Makefile Definitions allow for this by using <app>_SRCS_<osclass>
or vxWorksOnly_SRCS etc. But is there a
tag or definition for the DBD files that would differentiate between
vxWorks and RTEMS?
I'm using Epics 3.14.8.2.
DBD files are universal, meaning that we don't create a separate expanded DBD file for each target architecture we're building for; in fact they get expanded inside the O.Common directory which all arch's use. If you have some DBD entries that are specific to a particular architecture, you've going to have to create a seperate expanded DBD file for that arch. However this isn't generally as hard as it might seem, since you can use variable substitutions in the Makefile to create the various different versions without duplicating everything. Here's an example snippet, untested though since I'm at home right now:
PROD_IOC = app
DBD += unix.dbd rtems.dbd vxworks.dbd
common_DBD += base.dbd
common_DBD += allArchs.dbd
unix_DBD += $(common_DBD)
unix_DBD += unixOnly.dbd
rtems_DBD += $(common_DBD)
rtems_DBD += rtemsOnly.dbd
vxworks_DBD += $(common_DBD)
vxworks_DBD += vxworksOnly.dbd
# <name>_registerRecordDeviceDriver.cpp is created from <name>.dbd
app_SRCS_DEFAULT += unix_registerRecordDeviceDriver.cpp
app_SRCS_RTEMS += rtems_registerRecordDeviceDriver.cpp
app_SRCS_vxWorks += vxworks_registerRecordDeviceDriver.cpp
app_SRCS_DEFAULT += appMain.cpp
app_LIBS += $(EPICS_BASE_IOC_LIBS)
HTH,
- Andrew