#==============================================================
#
#  Abs:  Makefile to build EPICS PPS Application
#
#  Name: Makefile
#
#  Facility:  EED Personnel Protection (PPS)
#
#  Auth: 17-Aug-2020, K. Luchini          (LUCHINI)
#  Rev:  dd-mmm-yyyy, Reviewer's Name     (USERNAME)
#--------------------------------------------------------------
#  Mod:
#        dd-mmm-yyyy, First Lastname      (USERNAME):
#          comment
#
#--------------------------------------------------------------
#
TOP=../..
include $(TOP)/configure/CONFIG
#----------------------------------------
#  ADD MACRO DEFINITIONS AFTER THIS LINE
#========================================

# =============================
# build an ioc application
# =============================
PROD_IOC_Linux  = ppsSoft

# Compiler flags
USR_CFLAGS_DEFAULT += -DHOST_TEST -g
USR_CFLAGS         += -DUSE_TYPED_RSET -DUSE_TYPED_DSET -DUSE_TYPED_DRVET

# The dbd will be made up from these files:
DBD = ppsSoft.dbd
PPS_DBD_Linux += base.dbd
PPS_DBD_Linux += iocAdmin.dbd
PPS_DBD_Linux += caPutLog.dbd
PPS_DBD_Linux += autosaveSupport.dbd

# Ethernet and serial devices
PPS_DBD_Linux += drvBkhAsyn.dbd
PPS_DBD_Linux += drvMBus.dbd
PPS_DBD_Linux += drvBkhErr.dbd 
PPS_DBD_Linux += drvBkhAMot.dbd
PPS_DBD_Linux += s7plcLib.dbd
PPS_DBD_Linux += ether_ip.dbd
PPS_DBD_Linux += modbusSupport.dbd
PPS_DBD_Linux += asyn.dbd
PPS_DBD_Linux += stream.dbd
PPS_DBD_Linux += drvAsynIPPort.dbd

# modBus support
PPS_DBD_Linux += ModBusTCPClnt.dbd
PPS_DBD_Linux += Bk9000_MBT.dbd

# Linux dbd
ppsSoft_DBD   += $(PPS_DBD_Linux) system.dbd

# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
USR_SRCS_DEFAULT  += ppsMain.cpp
ppsSoft_SRCS      += ppsSoft_registerRecordDeviceDriver.cpp

# Note: order of libraries for the event system is very important.
USR_LIBS += devIocStats
USR_LIBS += caPutLog
USR_LIBS += ether_ip

USR_LIBS += s7plcLib
USR_LIBS += autosave
USR_LIBS += Bk9000_MBT
USR_LIBS += ModBusTCPClnt
USR_LIBS += modbus
USR_LIBS += asyn
USR_LIBS += stream
USR_LIBS += bkhAsyn bkhErr bkhMBus 
USR_LIBS += bkhMot

USR_LIBS  += $(EPICS_BASE_IOC_LIBS)

# Needed for static builds and stream device
USR_SYS_LIBS += pcre

#=============================
include $(TOP)/configure/RULES
#-----------------------------
#  ADD RULES AFTER THIS LINE
#=============================
# End of file
