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

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

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

# amc520tool.dbd will be made up from these files:
amc520tool_DBD += base.dbd
amc520tool_DBD += devIocStats.dbd
amc520tool_DBD += autosave.dbd
amc520tool_DBD += caPutLog.dbd

ifeq ($(T_A),linuxRT-x86)
 amc520tool_DBD += systemCommand.dbd
endif

# If you have an EVR uncomment the following two lines:
# amc520tool_DBD += evrSupport.dbd
# amc520tool_DBD += devMrfEr.dbd

# ======================================================================
# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
amc520tool_SRCS += amc520tool_registerRecordDeviceDriver.cpp

ifneq ($(T_A),linuxRT-x86)
 amc520tool_SRCS_DEFAULT += amc520toolMain.cpp
endif

amc520tool_SRCS_vxWorks += -nil-

ifeq ($(T_A),linuxRT-x86)
amc520tool_SRCS_DEFAULT += amc520tool_linuxRT_Main_.cpp
amc520tool_SRCS += systemCommand.c
endif
# ========================================================================
# ========================================================================
# Add locally compiled object code
# For example, subroutines
# ========================================================================
# amc520tool_SRCS += file1.c
# amc520tool_SRCS += file2.c

# The following adds support from base/src/vxWorks
# amc520tool_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary

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

# Needed to link in autosave support
amc520tool_LIBS += autosave

# Needed to link caPutLog support
amc520tool_LIBS += caPutLog

# ===================================
# Needed to link in the EVR support
# ===================================
# amc520tool_LIBS += evrSupport
# amc520tool_LIBS += devMrfEr

# ifneq ($(T_A),linuxRT-x86)
#  amc520tool_LIBS += mrfVme64x
# endif

# ifeq ($(T_A),linuxRT-x86)
#  amc520tool_LIBS += drvMrf
#  amc520tool_LIBS += mrfApi
# 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 amc520tool
    amc520tool_SNCFLAGS += +r
    amc520tool_DBD += sncExample.dbd
    amc520tool_SRCS += sncExample.stt
    amc520tool_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

amc520tool_LIBS += $(EPICS_BASE_IOC_LIBS)

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

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

