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 += bldTest

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

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

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

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

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

bldTest_DBD += bldClient.dbd

# ======================================================================
# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
bldTest_SRCS += bldTest_registerRecordDeviceDriver.cpp
bldTest_SRCS += bldNetworkClientTest.cpp
bldTest_SRCS_DEFAULT += bldTestMain.cpp

bldTest_SRCS_vxWorks += -nil-

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

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

# Needed to link in autosave support
bldTest_LIBS += autosave

# Needed to link caPutLog support
bldTest_LIBS += caPutLog

# Needed to link cexpsh() support
bldTest_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.
# =============================================
 bldTest_LIBS += evrSupport
 bldTest_LIBS += devMrfEr

 ifneq ($(T_A),linuxRT-x86)
   ifneq ($(T_A),linuxRT-x86_64) 
     ifneq ($(T_A),linux-x86)
       ifneq ($(T_A),linux-x86_64)
         bldTest_LIBS += mrfVme64x
       endif
     endif
   endif   
 endif
 
 ifeq ($(T_A),linuxRT-x86_64)
  bldTest_LIBS += drvMrf
 endif 

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

 ifeq ($(T_A),linux-x86_64)
  bldTest_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 bldTest
    bldTest_SNCFLAGS += +r
    bldTest_DBD += sncExample.dbd
    bldTest_SRCS += sncExample.stt
    bldTest_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

bldTest_LIBS += bldClient

bldTest_LIBS += $(EPICS_BASE_IOC_LIBS)

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

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

