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

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

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

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

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

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

# ======================================================================
# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
MyTest_SRCS += MyTest_registerRecordDeviceDriver.cpp

MyTest_SRCS_DEFAULT += MyTestMain.cpp

MyTest_SRCS_vxWorks += -nil-

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

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

# Needed to link in autosave support
MyTest_LIBS += autosave

# Needed to link caPutLog support
MyTest_LIBS += caPutLog

# Needed to link cexpsh() support
MyTest_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.
# =============================================
 MyTest_LIBS += evrSupport
 MyTest_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)
       MyTest_LIBS += mrfVme64x
      endif
    endif
  endif
 endif
endif

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

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

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

 ifeq ($(T_A),linux-x86_64)
  MyTest_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 MyTest
    MyTest_SNCFLAGS += +r
    MyTest_DBD += sncExample.dbd
    MyTest_SRCS += sncExample.stt
    MyTest_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

MyTest_LIBS += $(EPICS_BASE_IOC_LIBS)

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

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

