TOP=../..

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

# ================================================
# Build the IOC application
# ================================================
# This will attempt to build an IOC application 
# for every target including the host computer.
PROD_IOC = fcomTest

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

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

# fcomTest.dbd will be made up from these files:
fcomTest_DBD += base.dbd
fcomTest_DBD += devIocStats.dbd
fcomTest_DBD += autosaveSupport.dbd
fcomTest_DBD += caPutLog.dbd
fcomTest_DBD += $(CEXP_DBDS)

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

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

# Needed from the FCOM module
fcomTest_DBD += fcomIocshSupport.dbd
fcomTest_DBD += fcomUtil.dbd


# ======================================================================
# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
fcomTest_SRCS += fcomTest_registerRecordDeviceDriver.cpp

fcomTest_SRCS_DEFAULT += fcomTestMain.cpp

fcomTest_SRCS_vxWorks += -nil-

# ========================================================================
# ========================================================================
# Add locally compiled object code
# For example, subroutines
# ========================================================================
# fcomTest_SRCS += file1.c
# fcomTest_SRCS += file2.c

# =====================================================
# Link in the code from other libraries
# =====================================================
# Needed to link in iocAdmin support
fcomTest_LIBS += devIocStats

# Needed to link in autosave support
fcomTest_LIBS += autosave

# Needed to link caPutLog support
fcomTest_LIBS += caPutLog

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


# =============================================
# 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.
# =============================================
 fcomTest_LIBS += evrSupport
 fcomTest_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)     
       fcomTest_LIBS += mrfVme64x       
      endif
     endif
    endif
   endif
 endif

 ifeq ($(T_A),linuxRT-x86)
  fcomTest_LIBS += drvMrf
 endif

 ifeq ($(T_A),linuxRT-x86_64)
  fcomTest_LIBS += drvMrf
 endif

 ifeq ($(T_A),linuxRT_glibc-x86_64)
  fcomTest_LIBS += drvMrf
 endif

 ifeq ($(T_A),linux-x86)
  fcomTest_LIBS += drvMrf
 endif

ifeq ($(T_A),linux-x86_64)
  fcomTest_LIBS += drvMrf
endif
# =====================================================
# END EVR libraries
# =====================================================

# =================================================
# Needed for FCOM Support:
# =================================================
# order of library addition matters - add fcom last
# followed by udpCommBSD
 fcomTest_LIBS += fcomIocshSupport
 fcomTest_LIBS += fcomUtil
 fcomTest_LIBS += fcom

ifeq ($(T_A),linux-x86_64)
 fcomTest_LIBS += udpCommBSD
endif
ifeq ($(T_A),linuxRT_glibc-x86_64)
  fcomTest_LIBS += udpCommBSD
endif
# ===================================================



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

ifneq ($(SNCSEQ),)
    # This builds sncExample as a component of fcomTest
    fcomTest_SNCFLAGS += +r
    fcomTest_DBD += sncExample.dbd
    fcomTest_SRCS += sncExample.stt
    fcomTest_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

fcomTest_LIBS += $(EPICS_BASE_IOC_LIBS)

# Install Test Routines from FCOM
BIN_INSTALLS += $(FCOM_BIN)/fcometst
BIN_INSTALLS += $(FCOM_BIN)/prototst 
BIN_INSTALLS += $(FCOM_BIN)/fcomrtst
BIN_INSTALLS += $(FCOM_BIN)/fcomxtst
BIN_INSTALLS += $(FCOM_BIN)/fcomitst
BIN_INSTALLS += $(FCOM_BIN)/fcget
#=====================================

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

