TOP=../..

include $(TOP)/configure/CONFIG

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

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

# MKSRGA.dbd will be made up from these files:
MKSRGA_DBD += base.dbd
MKSRGA_DBD += asyn.dbd
MKSRGA_DBD += stream.dbd
MKSRGA_DBD += drvAsynIPPort.dbd
MKSRGA_DBD += drvAsynSerialPort.dbd
MKSRGA_DBD += calcSupport.dbd
MKSRGA_DBD += sCalcoutRecord.dbd

# MKSRGA_registerRecordDeviceDriver.cpp derives from MKSRGA.dbd
MKSRGA_SRCS += MKSRGA_registerRecordDeviceDriver.cpp

# Build the main IOC entry point on workstation OSs.
MKSRGA_SRCS_DEFAULT += MKSRGAMain.cpp
MKSRGA_SRCS_vxWorks += -nil-

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

# Link in the code from the support library
MKSRGA_LIBS += asyn stream

# for scalc
MKSRGA_LIBS  += calc

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

ifneq ($(SNCSEQ),)
    # Build sncExample into MKSRGASupport
    MKSRGA_SNCFLAGS += +r
    MKSRGA_DBD += sncScan.dbd
    MKSRGA_SRCS += sncScan.stt
    MKSRGA_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

#Adding support for subroutines 
MKSRGA_DBD +=  routineDbd.dbd
MKSRGA_SRCS += inputData.c

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

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

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

