#!/bin/bash
export PROG="$1"
export OUT="build/generated_database.cc"
cat > $OUT <.
*/
// Generated $(date +%Y-%m-%d_%H:%M)
BuiltinDriver builtins_[] =
{
EOF
# { "elster", "driver{name=elster meter_type=GasMeter default_fields=name,id,total_m3,timestamp detect{mvt=ELS,81,03}field{name=total quantity=Volume match{measurement_type=Instantaneous vif_range=Volume}}}", false },
for i in src/*.xmq
do
NAME=$(basename $i)
NAME="${NAME%.*}"
CONTENT="$(xmq $i delete /driver/test delete "//comment()" to-xmq --compact | sed 's/"/\\"/g')"
cat >>$OUT <> $OUT <> $OUT
done
cat >> $OUT <