summaryrefslogtreecommitdiff
path: root/web/yacco2/o2linker/Makefile_Edit_cweb
blob: 87d03ba20a073cb7167d5efd1cda567a9d668dd8 (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
31
32
33
34
35
36
# Makefile_Edit_cweb
# clean up the ctangle and cweave droppings
# changed cwebmac.tex to include \input eplain instead of modifying before o2linker, and o2linker.tex
# comment out #line of cweb emits
# 
tmp=/tmp/o2linker
if [ ! -e "$tmp" ] 
then
  mkdir $tmp
fi
#echo '\input eplain' > $tmp/eplain.txt
#cat $tmp/eplain.txt o2linker.tex > $tmp/o2linker.tex
#cp $tmp/o2linker.tex o2linker.tex
#cat $tmp/eplain.txt o2externs.tex > $tmp/o2externs.tex
#cp $tmp/yacco2extn.tex yacco2extn.tex
#cat $tmp/eplain.txt yacco2stbl.tex > $tmp/yacco2stbl.tex
#cp $tmp/yacco2stbl.tex yacco2stbl.tex

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

for i in o2linker o2linker_externs common_externs o2linker_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 o2linker o2linker_externs common_externs  extndefs # comment out line reference macros of gened headers
do
  j=$i.h
  echo "correcting cweb header file: $j"
  eval "sed $sed_cmd1 $sed_cmd2 < $j > $tmp/$j"
  cp $tmp/$j $j
done
rm -fr $tmp