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

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

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

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

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

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

# For scanner application
# Scanner_DBD += ecAsyn.dbd
# ======================================================================
# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
Scanner_SRCS += Scanner_registerRecordDeviceDriver.cpp

Scanner_SRCS_DEFAULT += ScannerMain.cpp

Scanner_SRCS_vxWorks += -nil-

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

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

# Needed to link in autosave support
Scanner_LIBS += autosave

# Needed to link caPutLog support
Scanner_LIBS += caPutLog

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

# Needed to link scanner support
# Scanner_LIBS += ecAsyn
# Scanner_LIBS += rtutils
Scanner_LIBS += scannerlib
# =============================================
# 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.
# =============================================
#  Scanner_LIBS += evrSupport
#  Scanner_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)
#        Scanner_LIBS += mrfVme64x
#       endif
#     endif
#   endif
#  endif
# endif

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

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

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

#  ifeq ($(T_A),linux-x86_64)
#   Scanner_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 Scanner
#     Scanner_SNCFLAGS += +r
#     Scanner_DBD += sncExample.dbd
#     Scanner_SRCS += sncExample.stt
#     Scanner_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

Scanner_LIBS += $(EPICS_BASE_IOC_LIBS)

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

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

# scanner.xml is installed from a file local to the app. But it should be included in the the ethercat module and installed from there.
# install:
#	$(TOP)/etc/scanner.xml

