summaryrefslogtreecommitdiffstats
path: root/ocamldoc
diff options
context:
space:
mode:
Diffstat (limited to 'ocamldoc')
-rw-r--r--ocamldoc/Makefile5
-rwxr-xr-xocamldoc/remove_DEBUG20
2 files changed, 4 insertions, 21 deletions
diff --git a/ocamldoc/Makefile b/ocamldoc/Makefile
index b1466818b..409142307 100644
--- a/ocamldoc/Makefile
+++ b/ocamldoc/Makefile
@@ -24,7 +24,10 @@ OCAMLYACC = $(ROOTDIR)/yacc/ocamlyacc
OCAMLLIB = $(LIBDIR)
OCAMLBIN = $(BINDIR)
-OCAMLPP=-pp './remove_DEBUG'
+# Pre-processor to strip lines with 'DEBUG', replacing them with lines
+# containing only a comment. Also adds a leading "#1 $1" line. The whole thing
+# should respect the cpp # lines annotation conventions.
+OCAMLPP=-pp "awk 'BEGIN { printf(\"# 1 %s\n\", ARGV[1]); } /DEBUG/ { printf(\"(* DEBUG statement removed *)\n\"); } !/DEBUG/ { print $$0; }'"
# For installation
##############
diff --git a/ocamldoc/remove_DEBUG b/ocamldoc/remove_DEBUG
deleted file mode 100755
index bca6ba049..000000000
--- a/ocamldoc/remove_DEBUG
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-#(***********************************************************************)
-#(* OCamldoc *)
-#(* *)
-#(* Damien Doligez, projet Moscova, INRIA Rocquencourt *)
-#(* *)
-#(* Copyright 2003 Institut National de Recherche en Informatique et *)
-#(* en Automatique. All rights reserved. This file is distributed *)
-#(* under the terms of the Q Public License version 1.0. *)
-#(* *)
-#(***********************************************************************)
-
-# usage: remove_DEBUG <file>
-# remove from <file> every line that contains the string "DEBUG",
-# respecting the cpp # line annotation conventions
-
-echo "# 1 \"$1\""
-LC_ALL=C sed -e '/DEBUG/c\
-(* DEBUG statement removed *)' "$1"