-# 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
+# MARC8->UTF8 conversion is generated from codetables.xml
+marc8.c: charconv.tcl codetables.xml
+ $(TCLSH) $(srcdir)/charconv.tcl -p marc8 $(srcdir)/codetables.xml -o marc8.c
+
+# UTF-8->MARC8 conversion is generated from codetables.xml
+marc8r.c: charconv.tcl codetables.xml
+ $(TCLSH) $(srcdir)/charconv.tcl -r -p marc8r $(srcdir)/codetables.xml -o marc8r.c
+
+# Generate OID database from CSV
+oid_std.c $(top_srcdir)/include/yaz/oid_std.h: oidtoc.tcl oid.csv
+ $(TCLSH) $(srcdir)/oidtoc.tcl $(srcdir)/oid.csv $(srcdir)/oid_std.c $(top_srcdir)/include/yaz/oid_std.h