TOP=../..

include $(TOP)/configure/CONFIG

CROSS_COMPILER_TARGET_ARCHS=linux-x86

#----------------------------------------
#  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 = chiller

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

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

# chiller.dbd will be made up from these files:
chiller_DBD += base.dbd
chiller_DBD += devIocStats.dbd
chiller_DBD += autosaveSupport.dbd
chiller_DBD += caPutLog.dbd

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

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

# streams:
chiller_DBD += asyn.dbd
chiller_DBD += asynRecord.dbd
chiller_DBD += stream.dbd
chiller_DBD += drvAsynIPPort.dbd
chiller_DBD += drvVxi11.dbd
chiller_DBD += drvAsynSerialPort.dbd

# ======================================================================
# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
chiller_SRCS += chiller_registerRecordDeviceDriver.cpp

ifneq ($(T_A),linuxRT-x86)
 chiller_SRCS_DEFAULT += chillerMain.cpp
endif

chiller_SRCS_vxWorks += -nil-

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

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

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

# Needed to link in autosave support
chiller_LIBS += autosave

# Needed to link caPutLog support
chiller_LIBS += caPutLog

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

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

# ifeq ($(T_A),linuxRT-x86)
#  chiller_LIBS += drvMrf
#  chiller_LIBS += mrfApi
# endif
 
# ifeq ($(T_A),linux-x86)
#  chiller_LIBS += drvMrf
#  chiller_LIBS += mrfApi
# endif

#add a definition for each support application used by this application
USR_SYS_LIBS += pcre

chiller_LIBS += asyn
chiller_LIBS += stream


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

# NOTE: To build SNL programs, SNCSEQ must be defined
# in the <top>/configure/RELEASE file

ifneq ($(SNCSEQ),)
    # This builds sncExample as a component of chiller
    chiller_SNCFLAGS += +r
    chiller_DBD += sncExample.dbd
    chiller_SRCS += sncExample.stt
    chiller_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

chiller_LIBS += $(EPICS_BASE_IOC_LIBS)

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

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

