TOP=../..

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

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

ifeq ($(T_A),linux-f3rp61)

LIBRARY_IOC += testSupport

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

# Link locally-provided code into the support library,
# rather than directly into the IOC application.
testSupport_SRCS += dbSubExample.c
testSupport_SRCS += testHello.c
testSupport_SRCS += initTrace.c

testSupport_LIBS += $(EPICS_BASE_IOC_LIBS)

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

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

# test.dbd will be made up from these files:
test_DBD += base.dbd
test_DBD += xxxSupport.dbd
test_DBD += dbSubExample.dbd
test_DBD += testHello.dbd
test_DBD += initTrace.dbd
test_DBD += f3rp61.dbd

# test_registerRecordDeviceDriver.cpp derives from test.dbd
test_SRCS += test_registerRecordDeviceDriver.cpp

# Build the main IOC entry point on workstation OSs.
test_SRCS_DEFAULT += testMain.cpp
test_SRCS_vxWorks += -nil-

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

# Link in the code from the support library
test_LIBS += testSupport

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

ifneq ($(SNCSEQ),)
    # Build sncExample into testSupport
    sncExample_SNCFLAGS += +r
    test_DBD += sncExample.dbd
    testSupport_SRCS += sncExample.stt
    testSupport_LIBS += seq pv
    test_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

test_LIBS += f3rp61
PROD_LDLIBS += -lm3
USR_LDFLAGS += -L/opt/bsp/yokogawa/library

test_LIBS += $(EPICS_BASE_IOC_LIBS)

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

endif

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

