TOP=../..
include $(TOP)/configure/CONFIG
#----------------------------------------
#  ADD MACRO DEFINITIONS AFTER THIS LINE
#----------------------------------------------------
#  Optimization of db files using dbst (DEFAULT: NO)
#DB_OPT = YES

#----------------------------------------------------
# Create and install (or just install)
# databases, templates, substitutions like this
DB += padai.db
DB += padbo.db
DB += padcalcout.db
DB += padlongin.db
DB += padlongout.db
DB += padmbbo.db
DB += padwaveform.db
DB += testComm.db
DB += padTrgStatus.db

# For LCLS and FACET Interlocking PADs
DB += padFACETXTCAV.intrlk_template
DB += padLCLSXTCAV.intrlk_template

# For FACET stand-alone PADs
DB += padFACETKLY1.kly_template
DB += padFACETREF.kly_template

# For LCLS stand-alone PADs
DB += padLSR.lsr_template
DB += padGN1.gen102_template
DB += padL0.gen102_template
DB += padBPH.bph_template
DB += padTC0.gen102_template
DB += padL1S.gen102_template
DB += padL1X.kly_template
DB += padTC3.gen102_template
DB += padKLY248.bph3_template
DB += padPH4.bph3_template

# For NLCTA stand-alone X-Band PADs in Stations 1,2,3
DB += pad011.nlcta_template
DB += pad021.nlcta_template
DB += pad022.nlcta_template
DB += pad031.nlcta_template
DB += pad032.nlcta_template
# For NLCTA interlocking PADs in Stations 3
DB += pad033.intrlk_template

# ==========================================
# Install autosave/restore request files
#SECURITY += padAccessControl.acf
# =========================================

# DB_INSTALLS += pad.acf 
DB += $(IOCADMIN)/db/iocAdminRTEMS.db
#DB_INSTALLS += $(IOCADMIN)/db/iocAdmin.db
DB_INSTALLS += $(AUTOSAVE)/db/save_restoreStatus.db

IOCRELEASE_DB     += iocRelease.db

#----------------------------------------------------
# If <anyname>.db template is not named <anyname>*.template add
# <anyname>_TEMPLATE = <templatename>


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

%.bph_template: ../%.bph_substitutions ../pad.bph_template
	$(RM) $@
	../buildtemplate $< $@

%.bph3_template: ../%.bph3_substitutions ../pad.bph3_template
	$(RM) $@
	../buildtemplate $< $@

%.gen102_template: ../%.gen102_substitutions ../pad.gen102_template
	$(RM) $@
	../buildtemplate $< $@

%.kly_template: ../%.kly_substitutions ../pad.kly_template
	$(RM) $@
	../buildtemplate $< $@

%.lsr_template: ../%.lsr_substitutions ../pad.lsr_template
	$(RM) $@
	../buildtemplate $< $@
	
%.intrlk_template: ../%.intrlk_substitutions ../pad.intrlk_template
	$(RM) $@
	../buildtemplate $< $@
	
%.nlcta_template: ../%.nlcta_substitutions ../pad.nlcta_template
	$(RM) $@
	../buildtemplate $< $@	
		
clean::
	$(RM) $(patsubst %.substitutions,%.template,$(wildcard *.substitutions))


