TOP=../..

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

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

LIBRARY_IOC += compilerSupport

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

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

compilerSupport_LIBS += $(EPICS_BASE_IOC_LIBS)

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

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

# compiler.dbd will be made up from these files:
compiler_DBD += base.dbd
compiler_DBD += xxxSupport.dbd
compiler_DBD += dbSubExample.dbd
compiler_DBD += compilerHello.dbd
compiler_DBD += initTrace.dbd

# compiler_registerRecordDeviceDriver.cpp derives from compiler.dbd
compiler_SRCS += compiler_registerRecordDeviceDriver.cpp

# Build the main IOC entry point on workstation OSs.
compiler_SRCS_DEFAULT += compilerMain.cpp
compiler_SRCS_vxWorks += -nil-

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

# Link in the code from the support library
compiler_LIBS += compilerSupport

BIN_INSTALLS_vxWorks += compiler_bug.o
# NOTE: To build SNL programs, SNCSEQ must be defined
# in the <top>/configure/RELEASE file

ifneq ($(SNCSEQ),)
    # Build sncExample into compilerSupport
    sncExample_SNCFLAGS += +r
    compiler_DBD += sncExample.dbd
    compilerSupport_SRCS += sncExample.stt
    compilerSupport_LIBS += seq pv
    compiler_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
compiler_LIBS += $(EPICS_BASE_IOC_LIBS)

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

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

