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

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

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

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

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

# Support for CALC module:
acromagTest_DBD += calcSupport.dbd

acromagTest_DBD += busySupport.dbd
acromagTest_DBD += mcaSupport.dbd 

# ==========================================================================
# acromagTest_registerRecordDeviceDriver.cpp derives from acromagTest.dbd
# ==========================================================================
acromagTest_SRCS += acromagTest_registerRecordDeviceDriver.cpp

# =====================================================
# Build the main IOC entry point on workstation OSs.
# =====================================================
acromagTest_SRCS_DEFAULT += acromagTestMain.cpp

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

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

# Support for CALC Module:
acromagTest_LIBS += calc
acromagTest_LIBS += sscan

acromagTest_LIBS += busy 
acromagTest_LIBS += mca
# ======================================================

# ======================================================
# 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 acromagTestSupport
    sncExample_SNCFLAGS += +r
    acromagTest_DBD += sncExample.dbd
    acromagTest_SRCS += sncExample.stt
    acromagTest_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
# =====================================================
acromagTest_LIBS += $(EPICS_BASE_IOC_LIBS)

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

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

