TOP=../..

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

#==================================================
# Build an IOC support library

LIBRARY_IOC += xxxSupport

# xxxRecord.h will be created from xxxRecord.dbd
DBDINC += xxxRecord
# install devXxxSoft.dbd into <top>/dbd
DBD += xxxSupport.dbd

# The following are compiled and added to the Support library
xxxSupport_SRCS += xxxRecord.c
xxxSupport_SRCS += devXxxSoft.c

xxxSupport_LIBS += $(EPICS_BASE_IOC_LIBS)

#=============================
# build an ioc application

PROD_IOC_RTEMS = muon
# muon.dbd will be created and installed
DBD += muon.dbd

# muon.dbd will be made up from these files:
muon_DBD += base.dbd
muon_DBD += xxxSupport.dbd
muon_DBD += dbSubExample.dbd
muon_DBD += muonHello.dbd
#muon_DBD += initTrace.dbd
#muon_DBD += pvlistServer.dbd

# I will now dynamically load the RTEMS Spy Utility; check my st.cmd file.
##muon_DBD += spy.dbd
muon_DBD += iocAdmin.dbd

# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
muon_SRCS += muon_registerRecordDeviceDriver.cpp
muon_SRCS_DEFAULT += muonMain.cpp
muon_SRCS_vxWorks += -nil-

# Add locally compiled object code
muon_SRCS += dbSubExample.c
muon_SRCS += muonHello.c

# This only in EPICS R3.14.10
#muon_SRCS += initTrace.c

# The following will get rid of the
# Unresolved symbol: rtemsTicksPerSecond_double
# That occurs at run time under EPICS 3.14.10
ifeq ($(OS_CLASS),RTEMS)
#muon_SRCS += init-epics-ticks.cc
#muon_SRCS += ntpProvider.cc
endif

# The following adds support from base/src/vxWorks
muon_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary

muon_LIBS += xxxSupport
#muon_LIBS += pvlistServer
muon_LIBS += fcomBSD 

ifeq ($(OS_CLASS),RTEMS)
# I will now dynamically load the RTEMS Spy Utility; check my st.cmd file.
##muon_LIBS += rtemsutils
muon_LIBS += devIocStats
endif

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

ifneq ($(SNCSEQ),)
    # This builds sncExample as a component of muon
    muon_SNCFLAGS += +r
    muon_DBD += sncExample.dbd
    muon_SRCS += sncExample.stt
    muon_LIBS += seq pv

    # The following builds sncProgram as a standalone application
    PROD_HOST += sncProgram
    sncProgram_SNCFLAGS += +m
    sncProgram_SRCS += sncProgram.st
    sncProgram_LIBS += seq pv
    sncProgram_LIBS += $(EPICS_BASE_HOST_LIBS)
endif

muon_LIBS += $(EPICS_BASE_IOC_LIBS)

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

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

