TOP=../..

include $(TOP)/configure/CONFIG
#----------------------------------------
#  ADD MACRO DEFINITIONS AFTER THIS LINE
#========================================
USR_CXXFLAGS += -DHAVE_YAML -fno-delete-null-pointer-checks
# ================================================
# Build the IOC application
# ================================================
# This will attempt to build an IOC application
# for every target including the host computer.
PROD_IOC = atca

# Use the following for RTEMS Only IOCs
#PROD_IOC_RTEMS = atca

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

# atca.dbd will be made up from these files:
atca_DBD += base.dbd
atca_DBD += asyn.dbd
atca_DBD += ycpswasyn.dbd
atca_DBD += yamlLoader.dbd
atca_DBD += devIocStats.dbd
atca_DBD += asSupport.dbd
atca_DBD += caPutLog.dbd
atca_DBD += $(CEXP_DBDS)
atca_DBD += crossbarControl.dbd
atca_DBD += tprTriggerAsynDriver.dbd
atca_DBD += tprPatternAsynDriver.dbd
atca_DBD += bsaAsynDriver.dbd

atca_DBD += atcaSupport.dbd
atca_DBD += subR_laserLocker.dbd
atca_DBD += aSub_RFOF.dbd
atca_DBD += RFCommon.dbd
atca_DBD += ATCACommon.dbd
# ================================================================================
# The system command will be mainly used by linux hosted IOCs
# Very useful for changing kernel thread priorities for kernel drivers
# ================================================================================
atca_DBD += system.dbd

# If you don't have an EVR comment the following two lines:
#atca_DBD += evrSupport.dbd
#atca_DBD += devMrfEr.dbd

# ======================================================================
# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
atca_SRCS += atca_registerRecordDeviceDriver.cpp
atca_SRCS += subR_laserLocker.c
atca_SRCS += aSub_RFOF.c

atca_SRCS_DEFAULT += atcaMain.cpp

atca_SRCS_vxWorks += -nil-

# ========================================================================
# ========================================================================
# Add locally compiled object code
# For example, subroutines
# ========================================================================
atca_SRCS += DaqSizeSub.c

# =====================================================
# Link in the code from other libraries
# =====================================================
atca_LIBS += yamlLoader
atca_LIBS += ycpswasyn
atca_LIBS += asyn
#atca_LIBS += crossbarControl
atca_LIBS += tprTrigger
atca_LIBS += tprPattern
atca_LIBS += bsaDriver
atca_LIBS += ATCACommon
atca_LIBS += RFCommon
atca_LIBS += seq pv

# Needed to link in iocAdmin support
atca_LIBS += devIocStats

# Needed to link in autosave support
atca_LIBS += autosave

# Needed to link caPutLog support
atca_LIBS += caPutLog

# Needed to link cexpsh() support
atca_LIBS += $(CEXP_LIBS)

# =====================================================
# Path to "NON EPICS" External PACKAGES: USER INCLUDES
#======================================================
USR_INCLUDES = -I$(BOOST_INCLUDE) -I$(CPSW_FRAMEWORK_INCLUDE) -I$(YAML_INCLUDE)
# =====================================================

#======================================================
# PATH TO "NON EPICS" EXTERNAL PACKAGES: USER LIBRARIES
#======================================================
cpsw_DIR = $(CPSW_FRAMEWORK_LIB)
boost_system_DIR = $(BOOST_LIB)
yaml-cpp_DIR = $(YAML_LIB)
hpstpr_DIR = $(HPSTPR_LIB)
bsa_DIR = $(BSA_LIB)
commonATCA_DIR = $(COMMONATCA_LIB)
commonRF_DIR = $(COMMONRF_LIB)
# =====================================================

# ======================================================
# LINK "NON EPICS" EXTERNAL PACKAGE LIBRARIES STATICALLY
#=======================================================
USR_LIBS_Linux += cpsw boost_system yaml-cpp hpstpr bsa commonATCA commonRF
# ======================================================

# =============================================
# Begin to link in the EVR support for
# RTEMS, linux, and linuxRT
# If you don't have an EVR, you can comment out
# the lines below.
# =============================================
# atca_LIBS += evrSupport
# atca_LIBS += devMrfEr
#
#ifneq ($(T_A),linuxRT-x86)
#  ifneq ($(T_A),linuxRT-x86_64)
#   ifneq ($(T_A),linuxRT_glibc-x86_64)
#    ifneq ($(T_A),linux-x86)
#      ifneq ($(T_A),linux-x86_64)
#       atca_LIBS += mrfVme64x
#      endif
#    endif
#  endif
# endif
#endif
#
# ifeq ($(T_A),linuxRT-x86)
#  atca_LIBS += drvMrf
# endif
#
# ifeq ($(T_A),linuxRT-x86_64)
#  atca_LIBS += drvMrf
# endif
#
# ifeq ($(T_A),linuxRT_glibc-x86_64)
#  atca_LIBS += drvMrf
# endif
#
# ifeq ($(T_A),linux-x86)
#  atca_LIBS += drvMrf
# endif
#
# ifeq ($(T_A),linux-x86_64)
#  atca_LIBS += drvMrf
# endif
# =====================================================
# END EVR libraries
# =====================================================

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

#ifneq ($(SNCSEQ),)
#    # This builds sncExample as a component of atca
#    atca_SNCFLAGS += +r
#    atca_DBD += sncExample.dbd
#    atca_SRCS += sncExample.stt
#    atca_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

atca_LIBS += $(EPICS_BASE_IOC_LIBS)

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

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