TOP=../../..
AWK=awk

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

# Definitions must match macros in pabig.c
# NOTE: If you change these numerical values
#       you *must* 'make clean' and rebuild
#       this 'Db' directory.
# 
#       The templates and Makefile logic
#       currently supports only up to INP_MAX=9,
#       RG_MAX=21 and RATE_MAX=15
RG_MAX=20
# INP_MAX must be equal to NUM_INP - 1
INP_MAX=9
RATE_MAX=15

DB += pabig.db

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


pabig.substitutions: ../pabig.awk pabigRateNames.template pabigHwInputNames.template
	$(AWK) -f ../pabig.awk -v RG_MAX=$(RG_MAX) -v INP_MAX=$(INP_MAX) -v RATE_MAX=$(RATE_MAX) > $@ 

pabigRateNames.template: ../pabigRateNames.template.in
	$(RM) $@
	sed -e 's/^#I[0-$(INP_MAX)]/   /' $^ > $@

pabigHwInputNames.template: ../pabigHwInputNames.template.in
	$(RM) $@
	sed -e '/^#01/,/^#$(RG_MAX)/s/^#../   /' $^ > $@
