* Seal the representation of states
[tatoo.git] / Remakefile.in
index a4fe1c9..c1f2b25 100644 (file)
@@ -17,7 +17,7 @@ OCAMLDEP = @OCAMLDEP@
 ODEPS = tools/odeps.sh $(OCAMLDEP)
 OCAMLC = @OCAMLC@
 OCAMLOPT = @OCAMLOPT@
-OCAMLFLAGS = @OCAMLFLAGS@ 
+OCAMLFLAGS = @OCAMLFLAGS@
 OCAMLOPTFLAGS = @OCAMLOPTFLAGS@
 OCAMLCFLAGS = @OCAMLCFLAGS@
 OCAMLYACC = @OCAMLYACC@
@@ -37,7 +37,7 @@ clean:
        for dir in src tools; do
                find $dir -name '*.cm*' -o -name '*.o' -o -name '*.byte' -o \
                          -name '*.native' -o -name '*.mll' -o -name '*.mly' -o \
-                         -name '*.class' -o -name '*.depo' -o -name '*.depx' | while read file; do
+                         -name '*.class' -o -name '*.depo' -o -name '*.depx' -o -name '*.ml.str' | while read file; do
                case "$file" in
                        *.mll)
                                rm -f "${file%.mll}.ml"
@@ -45,8 +45,11 @@ clean:
                        *.mly)
                                rm -f "${file%.mly}.ml" "${file%.mly}.mli"
                        ;;
+                       *.ml.str)
+                               rm -f "${file%.ml.str}.ml"
+                       ;;
                        *)
-                       rm -f "$file"
+                               rm -f "$file"
                        ;;
                esac
                done
@@ -78,6 +81,12 @@ distclean: clean test_clean
        elif test -f $*.mll; then
                $(REMAKE) $*.mll
                $(OCAMLLEX) $*.mll
+       elif test -f $*.ml.str; then
+               $(REMAKE) $*.ml.str
+               echo -n 'let content = "' > $*.ml
+               sed -e 's/\(["\\]\)/\\\1/g' $*.ml.str | sed -e 's/^\(.*\)$/\1\\n\\/g' >> $*.ml
+                echo '' >> $*.ml
+                echo '"' >> $*.ml
        fi
 
 %.cmx %.depx: