TOP=../..
include $(TOP)/configure/CONFIG

#-------------------------------------------------
#  ADD MACRO DEFINITIONS AFTER THIS LINE
#-------------------------------------------------

# ================================================
# Build the IOC application
# ================================================
PROD_IOC_RTEMS = beamDiagTest
# beamDiagTest.dbd will be created and installed
DBD += beamDiagTest.dbd

# beamDiagTest.dbd will be made up from these files:
beamDiagTest_DBD += base.dbd
beamDiagTest_DBD += evrSupport.dbd
beamDiagTest_DBD += devMrfEr.dbd
beamDiagTest_DBD += devIocStats.dbd
beamDiagTest_DBD += autosave.dbd

# Adding in support for Acromag I/O
beamDiagTest_DBD += asyn.dbd
beamDiagTest_DBD += drvIpac.dbd
beamDiagTest_DBD += ip330Support.dbd
beamDiagTest_DBD += ip231.dbd
beamDiagTest_DBD += ip440.dbd
beamDiagTest_DBD += ip445.dbd

# Support for SIS3350 4-Channel Waveform Digitizer:
beamDiagTest_DBD += calcSupport.dbd
beamDiagTest_DBD += drvSis3350.dbd

# ==========================================================================
# beamDiagTest_registerRecordDeviceDriver.cpp derives from beamDiagTest.dbd
# ==========================================================================
beamDiagTest_SRCS += beamDiagTest_registerRecordDeviceDriver.cpp

# =====================================================
# Build the main IOC entry point on workstation OSs.
# =====================================================
beamDiagTest_SRCS_DEFAULT += beamDiagTestMain.cpp

# =====================================================
# Link in the code from other libraries
# =====================================================
beamDiagTest_LIBS += evrSupport
beamDiagTest_LIBS += devMrfEr
beamDiagTest_LIBS += mrfVme64x
beamDiagTest_LIBS += devIocStats
beamDiagTest_LIBS += autosave

# Adding in support for Acromag I/O
beamDiagTest_LIBS += ip330
beamDiagTest_LIBS += ip231
beamDiagTest_LIBS += ip440
beamDiagTest_LIBS += ip445
beamDiagTest_LIBS += Ipac
beamDiagTest_LIBS += asyn

# Support for SIS3350 4-Channel Waveform Digitizer:
beamDiagTest_LIBS += sis3350
beamDiagTest_LIBS += calc
beamDiagTest_LIBS += sscan
# ======================================================

# ======================================================
# Let's install some external modules that we will
# load dynamically via out st.cmd file
# This allows us to only load what is necessary for each
# IOC.
# Here we will copy over the RTEMS Spy Utility into our
# IOC Application
# ======================================================
BIN_INSTALLS_RTEMS += $(RTEMSUTILS_BIN)/rtemsUtilsSup.obj
DBD_INSTALLS += $(RTEMSUTILS)/dbd/rtemsUtilsSup.dbd
# ======================================================


# ======================================================
# NOTE: To build SNL programs, SNCSEQ must be defined
# in the <top>/configure/RELEASE file
# ======================================================

ifneq ($(SNCSEQ),)
    # Build sncExample into beamDiagTestSupport
    sncExample_SNCFLAGS += +r
    beamDiagTest_DBD += sncExample.dbd
    beamDiagTest_SRCS += sncExample.stt
    beamDiagTest_LIBS += seq pv

    # Build sncProgram as a standalone program
    PROD_HOST += sncProgram
    sncProgram_SNCFLAGS += +m
    sncProgram_SRCS += sncProgram.st
    sncProgram_LIBS += seq pv
    sncProgram_LIBS += $(EPICS_BASE_HOST_LIBS)
endif

# =====================================================
# Finally link to the EPICS Base libraries
# =====================================================
beamDiagTest_LIBS += $(EPICS_BASE_IOC_LIBS)

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

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

