TOP=../..

include $(TOP)/configure/CONFIG

CROSS_COMPILER_TARGET_ARCHS=RTEMS-beatnik
#----------------------------------------
#  ADD MACRO DEFINITIONS AFTER THIS LINE
#=============================

#==================================================
# Build an IOC support library

# Comment this line to build a host-ioc; you'd need to exclude
# several facilities (evr, micro, ...) for this to work.
BUILDFOR=_RTEMS

LIBRARY_IOC$(BUILDFOR) += llrf2RF01Support
LIBRARY_IOC$(BUILDFOR) += llrf2RF02Support

# bpmRecord.h will be created from bpmRecord.dbd
#DBDINC += bpmRecord
# install devBpmSoft.dbd into <top>/dbd
DBD += llrf2Support.dbd

# The following are compiled and added to the Support library
llrf2RF01Support_SRCS += drvPadUdpComm.c 
llrf2RF01Support_SRCS += devMbboOnln.c
llrf2RF01Support_SRCS += devMbboLlrf.c
llrf2RF01Support_SRCS += devBoLlrf.c
#llrf2RF01Support_SRCS += fidProcess.c
llrf2RF01Support_SRCS += drvLlrfRF01.c
llrf2RF01Support_SRCS += devAoLlrf.c
llrf2RF01Support_SRCS += devAiLlrf.c
llrf2RF01Support_SRCS += devWaveformLlrf.c
llrf2RF01Support_SRCS += dbSubLlrf.c

llrf2RF01Support_LIBS_DEFAULT += udpCommSupport
llrf2RF01Support_LIBS_RTEMS   += -nil-

llrf2RF02Support_SRCS += drvPadUdpComm.c 
llrf2RF02Support_SRCS += devMbboLlrf.c
llrf2RF02Support_SRCS += devMbboOnln.c
llrf2RF02Support_SRCS += devBoLlrf.c
llrf2RF02Support_SRCS += drvLlrfRF02.c
llrf2RF02Support_SRCS += devAoLlrf.c
llrf2RF02Support_SRCS += devAiLlrf.c
llrf2RF02Support_SRCS += devWaveformLlrf.c
llrf2RF02Support_SRCS += dbSubLlrf.c

llrf2RF02Support_LIBS_DEFAULT += udpCommSupport
llrf2RF02Support_LIBS_RTEMS   += -nil-

#=============================
# build an ioc application

PROD_IOC$(BUILDFOR) += llrf2RF01App
PROD_IOC$(BUILDFOR) += llrf2RF02App

DBD += llrf2RF01App.dbd
DBD += llrf2RF02App.dbd

# llrf2{RF01,RF02}App.dbd will be made up from these files:
llrf2RF01App_DBD += base.dbd
llrf2RF01App_DBD += llrf2Support.dbd
#include definitions for any other support applications needed
llrf2RF01App_DBD += evrSupport.dbd
llrf2RF01App_DBD += devMrfEr.dbd
llrf2RF01App_DBD += dbRestore.dbd
llrf2RF01App_DBD += iocAdmin.dbd
#llrf2RF01App_DBD += slc.dbd
#llrf2RF01App_DBD += epicsbsac.dbd
llrf2RF01App_DBD += sSubRecord.dbd

llrf2RF02App_DBD += base.dbd
llrf2RF02App_DBD += llrf2Support.dbd
#include definitions for any other support applications needed
llrf2RF02App_DBD += evrSupport.dbd
llrf2RF02App_DBD += devMrfEr.dbd
llrf2RF02App_DBD += dbRestore.dbd
llrf2RF02App_DBD += iocAdmin.dbd
#llrf2RF02App_DBD += slc.dbd
#llrf2RF02App_DBD += epicsbsac.dbd
llrf2RF02App_DBD += sSubRecord.dbd

llrf2RF01App_SRCS += llrf2RF01App_registerRecordDeviceDriver.cpp
llrf2RF01App_SRCS_DEFAULT += llrf2AppMain.c
llrf2RF01App_SRCS_RTEMS = -nil-

llrf2RF02App_SRCS += llrf2RF02App_registerRecordDeviceDriver.cpp
llrf2RF02App_SRCS_DEFAULT += llrf2AppMain.c
llrf2RF02App_SRCS_RTEMS = -nil-

llrf2RF01App_LIBS +=  llrf2RF01Support devBusMapped sSubRecord
llrf2RF02App_LIBS +=  llrf2RF02Support devBusMapped sSubRecord

EVR_IOC_LIBS += evrSupport
EVR_IOC_LIBS += generalTime
EVR_RTEMS_IOC_LIBS += devMrfEr
EVR_RTEMS_IOC_LIBS += mrfVme64x

#SLC_IOC_LIBS += slcaware
#SLC_IOC_LIBS += slcunsupported
#SLC_IOC_LIBS += epicsbsac

llrf2RF01App_LIBS_RTEMS-beatnik+= $(EVR_RTEMS_IOC_LIBS)
llrf2RF02App_LIBS_RTEMS-beatnik+= $(EVR_RTEMS_IOC_LIBS)

llrf2RF01App_LIBS += $(EVR_IOC_LIBS)
#llrf2RF01App_LIBS += iocAdmin
llrf2RF01App_LIBS += devIocStats
llrf2RF01App_LIBS += $(llrf2RF01App_LIBS_$(T_A))
llrf2RF01App_LIBS += restore
llrf2RF01App_LIBS += $(SLC_IOC_LIBS)
llrf2RF01App_LIBS += $(EPICS_BASE_IOC_LIBS)
llrf2RF01App_LIBS += miscUtils
llrf2RF01App_LIBS += sSubRecord

llrf2RF02App_LIBS += $(EVR_IOC_LIBS)
#llrf2RF02App_LIBS += iocAdmin
llrf2RF02App_LIBS += devIocStats
llrf2RF02App_LIBS += $(llrf2RF02App_LIBS_$(T_A))
llrf2RF02App_LIBS += restore
llrf2RF02App_LIBS += $(SLC_IOC_LIBS)
llrf2RF02App_LIBS += $(EPICS_BASE_IOC_LIBS)
llrf2RF02App_LIBS += miscUtils
llrf2RF02App_LIBS += sSubRecord

USR_CFLAGS += -DDEBUG_PRINT
USR_CFLAGS_DEFAULT=-DBSDSOCKET
USR_CFLAGS_RTEMS  = -I$(TOP)/include -I$(RTEMS_BASE)/

#===========================

include $(TOP)/configure/RULES
#----------------------------------------
#  ADD RULES AFTER THIS LINE

