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

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

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

#Include dbd files from all support applications:
dechirper_DBD += asyn.dbd
dechirper_DBD += drvAsynIPPort.dbd
dechirper_DBD += motorSupport.dbd
dechirper_DBD += motorRecord.dbd
dechirper_DBD += motorSimSupport.dbd
dechirper_DBD += devSoftMotor.dbd
dechirper_DBD += devAerotech.dbd
#dechirper_DBD += stream.dbd
dechirper_DBD += calcSupport.dbd
#dechirper_DBD+= autosave.dbd - using the autosaveSupport.dbd
# ================================================================================
# The system command will be mainly used by linux hosted IOCs
# Very useful for changing kernel thread priorities for kernel drivers
# ================================================================================
dechirper_DBD += system.dbd

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

# ======================================================================
# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
dechirper_SRCS += dechirper_registerRecordDeviceDriver.cpp

dechirper_SRCS_DEFAULT += dechirperMain.cpp

dechirper_SRCS_vxWorks += -nil-

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

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

# Needed to link in autosave support
dechirper_LIBS += autosave

# Needed to link caPutLog support
dechirper_LIBS += caPutLog

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

# Add all the support libraries needed by this IOC
dechirper_LIBS += asyn
dechirper_LIBS += motor
dechirper_LIBS += motorSimSupport
dechirper_LIBS += softMotor
dechirper_LIBS += Aerotech
#dechirper_LIBS += stream
dechirper_LIBS += calc

# =============================================
# 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.
# =============================================
 dechirper_LIBS += evrSupport
 dechirper_LIBS += devMrfEr

 ifneq ($(T_A),linuxRT-x86)
   ifneq ($(T_A),linux-x86)
     ifneq ($(T_A),linux-x86_64)
       dechirper_LIBS += mrfVme64x
     endif
   endif
 endif

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

 ifeq ($(T_A),linux-x86_64)
  dechirper_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 dechirper
    dechirper_SNCFLAGS += +r
    dechirper_DBD += sncExample.dbd
    dechirper_SRCS += sncExample.stt
    dechirper_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

dechirper_LIBS += $(EPICS_BASE_IOC_LIBS)

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

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

