#==============================================================
#
#  Abs:  Makefile to build EPICS ACR Cud Control Application
#
#  Name: Makefile
#
#  Desc: This file generates a database definition file
#        file for a soft ioc cud.dbd and the binary cud.obj
#
#  Facility:  SLAC Cud Controls
#
#  Auth: dd-mmm-yyyy, Author's Name       (USERNAME)
#  Rev:  dd-mmm-yyyy, Reviewer's Name     (USERNAME)
#--------------------------------------------------------------
#  Mod:
#       09-Oct-2019, K. Luchini           (LUCHINI):
#         add header
#         remove V7 app versioning as it the incldue
#         file is missing and I can't find any information
#         on the EPICS web site to describe how this is done.
#
#==============================================================
#
TOP=../..
include $(TOP)/configure/CONFIG
#----------------------------------------
#  ADD MACRO DEFINITIONS AFTER THIS LINE
#=========================================

# build an ioc application
PROD_IOC_Linux = cud

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

# cud.dbd will be made up from these files:
cud_DBD  += base.dbd
cud_DBD  += iocAdmin.dbd
cud_DBD  += asSupport.dbd
cud_DBD  += caPutLog.dbd
cud_DBD  += calcSupport.dbd
cud_DBD  += sscanSupport.dbd
cud_DBD  += sCalcoutRecord.dbd
cud_DBD  += devCudControlVersion.dbd

# For EPICS PVA: 
cud_DBD  += PVAServerRegister.dbd

# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
cud_SRCS         += cud_registerRecordDeviceDriver.cpp
cud_SRCS_DEFAULT += cudMain.cpp
cud_SRCS         += devCudControlVersion.c

# ===========================================================
# Auto-generate a header file containing a version string.
# ===========================================================
# Version comes from the VCS if available, else date+time.
GENVERSION = CudControlVersion.h
# Macro name
GENVERSIONMACRO = CudControlVERSION

# Include libraries
# Order MATTERS!
cud_LIBS += devIocStats
cud_LIBS += autosave
cud_LIBS += caPutLog
cud_LIBS += calc
cud_LIBS += sscan

# =================================================================
# NOTE: To build SNL programs, SNCSEQ must be defined
# in the <top>/configure/RELEASE file
# =================================================================
ifneq ($(SNCSEQ),)
   cud_SNCFLAGS += +r
   cud_LIBS     += seq pv
endif

cud_LIBS += $(EPICS_BASE_PVA_CORE_LIBS)
cud_LIBS += $(EPICS_BASE_IOC_LIBS)

include $(TOP)/configure/RULES
#----------------------------------------
#  ADD RULES AFTER THIS LINE
#========================================
#
# Explicit dependency needed for generated header file
devCudControlVersion$(DEP): $(COMMON_DIR)/$(GENVERSION)

# End of file


