TOP=../..

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

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

LIBRARY_IOC += trbSupport

# 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
#trbSupport_SRCS += xxxRecord.c
#trbSupport_SRCS += devXxxSoft.c

# Link locally-provided code into the support library,
# rather than directly into the IOC application.
trbSupport_SRCS += trbSub.c
trbSupport_SRCS += trbHello.c
trbSupport_SRCS += initTrace.c

trbSupport_LIBS += $(EPICS_BASE_IOC_LIBS)

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

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

# trb.dbd will be made up from these files:
trb_DBD += base.dbd
#trb_DBD += xxxSupport.dbd
trb_DBD += trbSub.dbd
trb_DBD += trbHello.dbd
trb_DBD += initTrace.dbd

# trb_registerRecordDeviceDriver.cpp derives from trb.dbd
trb_SRCS += trb_registerRecordDeviceDriver.cpp

# Build the main IOC entry point on workstation OSs.
trb_SRCS_DEFAULT += trbMain.cpp
trb_SRCS_vxWorks += -nil-

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

# Link in the code from the support library
trb_LIBS += trbSupport trbnet
#trb_LIBS += /home/hadaq/trbsoft/trbnetd/libtrbnet.a
#trb_LDFLAGS_Linux += -L/home/hadaq/trbsoft/trbnetd -ltrbnet

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

ifneq ($(SNCSEQ),)
    # Build sncExample into trbSupport
    sncExample_SNCFLAGS += +r
    trb_DBD += sncExample.dbd
    trbSupport_SRCS += sncExample.stt
    trbSupport_LIBS += seq pv
    trb_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

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

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

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

