-# MARC8 conversion is generated from charconv.sgm + codetables.xml
-marc8.c: charconv.tcl charconv.sgm codetables.xml
- cd $(srcdir); ./charconv.tcl -O 1 -p marc8 charconv.sgm codetables.xml -o marc8.c
+# MARC8 conversion is generated from codetables.xml
+$(srcdir)/marc8.c: charconv.tcl codetables.xml
+ cd $(srcdir); ./charconv.tcl -p marc8 codetables.xml -o marc8.c
+
+# Generate diagnostics from CSVs
+$(top_srcdir)/include/yaz/diagbib1.h $(srcdir)/diagbib1.c: csvtobib1.tcl bib1.csv
+ cd $(srcdir); ./csvtobib1.tcl
+
+$(top_srcdir)/include/yaz/diagsrw.h $(srcdir)/diagsrw.c: csvtosrw.tcl srw.csv
+ cd $(srcdir); ./csvtosrw.tcl