TOP=../..

include $(TOP)/configure/CONFIG
#----------------------------------------
#  ADD MACRO DEFINITIONS AFTER THIS LINE
#=============================

#=============================
# Build the IOC support library

LIBRARY_IOC += TR73USupport

# xxxRecord.h will be created from xxxRecord.dbd
#DBDINC += xxxRecord

# Install devXxxSoft.dbd into <top>/dbd
#DBD += xxxSupport.dbd

# Compile and add the code to the support library
#TR73USupport_SRCS += xxxRecord.c

# Link locally-provided code into the support library,
# rather than directly into the IOC application.
#TR73USupport_SRCS += TR73UHello.c

TR73USupport_LIBS += $(EPICS_BASE_IOC_LIBS)

#=============================
# Build the IOC application

PROD_IOC = TR73U
# TR73U.dbd will be created and installed
DBD += TR73U.dbd

# TR73U.dbd will be made up from these files:
TR73U_DBD += base.dbd
TR73U_DBD += drvAsynIPPort.dbd
#TR73U_DBD += drvAsynSerialPort.dbd
#TR73U_DBD += drvVxi11.dbd

# Include dbd files from all support applications:
#TR73U_DBD += xxx.dbd

# Add all the support libraries needed by this IOC
#TR73U_LIBS += xxx

# TR73U_registerRecordDeviceDriver.cpp derives from TR73U.dbd
TR73U_SRCS += TR73U_registerRecordDeviceDriver.cpp

# Build the main IOC entry point on workstation OSs.
TR73U_SRCS_DEFAULT += TR73UMain.cpp
TR73U_SRCS_vxWorks += -nil-

# Add support from base/src/vxWorks if needed
#TR73U_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary

# Link in the code from the support library
TR73U_LIBS += TR73USupport

# NOTE: To build SNL programs, SNCSEQ must be defined
# in the <top>/configure/RELEASE file
ifneq ($(SNCSEQ),)
    # Build sncExample into TR73USupport
    sncExample_SNCFLAGS += +r
    TR73U_DBD += sncTR73U.dbd
    TR73USupport_SRCS += sncTR73U.stt
    TR73USupport_LIBS += seq pv
    TR73U_LIBS += seq pv

    # Build sncProgram as a standalone program
    PROD_HOST += sncProgram
    sncProgram_SNCFLAGS += +m
    sncProgram_SRCS += sncProgram.st
    sncProgram_LIBS += seq pv
    sncProgram_LIBS += $(EPICS_BASE_HOST_LIBS)
endif

# NOTE: To build programs, ASYN & STREAM must be defined
# in the <top>/configure/RELEASE file
ifneq ($(ASYN),)
    TR73U_DBD += asyn.dbd
#    TR73U_DBD += drvAsynIPPort.dbd		# IP Port Driver
#    TR73U_DBD += drvAsynSerialPort.dbd	# Serial Port Driver
    TR73U_LIBS += asyn

    ifneq ($(STREAM),)
        TR73U_DBD += stream.dbd
        TR73U_LIBS += stream
    endif
endif

# NOTE: To build programs, NETDEV must be defined
# in the <top>/configure/RELEASE file
ifneq ($(NETDEV),)
    TR73U_DBD += netDev.dbd
    TR73U_LIBS += netDev
endif

# Finally link to the EPICS Base libraries
TR73U_LIBS += $(EPICS_BASE_IOC_LIBS)

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

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

