]> granicus.if.org Git - recode/commitdiff
Fix building of lat1{ansel,iso5426}.h from respective .l files
authorReuben Thomas <rrt@sc3d.org>
Sat, 27 Jan 2018 13:26:30 +0000 (13:26 +0000)
committerReuben Thomas <rrt@sc3d.org>
Sun, 28 Jan 2018 22:41:22 +0000 (22:41 +0000)
build-aux/invert-l-to-h [new file with mode: 0755]
src/Makefile.am

diff --git a/build-aux/invert-l-to-h b/build-aux/invert-l-to-h
new file mode 100755 (executable)
index 0000000..1ae0413
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+# Invert the conversion in a flex file to get a C header file for the other direction
+grep '^\\' $1 | \
+        perl -npe 's/{ put_byte \(//;s /, subtask\); }//;s%^\\%%' | \
+        perl -ne '($a,$b)=split; $c=substr($a,0,3);$d=substr($a,3);$e = eval "0$c"; next if $b < 0200 ;printf("\t{%d, \"%c%s\"}, %s* %c *%s\n", $b, $e, $d, "/", $b, "/")'
index 2f0c6ae7ae07c67b4f8c58668b5d90e290c62d7c..8b7cd37d1c1d3c9cf707d4e43f96ef4f5598ffa8 100644 (file)
@@ -119,11 +119,14 @@ iconv.lo: iconvdecl.h
 iconvdecl.h: ../tables.py
        $(TABLES_PY) -i
 
-# lat1ansel.h and lat1iso5426.h
-.l.h:
-       grep '^\\' $< | \
-       perl -npe 's/{ put_byte \(//;s /, subtask\); }//;s%^\\%%' | \
-       perl -ne '($$a,$$b)=split; $$c=substr($$a,0,3);$$d=substr($$a,3);$$e = eval "0$$c"; next if $$b < 0200 ;printf("\t{%d, \"%c%s\"}, %s* %c *%s\n", $$b, $$e, $$d, "/", $$b, "/")' > $@
+lat1ansel.c: lat1ansel.h
+lat1iso5426.c: lat1iso5426.h
+
+lat1ansel.h: ansellat1.l
+       $(top_srcdir)/build-aux/invert-l-to-h $< > $@
+
+lat1iso5426.h: iso5426lat1.l
+       $(top_srcdir)/build-aux/invert-l-to-h $< > $@
 
 african.lo afrtran.lo atarist.lo bangbang.lo cdcnos.lo \
 ebcdic.lo ibmpc.lo iconqnx.lo lat1asci.lo lat1iso5426.lo lat1ansel.lo \