#==============================================================
#
#  Abs:  Makefile to build EPICS Database components
#
#  Name: Makefile
#
#  Facility: LCLS Magnet Controls
#
#  Auth: 03-Sep-2006, Kristi Luchini  (USERNAME)
#  Rev:  dd-mmm-yyyy, First Lastname  (USERNAME)
#--------------------------------------------------------------
#  Mod:
#        26-Feb-2016, K. Luchini      (LUCHINI):
#           remove mgnt_string_ctrl2.template
#           remove mgnt_string_status2.template
#        24-Sep-2015, K. Luchini      (LUCHINI):
#           install of mgnt_string_status2.template
#           install of mgnt_string_ctrl2.template
#        19-Aug-2015, K. Luchini      (LUCHINI):
#           remove install of mgnt_epsc_rev.template
#        18-Jan-2012, K. Luchini      (LUCHINI):
#           remove baseSecurity.acf for epics R3.14.12
#           add USR_DBFLAGS
#        25-Oct-2011, K. Luchini      (LUCHINI):
#           install bkhf-9000.db
#        07-Sep-2011, K. Luchini      (LUCHINI):
#           add mgnt_beckhoff_ps.db
#        30-Jun-2011, K. Luchini      (LUCHINI):
#           add mgnt_mcor12_linac.template
#        11-Aug-2010, K. Luchini      (LUCHINI):
#           remove mgnt_slc.db, no longer used
#        02-Jun-2010, K. Luchini      (LUCHINI):
#           temp install mgnt_smps_fbck.db
#        12-Mar-2010, K. Luchini      (LUCHINI):
#           install mgnt_intermediate_rev.db for 50b1 and li21 q21301
#        26-Jan-2010, K. Luchini      (LUCHINI):
#           add common files for Linac Alcove
#           Corrector and QE magnets
#        23-Sep-2009, K. Luchini      (LUCHINI):
#           install iocAdminRTEMS.db, iocAdminSoft.db
#           and iocRelease.db
#           remove iocAdmin.db
#        24-Feb-2009, K. Luchini      (LUCHINI):
#           remove slc-aware db
#        17-Dec-2008, K. Luchini      (LUCHINI):
#           install slc_model.template
#        07-Dec-2008, K. Luchini      (LUCHINI):
#          add mgnt_string_slave_notrims.db
#        06-Oct-2008, K. Luchini      (LUCHINI):
#          add mgnt_string_ctrl2.template and mgnt_string_status2.template
#        16-Sep-2008, K. Luchini      (LUCHINI):
#          add mgnt_pattern.substitutions
#          add mgnt_linac_mcor.substitutions
#        20-Aug-2008, K. Luchini      (LUCHINI):
#          remove deprecated db mgnt_plc_kick
#        12-Mar-2008, K. Luchini      (LUCHINI):
#          chg location of TOP
#        08-Aug-2008, K. Luchini      (LUCHINI):
#          removed mgnt_adc.db and mgnt_adc.db
#        23-Jul-2007, K. Luchini      (LUCHINI):
#          comment out AUTOSAVE
#          replace iocMon with iocAdmin
#        14-May-2007, K. Luchini      (LUCHINI):
#          add mgnt_dac.db,mgnt_adc.db and mgnt_epsc_dev.db
#        09-May-2007, K. Luchini      (LUCHINI):
#          replace stats db with iocMon.db
#        02-May-2007, K. Luchini      (LUCHINI):
#          add vsam templates
#        01-May-2007, K. Luchini      (LUCHINI):
#          add save_restoreStatus.db
#
#==============================================================
#
TOP=../../..
include $(TOP)/configure/CONFIG
#----------------------------------------
#  ADD MACRO DEFINITIONS AFTER THIS LINE

#----------------------------------------------------
#  Optimization of db files using dbst (DEFAULT: NO)
#DB_OPT = YES.
USR_DBFLAGS += -I../O.Common

#----------------------------------------------------
# Create and install (or just install) into <top>/db
# databases, templates, substitutions like this
#
# For iocAdmin database
DB_INSTALLS       += $(IOCADMIN)/db/iocAdminRTEMS.db
DB_INSTALLS       += $(IOCADMIN)/db/iocAdminSoft.db
DB_INSTALLS       += $(IOCADMIN)/db/access.db
DB_INSTALLS       += $(IOCADMIN)/db/iocAdminScanMon.db
IOCRELEASE_DB     += iocRelease.db

# PLC
PLCADMIN_TEMPLATE += $(PLCADMIN)/db/plcAdminControlLogix.template
ETHER_IP_TEMPLATE += $(ETHER_IP)/db/eip_stat.db

# MCOR
DB_INSTALLS       += $(DRVPCIMCOR)/db/pciMcorDemo.db

# Timing dbs
EVENT_TEMPLATE    += $(EVENT)/db/evr.db
EVENT_TEMPLATE    += $(EVENT)/db/evrEventCtrl.db
EVENT_TEMPLATE    += $(EVENT)/db/evrPatternAll.db
EVENT_TEMPLATE    += $(EVENT)/db/evrEventAll.db

# Fast Feedback db and templates
DB_INSTALLS+=$(PAU)/db/dbPau.db
DB_INSTALLS+=$(PAU)/db/dbPauBeamcodeTimeslot.db
DB_INSTALLS+=$(PAU)/db/dbPauPattern.db
DB_INSTALLS+=$(PAU)/db/dbMux.db
DB_INSTALLS+=$(PAU)/db/dbMuxDataSlot.db
DB_INSTALLS+=$(PAU)/db/dbMuxOffset.db
DB_INSTALLS+=$(PAU)/db/dbPau.template
DB_INSTALLS+=$(PAU)/db/dbMux.template

# Asyn database
DB_INSTALLS+=$(ASYN)/db/asynRecord.db

#-----------------------------------------------------
# Hardware
DB += mgnt_emcor_chan.template
DB += mgnt_emcor_controller.template
DB += mgnt_genesys_ps.template
DB += mgnt_genesys_proto.db
DB += mgnt_evr.db
DB += mgnt_pattern.db
DB += mgnt_ip8413_module_v2.template
DB += mgnt_vsam_module.template
DB += mgnt_plc_ps_system.db
DB += mgnt_plc_ps.db
DB += mgnt_beckhoff_ps.db
DB += mgnt_epsc.template
DB += mgnt_epsc.db
DB += mgnt_epsc_rev.template
DB += mgnt_epsc_qe_linac.db

DB += mgnt_vme.db
DB += mgnt_vme2.db
DB += mgnt_mcor_linac.db
DB += mgnt_mcor2_linac.db
DB += mgnt_mcor12_linac.db

# Top-level databases based on controller
DB += mgnt_bulk.db
DB += mgnt_emcor_linac.db
DB += mgnt_beckhoff_smps.db
DB += mgnt_emcor_smps.db
DB += mgnt_smps.db
DB += mgnt_intermediate.db
DB += mgnt_kick.db
DB += mgnt_lgps.db
DB += mgnt_genesys_lgps.db
DB += mgnt_string_slave.db
DB += mgnt_string_slave_notrims_2.db
DB += mgnt_string_slave_notrims.db

DB += mgnt_lgps_linac.template
DB += mgnt_mcor_sim.db
DB += mgnt_mcor_crate.template

# PLCs
DB += mgnt_plc_analog.template
DB += mgnt_plc_analogin.template
DB += mgnt_plc_analogout.template
DB += mgnt_plc_digitalin.template
DB += mgnt_plc_digitalout.template
DB += mgnt_plc_digitalout_momentary.template
DB += mgnt_plc_interlockin.template
DB += mgnt_plc_reset.template
DB += mgnt_plc_voltage_kick.template
DB += mgnt_plc_linac.db

# Control functions
DB += mgnt_func.db
DB += mgnt_ctrl.template
DB += mgnt_ctrl_degauss.db
DB += mgnt_ctrl_allstar.db
DB += mgnt_ctrl_func.template
DB += mgnt_ctrl_func_linac.db
DB += mgnt_ctrl_func_mcor_linac.db
DB += mgnt_ctrl_func_qe_linac.db

DB += mgnt_poly_qe_linac.db
DB += mgnt_poly_mcor_linac.db
DB += mgnt_poly.template
DB += mgnt_poly_linac.db

# Templates used by sector substituion files directly
# that do not need to be installed to $(TOP)/db
DB += mgnt_string_slave_intermediate.template
DB += mgnt_string_slave_smps.template
DB += mgnt_string_slave_idesgo.template
DB += mgnt_string_ctrl.template
DB += mgnt_string_status.template
DB += mgnt_model.template

# PLC Template used for Pulsed Magnet databases
DB += mgnt_plc_kick.db

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


