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 = llrf

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

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

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

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

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

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

llrf_SRCS_DEFAULT += llrfMain.cpp

llrf_SRCS_vxWorks += -nil-

# ========================================================================
# ========================================================================
# Add locally compiled object code
# For example, subroutines
# ========================================================================


# =====================================================
# Link in the code from other libraries
# =====================================================
llrf_LIBS += yamlLoader
llrf_LIBS += tprTrigger
llrf_LIBS += tprPattern
llrf_LIBS += bsaDriver
llrf_LIBS += ATCACommon
llrf_LIBS += RFCommon
llrf_LIBS += llrfHlsAsyn
llrf_LIBS += asyn
# llrf_LIBS += seq pv

# Needed to link in iocAdmin support
llrf_LIBS += devIocStats

# Needed to link in autosave support
llrf_LIBS += autosave

# Needed to link caPutLog support
llrf_LIBS += caPutLog

# Needed to link cexpsh() support
llrf_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)
llrfHls_DIR = $(LLRFHLS_LIB)
commonRF_DIR = $(COMMONRF_LIB)
# =====================================================

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

# =============================================
# 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.
# =============================================
# llrf_LIBS += evrSupport
# llrf_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)
#       llrf_LIBS += mrfVme64x
#      endif
#    endif
#  endif
# endif
#endif
#
# ifeq ($(T_A),linuxRT-x86)
#  llrf_LIBS += drvMrf
# endif
#
# ifeq ($(T_A),linuxRT-x86_64)
#  llrf_LIBS += drvMrf
# endif
#
# ifeq ($(T_A),linuxRT_glibc-x86_64)
#  llrf_LIBS += drvMrf
# endif
#
# ifeq ($(T_A),linux-x86)
#  llrf_LIBS += drvMrf
# endif
#
# ifeq ($(T_A),linux-x86_64)
#  llrf_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
#    llrf_SNCFLAGS += +r
#    llrf_DBD += sncExample.dbd
#    llrf_SRCS += sncExample.stt
#    llrf_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

llrf_LIBS += $(EPICS_BASE_IOC_LIBS)

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

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