TOP=../..

include $(TOP)/configure/CONFIG
#----------------------------------------
#  ADD MACRO DEFINITIONS AFTER THIS LINE
#========================================

# ================================================
# Build the IOC application
# ================================================
#
#SRC_DIRS += $(TOP)/CryoplantApp/src

# This will attempt to build an IOC application 
# for every target including the host computer.
PROD_IOC_Linux = cryoplant

# ========================================================================
# Add locally compiled object code
# For example, subroutines
# ========================================================================
cryoplant_SRCS += cclmom.c
cryoplant_SRCS += ln2_consumption.c

# cryoplant.dbd will be created and installed
DBD += cryoplant.dbd

# cryoplant.dbd will be made up from these files:
cryoplant_DBD += base.dbd
cryoplant_DBD += devIocStats.dbd
cryoplant_DBD += asSupport.dbd
cryoplant_DBD += ether_ip.dbd
cryoplant_DBD += cclmom.dbd
cryoplant_DBD += ln2_consumption.dbd
cryoplant_DBD += caPutLog.dbd
#cryoplant_DBD += drvEtherIP.dbd
cryoplant_DBD += PVAServerRegister.dbd
cryoplant_DBD += qsrv.dbd
cryoplant_DBD += system.dbd

# ======================================================================
# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
cryoplant_SRCS += cryoplant_registerRecordDeviceDriver.cpp

ifneq ($(T_A),linuxRT-x86)
 cryoplant_SRCS_DEFAULT += cryoplantMain.cpp
endif
cryoplant_SRCS_vxWorks += -nil-

#ifeq ($(T_A),linuxRT-x86)
#cryoplant_SRCS_DEFAULT += cryoplantlinuxRT_Main_.cpp
#cryoplant_SRCS += systemCommand.c
#endif
# ========================================================================
# The following adds support from base/src/vxWorks
# cryoplant_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary

# =====================================================
# Link in the code from other libraries
# =====================================================
#
# iocAdmin
cryoplant_LIBS += devIocStats 
# autosave
cryoplant_LIBS += autosave
# ether-ip
cryoplant_LIBS += ether_ip
# caPutLog 
cryoplant_LIBS += caPutLog
# qsrv
cryoplant_LIBS += qsrv
#
# EPICS_BASE_PVA_CORE_LIBS comes from pvAccessCPP and is defined at <>/cfg/CONFIG_PVACCESS_MODULE
#
cryoplant_LIBS += $(EPICS_BASE_PVA_CORE_LIBS)

cryoplant_LIBS += $(EPICS_BASE_IOC_LIBS)
#
# =====================================================

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

ifneq ($(SNCSEQ),)
    # This builds sncExample as a component of cryoplant
    cryoplant_SNCFLAGS += +r
#    cryoplant_DBD += sncExample.dbd
#    cryoplant_SRCS += sncExample.stt
    cryoplant_LIBS += seq pv

    # The following builds sncProgram as a standalone application
#  ifneq ($(T_A),linuxRT-x86)
#    PROD_HOST += sncProgram
#    sncProgram_SNCFLAGS += +m
#    sncProgram_SRCS += sncProgram.st
#    sncProgram_LIBS += seq pv
#    sncProgram_LIBS += $(EPICS_BASE_HOST_LIBS)
#  endif
endif
# epics base libs
cryoplant_LIBS += $(EPICS_BASE_IOC_LIBS)

# Needed for static builds and stream device
ifeq ($(T_A),linux-x86)
USR_SYS_LIBS += pcre
endif


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

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

