summaryrefslogtreecommitdiff
path: root/web/yacco2/grammar-testsuite/Makefile_Edit_cweb
blob: 5dcdd45ab5530813361063b5e7a7774ac27bb5ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Makefile_Edit_cweb
# clean up the ctangle and cweave droppings
# changed cwebmac.tex to include \input eplain instead of modifying before o2,yacco2stbl, and yacco2extn.tex
# comment out #line of cweb emits
# 
tmp=/tmp/o2
mkdir /tmp/o2
if [ ! -e "$tmp" ] 
then
  mkdir $tmp
fi

sed_cmd1="'-e s;^#line;//line;'"
sed_cmd2="'-e s/^;$//'"

for i in o2 o2_externs common_externs o2_defs # comment out line reference macros
do
  j=$i.cpp
  echo "correcting cweb file: $j"
  eval "sed $sed_cmd1 $sed_cmd2 < $j > $tmp/$j"
  cp $tmp/$j $j
done
for i in o2 o2_externs common_externs extndefs globals # comment out line reference macros of gened headers
do
  j=$i.h
  echo "correcting cweb file: $j"
  eval "sed $sed_cmd1 $sed_cmd2 < $j > $tmp/$j"
  cp $tmp/$j $j
done
rm -fr $tmp