diff --git a/.gitignore b/.gitignore
index 1280fb74b6358d88d5bc8c8d488d981b1569472f..c4204e5ff6e7981f0a1fa70898438580dd785939 100644
--- a/.gitignore
+++ b/.gitignore
@@ -55,6 +55,7 @@ autom4te.cache
 /tests/journal/intra.byte
 /tests/misc/my_visitor_plugin/my_visitor.opt
 /tests/misc/my_visitor.sav
+/tests/spec/preprocess_dos.c
 /tests/*/*.opt
 /tests/pdg/*.dot
 
@@ -92,6 +93,8 @@ autom4te.cache
 
 /doc/acsl/
 
+/doc/aorai/aorai-example.tgz
+/doc/aorai/aorai-example/
 /doc/aorai/frama-c-aorai-example.tgz
 /doc/aorai/frama-c-aorai-example
 /doc/aorai/main.pdf
diff --git a/Makefile b/Makefile
index d6d044aebe2a88c183a3477078b4574087e5699d..6c52c7c5523e999bba7db7577c1cc42af6d0b911 100644
--- a/Makefile
+++ b/Makefile
@@ -2338,7 +2338,25 @@ PTESTS_SRC=ptests/ptests_config.ml ptests/ptests.ml
 # that does not contain a 'tests' dir
 PTESTS_CONFIG:= $(shell if test -d tests; then echo tests/ptests_config; fi)
 
-ptests: bin/ptests.$(OCAMLBEST)$(EXE) $(PTESTS_CONFIG)
+ifneq ("$(PTESTS_CONFIG)","")
+GENERATED_TESTS:=tests/spec/preprocess_dos.c
+else
+GENERATED_TESTS:=
+endif
+
+ifneq ("$(HAS_UNIX2DOS)","no")
+tests/spec/preprocess_dos.c: tests/spec/preprocess_dos.c.in
+	$(SED) -e "s|@UNIX2DOS@|$(UNIX2DOS)|g" \
+               -e "s|@DONTRUN@||g" \
+               $< > $@
+else
+tests/spec/preprocess_dos.c: tests/spec/preprocess_dos.c.in
+	$(SED) -e "s|@DONTRUN@|DONTRUN: no unix2dos found|g" \
+               -e "s|@UNIX2DOS|unix2dos|g" \
+               $< > $@
+endif
+
+ptests: bin/ptests.$(OCAMLBEST)$(EXE) $(PTESTS_CONFIG) $(GENERATED_TESTS)
 
 bin/ptests.byte$(EXE): $(PTESTS_SRC)
 	$(PRINT_LINKING) $@
@@ -2350,7 +2368,7 @@ bin/ptests.opt$(EXE): $(PTESTS_SRC)
 	$(OCAMLOPT) -I ptests -dtypes -thread -o $@ \
 	    unix.cmxa threads.cmxa str.cmxa dynlink.cmxa $^
 
-GENERATED+=ptests/ptests_config.ml tests/ptests_config
+GENERATED+=ptests/ptests_config.ml tests/ptests_config $(GENERATED_TESTS)
 
 #######################
 # Source distribution #
diff --git a/tests/spec/preprocess_dos.c b/tests/spec/preprocess_dos.c
deleted file mode 100644
index 959cc59c6bf9b2e192dbce08ef85c1966af1b39b..0000000000000000000000000000000000000000
--- a/tests/spec/preprocess_dos.c
+++ /dev/null
@@ -1,11 +0,0 @@
-/* run.config*
-OPT: -cpp-command="@PTEST_DIR@/@PTEST_NAME@.sh %i %o" -cpp-frama-c-compliant -print
-*/
-
-int main() {
-    int a = 0;
-    /*@
-        assert a == 0;
-    */
-    return a;
-}
diff --git a/tests/spec/preprocess_dos.c.in b/tests/spec/preprocess_dos.c.in
new file mode 100644
index 0000000000000000000000000000000000000000..e51e54c473cfd76bf3862770491eb3a22a0f9b1f
--- /dev/null
+++ b/tests/spec/preprocess_dos.c.in
@@ -0,0 +1,12 @@
+/* run.config*
+@DONTRUN@
+OPT: -cpp-command="@PTEST_DIR@/@PTEST_NAME@.sh @UNIX2DOS@ %i %o" -cpp-frama-c-compliant -print
+*/
+
+int main() {
+    int a = 0;
+    /*@
+        assert a == 0;
+    */
+    return a;
+}
diff --git a/tests/spec/preprocess_dos.sh b/tests/spec/preprocess_dos.sh
index b2be8f4100332b467248c8d2337e8ecebf8b3e28..a63a982d043b5847b333d4e556892393f97c8a7d 100755
--- a/tests/spec/preprocess_dos.sh
+++ b/tests/spec/preprocess_dos.sh
@@ -1,3 +1,3 @@
 #!/bin/sh
-gcc -C -E -I. -o $2 $1
-dos2unix -q $2
+gcc -C -E -I. -o $3 $2
+$1 -q $3