#==============================================================
#
#  Abs:  build EPICS Database components for the 
#        Beam Containment System
#
#  Name: Makefile
#
#  Facility: SLAC Beam Containment
#
#  Auth: 09-Jan-2007, Arturo Alarcon  (ALARCON)
#  Rev:  dd-mmm-yyyy, First Lastname  (USERNAME)
#--------------------------------------------------------------
#   Mod:
#        18-Nov-2019, K. Luchini      (LUCHINI): 
#           install bcs_mcc0_alias.db
#        11-Nov-2019, K. Luchini      (LUCHINI):
#           install bcs_b34_timing.substittuions
#           install bcs_b34.substitutions
#        08-Nov-2019, K. Luchini      (LUCHINI):
#           remove install of bcs_in20_lss_sum.db
#           remove install of bcs_in20_sbireset.db
#           remove install of bcs_li24_sbireset.db
#        25-Oct-2019, K. Luchini      (LUCHINI):
#           remove install of bcs_d2ltu1_alarm.db
#        18-Oct-2019, K. Luhini       (LUCHINI):
#          install bcs_dsc_chassis.db
#          install bcs_dtc_chassis.db
#          install bcs_pic_chassis.db
#        04-Oct-2019, K. Luhini       (LUCHINI):
#          remove bcs_dmp1_history.db
#          remove bcs_dmp1_ip330.db
#          remove bcs_dmp1_conversions.vdb
#          remove bcs_dmp1_tcsreset.vdb
#          remove bcs_tcs_sum.db
#          remove bcs_dmph_timing.db
#        19-Sep-2019, K. Luchini      (LUCHINI):
#          install bcs_und0.db
#          remove install of IOC-IN10-BC01trig.db
#          change order of bcs_in10.db
#          install bcs_fees.db, bcs_feeh.db
#          install bcs_gunb.db
#          install bcs_l1b.db
#          install bcs_in20.db, bcs_li24.db
#        17-Sep-2019, K. Luchini      (LUCHINI):
#          install bcs_feeh.db
#          install hpi_6012.proto
#          install l_p_blm.proto
#        16-Sep-2019, K. Luchini      (LUCHINI):
#          chg order of bcs_dmp1.db 
#          chr ordre of bcs_mcc0.db 
#          install bcs_dmph_timing.db
#        05-Sep-2019, K. Luchini      (LUCHINI):
#          install bcs_bsy0.db
#        07-Mar-2019, K. Luchini      (LUCHINI):
#          remove iocAdminScanMon.db and access.db
#        06-Mar-2019, Garth Brown     (GWBROWN);
#          install bcs-gunb-plc.db
#        09-Jul-2018, K. Luchini      (LUCHINI):
#          split bcs_in10_evr.db into 3 files
#          to conform to bcs standards 
#          install IOC-IN10-BC01trig.db
#          install IOC-IN10-BC01pattern.db
#          install IOC-IN10-BC01evr.db
#          install evrEventFACET.db
#        28-May-2018, K. Luchini      (LUCHINI):
#          add bcs_in10_evr.substitutions
#        17-May-2018, K. Luchini      (LUCHINI):
#          add bcs_in10.substitutions
#          add bcs_tcs_sum.db
#        02-Jul-2009, K. Turner       (KKUBLER):
#          add bcs_tcs_sum.db
#        09-Feb-2009, K. Turner       (KKUBLER):
#          add bcs_d2ltu1_alarm.substitutions
#        05-Jun-2007, A. Alarcon      (ALARCON):
#          add RULES.db file to install acf
#
#===============================================================
#
TOP=../..
include $(TOP)/configure/CONFIG
#----------------------------------------
#  ADD MACRO DEFINITIONS AFTER THIS LINE

#----------------------------------------------------
#  Optimization of db files using dbst (DEFAULT: NO)
#DB_OPT = YES
#USR_DBDFLAGS += -I  .

#----------------------------------------------------
# Create and install (or just install)
# databases, templates, substitutions like this

# For iocAdmin database
DB_INSTALLS       += $(IOCADMIN)/db/iocAdminRTEMS.db
DB_INSTALLS       += $(IOCADMIN)/db/iocAdminSoft.db
IOCRELEASE_DB     += iocRelease.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
EVENT_TEMPLATE    += $(EVENT)/db/evrEventFACET.db

# Install Database to support reading the status of the autosave package:
DB_INSTALLS += $(AUTOSAVE)/db/save_restoreStatus.db

# Install asyn record
DB_INSTALLS += $(ASYN)/db/asynRecord.db

# Modbus
DB_INSTALLS += $(MODBUS)/db/statistics.template

# For Average Current Monitor
DB_INSTALLS += $(ACM)/db/acm.db
DB_INSTALLS += $(ACM)/db/acm_base.db
DB_INSTALLS += $(ACM)/db/acm_tonegen.db
DB_INSTALLS += $(ACM)/db/health.db
DB += bcs_htr_instance.db
DB += cn16dpt.db
DB += bcs_htr.db

# Common
DB += bcs_pic_chassis.db
DB += bcs_dtc_chassis.db
DB += bcs_dsc_chassis.db
DB += bcs_dsc.db
DB += bcs_pblm.db
DB += bcs_lblm.db
DB += TC-48-20.db

# FACET-II
DB += bcs_evr_facet.db
DB += bcs_pattern_facet.db
DB += bcs_in10.db

# LCLS-II
DB += bcs-gunb-plc.db
DB += bcs_soc_bc01.db
DB += bcs_soc_bc02.db
DB += hpi_6012.template

# LCLS
DB += bcs_mcc0_stoppers.db
DB += bcs_mcc0_pics_forceupdate.vdb
DB += bcs_mcc0_timing.db

# LCLS
DB += bcs_li20.db
DB += bcs_in20.db
DB += bcs_li24.db
DB += bcs_li28.db
DB += bcs_bsy0.db
DB += bcs_mcc0.db
DB += bcs_ltu1_bc01.db
DB += bcs_ltu1_bc02.db
DB += bcs_dmp1.db
DB += bcs_undh.db
DB += bcs_feeh.db
DB += bcs_fees.db

# Development
DB += bcs_b024.db
DB += bcs_b34_timing.db
DB += bcs_b34.db

DB += bcs-s7-all-waveforms.db
DB += bcs-s7-status.db
DB += bcs-s7-all-bits.db
DB += bcs-s7-ai.db
DB += bcs-s7-ai_chainA.db
DB += bcs-s7-ai_chainB.db

DB += bcs-s7-Pz0-bytes.db
DB += bcs-s7-Pz0-bits.db

DB += bcs-s7-Pz1-bytes.db
DB += bcs-s7-Pz1-bits.db

DB += bcs-s7-Pz2-bytes.db
DB += bcs-s7-Pz2-bits.db

DB += bcs-s7-Pz3-bytes.db
DB += bcs-s7-Pz3-bits.db

DB += bcs-s7-Pz4-bytes.db
DB += bcs-s7-Pz4-bits.db

DB += bcs-s7-Pz5-bytes.db
DB += bcs-s7-Pz5-bits.db

DB += bcs-s7-Pz6-bytes.db
DB += bcs-s7-Pz6-bits.db

DB += bcs-s7-Pz7-bytes.db
DB += bcs-s7-Pz7-bits.db

DB += bcs-s7-Pz8-bytes.db
DB += bcs-s7-Pz8-bits.db

DB += bcs-s7-Pz9-bytes.db
DB += bcs-s7-Pz9-bits.db

DB += bcs-s7-Pz10-bytes.db
DB += bcs-s7-Pz10-bits.db

DB += bcs-s7-Pz11-bytes.db
DB += bcs-s7-Pz11-bits.db

DB += bcs-s7-Pz12-bytes.db
DB += bcs-s7-Pz12-bits.db

DB += bcs-s7-Pz13-bytes.db
DB += bcs-s7-Pz13-bits.db

DB += bcs-s7-Pz14-bytes.db
DB += bcs-s7-Pz14-bits.db

DB += bcs-s7-Pz18-bytes.db
DB += bcs-s7-Pz18-bits.db

DB += bcs-s7-Pz19-bytes.db
DB += bcs-s7-Pz19-bits.db

DB += bcs-s7-Pz20-bytes.db
DB += bcs-s7-Pz20-bits.db

DB += bcs-s7-Pz21-bytes.db
DB += bcs-s7-Pz21-bits.db

DB += bcs-s7-Pz22-bytes.db
DB += bcs-s7-Pz22-bits.db

DB += bcs-s7-Pz23-bytes.db
DB += bcs-s7-Pz23-bits.db

DB += bcs-s7-Pz24-bytes.db
DB += bcs-s7-Pz24-bits.db


# Stream device protocol files
PROTO += hpi_6012.proto
PROTO += l_blm.proto
PROTO += l_blm_null_in_term.proto
PROTO += p_blm.proto
PROTO += sbtc.proto
PROTO += TC-48-20.proto
PROTO += cn16dpt.proto

include $(TOP)/configure/RULES
#----------------------------------------
#  ADD RULES AFTER THIS LINE
#
gen_trig_edl: 
	create_edm_event_msi.py bcs_in10.substitutions
