summaryrefslogtreecommitdiff
path: root/web/spiderweb/os2/os2.changes
blob: 0d34a86b0b99abd00f027c02fc9b7f1c33ba4f36 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
From bdubbs@cs.tamu.edu Mon Feb 15 18:25:17 1993
Received: from flash.bellcore.com by mailee.bellcore.com (5.61/1.34)
	id AA24579; Mon, 15 Feb 93 18:25:13 -0500
Received: from NEURON.TAMU.EDU by flash.bellcore.com (5.61/1.34)
	id AA06361; Mon, 15 Feb 93 18:25:09 -0500
Received: by neuron.cs.tamu.edu (AA01812); Mon, 15 Feb 93 17:24:16 CST
Date: Mon, 15 Feb 93 17:24:16 CST
From: bdubbs@cs.tamu.edu (Bruce Dubbs)
Message-Id: <9302152324.AA01812@neuron.cs.tamu.edu>
To: norman@bellcore.com
Subject: Re:  Spider Web port to OS/2
Cc: bart@cs.tamu.edu
Status: RO

Attached are the final changes I made to the Spider WEB system for
porting to OS/2.  Also is the readme.os2 and makefile.emx that I
included in the package.  The file, spider.zip, is now at
ftp-os2.nmsu.edu in the /pub/uploads directory, but it should be moved
to the /pub/os2/2.0/programming directory in a week or two.

I made the bug fixes in common.ch because I did not want to change
your distribution code until you made the changes public.  I also made
a slight change to weave.web (weave.ch) because ceeweave was giving
an error at a single @ inside a /* ... */ comment.

   -- Bruce Dubbs

---readme.os2----------------------------------------------------------
This is the OS/2 2.0 port of Norman Ramsey's Spider WEB.  

Briefly, WEB is a system that allows the creation of computer source
code and typeset documentation from a single source file.  The file is
processed by tangle for input to the target compiler and the same
source is processed be weave for input to TeX for typeset
documentation.

This port includes the entire source for Ramsey's system that allows
the creation of custom tangle and weave processors for arbitrary
computer languages.  Included in the main directory of this port is a
set of OS/2 specific files:

README.OS2    -- This file
ceeweave.exe  -- C Weave executable
ceetangle.exe -- C Tangle executable
awkweave.exe  -- AWK Weave executable
awktangle.exe -- AWK Tangle executable
cweb.tex      -- include file for Woven C tex files
awkweb.tex    -- include file for Woven AWK tex files
makefile.emx  -- make for C and AWK executatables and dvi
                 documentation
common.ch     -- change file for common.web
weave.ch      -- change file for weave.web
emxlibc.dll   -- emx C dynamic link library

The only change I have made to the original files is to rename
common.c to common.c.old in order to force the makefile to create a
new common.c from the combination of common.web and common.ch.

INSTALLATION:

Copy the executables above to a directoru on your PATH.
Copy cweb.tex, awkweb.tex, and webkernel.tex to the directory that TeX
normally looks for inputs.
Copy the emxlibc.dll file to a directory on your LIBPATH.

>From this point, you should be able to run the appropriate version of
tangle and weave from any location.

That it.

NOTES:

1.  I have assumed the files here are on an HPFS directory.  This means
that the capability for long filenames is assumed.

2.  The TeX include file webkernel.tex appears to be too long for
tex386, but internally tex386 processes the \input command properly
and will find webkernel.tex properly if it is in the current directory
or the proper TEXINPUT directory.  However, tex386 will not recognize
a file on the command line linger tahn the 8.3 format.

MAKING IT YOURSELF:

The makefile "makefile.emx" will create the executables and dvi files
of the sources and documentation.  The primary commands are:

    make -f makefile.emx exe    (default - makes executables)
    make -f makefile.emx docs   (makes dvi files of documentation)
    make -f makefile.emx dvi    (makes dvi files from Spider sources)
    make -f makefile.emx all    (all of the above)
    make -f makefile.emx clean  (removes all non-essential files)

It takes about 13 minutes to to a `make all' on my 386/33 + 387 + 16Mb RAM.

The makefile assumes a lot about utilities that are available.  I used
the emx 0.8f gcc compiler, gawk, sort, rm, cat, and sort.  It also
uses tex386 from the emTeX package using both plain and LaTeX styles.
All of these are available from ftp-os2.nms.edu.

If you want to develop one of the other Spider WEB languages, take a
look at the makefile closely.  You may even want to develop a Spider
Web for a new language.

  -- Bruce Dubbs
     bdubbs@neuron.tamu.edu or
     bdubsb@hal.kelly.af.mil  (after August 1993)

REFERENCES:
[1] Wayne Sewell, Weaving a Program: Literate Programming in WEB.
Van Nostrand Reinhold, New York, 1988

[2] Donald Knuth, Literate Programming.  Center for the Study of
Language and Information, Leland Stanford Junior University, CA, 1992.
--------common.ch------------------------------------------------
% Change file to common.web for Spider Web generation for OS2
% Not to be sold, but may be used freely for any purpose
% For more information, see file COPYRIGHT in the parent directory

% This file is part of Spidery WEB

% This program by Norman Ramsey is based on programs Silvio Levy
% and D. E. Knuth.  Silvio Levy wrote most of the code.
% It is distributed WITHOUT ANY WARRANTY, express or implied.
% Dec 1987

% Change file by Bruce Dubbs, Texas A&M University, bdubbs@neuron.tamu.edu


@x  Module  7  Sun Feb 14 01:12:22 1993
@ The \.{WEAVE} and \.{TANGLE} processors convert between ASCII code and
the user's external character set by means of arrays |xord| and |xchr|
that are analogous to PASCAL's |ord| and |chr| functions.

@<Definitions...@>=
ASCII xord[last_text_char]; /* specifies conversion of input characters */
outer_char xchr[@'200]; /* specifies conversion of output characters */
@y  Module  7  Sun Feb 14 01:12:22 1993
@ The \.{WEAVE} and \.{TANGLE} processors convert between ASCII code and
the user's external character set by means of arrays |xord| and |xchr|
that are analogous to PASCAL's |ord| and |chr| functions.

We have to change the size of xord to |last_text_char|+1 to cover the 
entire 128 byte ASCII array.

@<Definitions...@>=
ASCII xord[last_text_char+1]; /* specifies conversion of input characters */
outer_char xchr[@'200]; /* specifies conversion of output characters */
@z  Module  7  Sun Feb 14 01:12:22 1993

@x  Module  8  Sun Feb 14 01:16:14 1993
@ Every system supporting \cee\ must be able to read and write the 95
visible characters of standard ASCII above (although not necessarily using the
ASCII codes to represent them).  Conversely, these characters, plus
the newline, are sufficient to write any \cee\ program.  Other
characters are desirable mainly in strings, and they can be referred
to by means of escape sequences like \.{'\t'}.

The basic implementation of \.{WEB}, then, only has to assign an
|xord| to these 95 characters (newlines are swallowed by the reading
routines).  The easiest way to do this is to assign the characters to
their positions in |xchr| and then invert the correspondence:

@<Functions...@>=
common_init()
{
  strcpy(xchr,"                                 !\"#$%&'()*+,-./0123456789\
:;<=>?@@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ");
  @<System-dependent parts of character set@>;
  @<Invert |xchr| to get |xord|@>;
  @<Initialize pointers@>;
  setting_up=1;
  @<Scan arguments and open output files@>;
  setting_up=0;
}
@y  Module  8  Sun Feb 14 01:16:14 1993
@ Every system supporting \cee\ must be able to read and write the 95
visible characters of standard ASCII above (although not necessarily using the
ASCII codes to represent them).  Conversely, these characters, plus
the newline, are sufficient to write any \cee\ program.  Other
characters are desirable mainly in strings, and they can be referred
to by means of escape sequences like \.{'\t'}.

The basic implementation of \.{WEB}, then, only has to assign an
|xord| to these 95 characters (newlines are swallowed by the reading
routines).  The easiest way to do this is to assign the characters to
their positions in |xchr| and then invert the correspondence:

We make a change here so the string copy does not add a null to the |xchr|
array.

@<Functions...@>=
common_init()
{
  strncpy(xchr,"                                 !\"#$%&'()*+,-./0123456789\
:;<=>?@@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ",128);
  @<System-dependent parts of character set@>;
  @<Invert |xchr| to get |xord|@>;
  @<Initialize pointers@>;
  setting_up=1;
  @<Scan arguments and open output files@>;
  setting_up=0;
}
@z  Module  8  Sun Feb 14 01:16:14 1993

@x  Module  28  Sun Feb 14 01:17:40 1993
@ When a \.{@@i} line is found in the |cur_file|, we must temporarily
stop reading it and start reading from the named include file.  The
\.{@@i} line should give a complete file name with or without \.{"..."};
\.{WEB} will look for include files in standard directories using
the |pathopen| module.
That is set up at the beginning using the {\tt -I} arguments 
and the {\tt WEBPATH} environment variable.
@<Add environment variable |"WEBPATH"| to search path@>=
	pathaddpath(getenv("WEBPATH"),':');
@y  Module  28  Sun Feb 14 01:17:40 1993
@ When a \.{@@i} line is found in the |cur_file|, we must temporarily
stop reading it and start reading from the named include file.  The
\.{@@i} line should give a complete file name with or without \.{"..."};
\.{WEB} will look for include files in standard directories using
the |pathopen| module.
That is set up at the beginning using the {\tt -I} arguments 
and the {\tt WEBPATH} environment variable.

We change the path delimeter to a semi-colon for OS/2.

@<Add environment variable |"WEBPATH"| to search path@>=
	pathaddpath(getenv("WEBPATH"),';');
@z  Module  28  Sun Feb 14 01:17:40 1993

@x  Module  70  Sun Feb 14 01:19:06 1993
@ @<Set up null...@>= 
#ifdef MSDOS
strcpy(change_file_name,"NUL");
#else
strcpy(change_file_name,"/dev/null");
#endif
@y  Module  70  Sun Feb 14 01:19:06 1993
@ OS/2 uses {\tt /dev/nul} instead of {\tt /dev/null}.

@<Set up null...@>= 
strcpy(change_file_name,"/dev/nul");  
@z  Module  70  Sun Feb 14 01:19:06 1993
-----------weave.ch---------------------------------------------
% Copyright 1989 by Norman Ramsey, Odyssey Research Associates
% Not to be sold, but may be used freely for any purpose
% For more information, see file COPYRIGHT in the parent directory

% This file is part of Spidery WEB
% This program by Norman Ramsey is based on programs Silvio Levy
% and D. E. Knuth.  Silvio Levy wrote most of the code.
% It is distributed WITHOUT ANY WARRANTY, express or implied.
% Dec 1987

% Change made to overcome a small error.  There is a comment that 
% only use a single at-sign.  We change it here to at-at.

@x
@ Control codes in \.{WEB}, which begin with `\.{@@}', are converted
into a numeric code designed to simplify \.{CWEAVE}'s logic; for example,
larger numbers are given to the control codes that denote more significant
milestones, and the code of |new_module| should be the largest of
all. Some of these numeric control codes take the place of ASCII
control codes that will not otherwise appear in the output of the
scanning routines.
@^ASCII code@>

@d ignore = 0 /* control code of no interest to \.{CWEAVE} */
@d verbatim = @'2 /* extended ASCII alpha will not appear */
		 /* extended ASCII beta will not appear */
@d begin_comment = @'10 /* ASCII tab mark will not appear */
@d octal = @'14 /* ASCII carriage return will not appear */
@d hex = @'15 /* ASCII form feed will not appear */
@d switch_math_flag = @'175 /* this code will be intercepted without confusion */
@d underline = @'176 /* this code will be intercepted without confusion */
@d param = @'177 /* ASCII delete will not appear */
/* identifier =200 or octal @'310 */
@#/* following three must be conseccutive for indexing to work */
@d xref_roman = (identifier+roman) /* control code for `\.{@@\^}' */
@d xref_wildcard = (identifier+wildcard) /* control code for `\.{@@:}' */
@d xref_typewriter = (identifier+typewriter) /* control code for `\.{@@.}' */
@d TeX_string = @'356 /* control code for `\.{@@t}' */
@d ascii_constant = @'357 /* control code for `\.{@@`}' */
@d join = @'360 /* control code for `\.{@@\&}' */
@d thin_space = @'361 /* control code for `\.{@@,}' */
@d math_break = @'362 /* control code for `\.{@@\char'174}' */
@d line_force = @'363 /* control code for `\.{@@/}' */
@d line_break = @'364 /* control code for `\.{@@-}' */
@d big_line_break = @'365 /* control code for `\.{@@\#}' */
@d no_line_break = @'366 /* control code for `\.{@@+}' */
@d pseudo_semi = @'367 /* control code for `\.{@@;}' */
@d vertical_bar = @'370 /* The `\v' used to mark Ada text */
@d trace = @'371 /* control code for `\.{@@0}', `\.{@@1}' and `\.{@@2}' */
@d format = @'373 /* control code for `\.{@@f}' */
@d definition = @'374 /* control code for `\.{@@d}' */
@d begin_unnamed = @'375 /* control code for `\.{@@u}' */
@d module_name = @'376 /* control code for `\.{@@<}' */
@d new_module = @'377 /* control code for `\.{@@\ }' and `\.{@@*}' */
@y
@ Control codes in \.{WEB}, which begin with `\.{@@}', are converted
into a numeric code designed to simplify \.{CWEAVE}'s logic; for example,
larger numbers are given to the control codes that denote more significant
milestones, and the code of |new_module| should be the largest of
all. Some of these numeric control codes take the place of ASCII
control codes that will not otherwise appear in the output of the
scanning routines.
@^ASCII code@>

@d ignore = 0 /* control code of no interest to \.{CWEAVE} */
@d verbatim = @'2 /* extended ASCII alpha will not appear */
		 /* extended ASCII beta will not appear */
@d begin_comment = @'10 /* ASCII tab mark will not appear */
@d octal = @'14 /* ASCII carriage return will not appear */
@d hex = @'15 /* ASCII form feed will not appear */
@d switch_math_flag = @'175 /* this code will be intercepted without confusion */
@d underline = @'176 /* this code will be intercepted without confusion */
@d param = @'177 /* ASCII delete will not appear */

% This is where the change is

/* identifier =200 or octal @@'310 */

@#/* following three must be conseccutive for indexing to work */
@d xref_roman = (identifier+roman) /* control code for `\.{@@\^}' */
@d xref_wildcard = (identifier+wildcard) /* control code for `\.{@@:}' */
@d xref_typewriter = (identifier+typewriter) /* control code for `\.{@@.}' */
@d TeX_string = @'356 /* control code for `\.{@@t}' */
@d ascii_constant = @'357 /* control code for `\.{@@`}' */
@d join = @'360 /* control code for `\.{@@\&}' */
@d thin_space = @'361 /* control code for `\.{@@,}' */
@d math_break = @'362 /* control code for `\.{@@\char'174}' */
@d line_force = @'363 /* control code for `\.{@@/}' */
@d line_break = @'364 /* control code for `\.{@@-}' */
@d big_line_break = @'365 /* control code for `\.{@@\#}' */
@d no_line_break = @'366 /* control code for `\.{@@+}' */
@d pseudo_semi = @'367 /* control code for `\.{@@;}' */
@d vertical_bar = @'370 /* The `\v' used to mark Ada text */
@d trace = @'371 /* control code for `\.{@@0}', `\.{@@1}' and `\.{@@2}' */
@d format = @'373 /* control code for `\.{@@f}' */
@d definition = @'374 /* control code for `\.{@@d}' */
@d begin_unnamed = @'375 /* control code for `\.{@@u}' */
@d module_name = @'376 /* control code for `\.{@@<}' */
@d new_module = @'377 /* control code for `\.{@@\ }' and `\.{@@*}' */
@z
----------------makefile.emx--------------------------------------
# Makefile for awkweb and ceeweb of OS/2 2.0 with emx/gcc
# Run the file from a directory containing the master\ and awk\
# subdirectories.  Edit this file to make the ROOT variable the
# same as your main spider directory.

# That is, the directory structure should look like:
#   spider\
#   spider\master\
#   spider\awk\
#   spider\c\


# make -f makefile.emx [argument]

CC = gcc -Zomf -Zmt -O
O = .obj
A = .lib

LIBS =
CFLAGS = 

# Basic directory definitions

ROOT = \spider

C       = $(ROOT)\c
AWK     = $(ROOT)\awk
MASTER  = $(ROOT)\master
DOC     = $(ROOT)\doc
OS2     = $(ROOT)

# Executables used

CTANGLE   = $(ROOT)\ceetangle.exe
CWEAVE    = $(ROOT)\ceeweave.exe
AWKTANGLE = $(ROOT)\awktangle.exe
AWKWEAVE  = $(ROOT)\awkweave.exe
TEX       = tex386
LATEX     = $(TEX) `&lplain`

# Files to make
# Note that we need ceetangle to make a new ceetangle if we do not
#   have the C version of tangle.c--its recursive.

# Also, if we lose spider.awk, it can be remade from spider.web but
#  we need awktangle to do it.


CEE_EXE = $(CTANGLE) $(CWEAVE)
AWK_EXE = $(AWKTANGLE) $(AWKWEAVE)

CEE_DVI = $(OS2)\ceeweave.dvi $(OS2)\ctangle.dvi
A_DVI   = $(OS2)\awkweave.dvi $(OS2)\atangle.dvi
AWK_DVI = $(OS2)\spider.dvi $(OS2)\cycle.dvi

COMMON_DVI   = $(OS2)\common.dvi
PATHOPEN_DVI = $(OS2)\pathopen.dvi

CACM         = $(OS2)\cacm.dvi
S_WEBMAN     = $(OS2)\s_webman.dvi
S_MAN        = $(OS2)\s_man.dvi
OVERVIEW     = $(OS2)\overview.dvi


EXE = $(CEE_EXE) $(AWK_EXE)
DVI =  $(COMMON_DVI) $(PATHOPEN_DVI) $(AWK_DVI) $(A_DVI) $(CEE_DVI)

DOCS = $(CACM) $(S_WEBMAN) $(S_MAN) $(OVERVIEW)

# What we want to make
#  The default is the AWK and C versions of tangle and weave

exe: $(EXE)

dvi: $(DVI)

docs: $(DOCS)

all: $(EXE) $(DVI) $(DOCS)

# This is how we make ceeweave and ceetangle

$(CTANGLE): $(C)\tangle$(O) $(MASTER)\common$(O) $(MASTER)\pathopen$(O) 
	$(CC) $(CFLAGS) -o $(CTANGLE) $(C)\tangle$(O) $(MASTER)\common$(O) \
          $(MASTER)\pathopen$(O)

$(C)\tangle$(O): $(C)\tangle.c
	cd $(C)
	$(CC) $(CFLAGS) -c tangle.c
	cd $(OS2)

$(C)\tangle.c: $(MASTER)\common.h $(C)\outtoks.web $(MASTER)\tangle.web
	copy $(MASTER)\tangle.web $(C)
	copy $(MASTER)\common.h $(C)
	cd $(C)
	$(CTANGLE) tangle.web
	cd $(OS2)

$(CWEAVE):  $(C)\weave$(O) $(MASTER)\common$(O) $(MASTER)\pathopen$(O)
	$(CC) $(CFLAGS) -o $(CWEAVE) $(C)\weave$(O) $(MASTER)\common$(O) \
          $(MASTER)\pathopen$(O)

$(C)\weave$(O): $(C)\weave.c 
	cd $(C)
	$(CC) $(CFLAGS) -c weave.c
	cd $(OS2)

$(C)\weave.c: $(MASTER)\weave.web $(MASTER)\common.h $(C)\grammar.web
	copy $(MASTER)\common.h $(C)
	copy $(MASTER)\weave.web $(C)
	cd $(C)
	$(CTANGLE) weave $(OS2)\weave.ch
	rm common.h weave.web
	cd $(OS2)

$(C)\grammar.web $(C)\outtoks.web $(OS2)\cweb.tex: \
             $(MASTER)\cycle.awk $(MASTER)\spider.awk $(C)\c.spider
	cd $(C)
	gawk -f $(MASTER)\spider.awk c.spider
	cat $(MASTER)\transcheck.list trans_keys.unsorted | \
           gawk -f $(MASTER)\transcheck.awk
	gawk -f $(MASTER)\cycle.awk < cycle.test
	cat *.unsorted | sort | gawk -f $(MASTER)\nodups.awk
	copy cweb.tex $(OS2)
	cd $(OS2)

# This is how we make awkweave and awktangle

$(AWKTANGLE): $(AWK)\tangle$(O) $(MASTER)\common$(O) $(MASTER)\pathopen$(O) 
	cd $(AWK)
	$(CC) $(CFLAGS) -o $(AWKTANGLE) $(AWK)\tangle$(O) $(MASTER)\common$(O)\
          $(MASTER)\pathopen$(O)
	cd $(OS2)

$(AWK)\tangle$(O): $(C)\tangle.c
	cd $(AWK)
	$(CC) $(CFLAGS) -c tangle.c
	cd $(OS2)

$(AWK)\tangle.c: $(MASTER)\common.h $(AWK)\outtoks.web $(MASTER)\tangle.web
	copy $(MASTER)\tangle.web $(AWK)
	copy $(MASTER)\common.h $(AWK)
	cd $(AWK)
	$(CTANGLE) tangle.web
	rm $(AWK)\tangle.web $(AWK)\common.h
	cd $(OS2)

$(AWKWEAVE):  $(AWK)\weave$(O) $(MASTER)\common$(O) $(MASTER)\pathopen$(O)
	$(CC) $(CFLAGS) -o $(AWKWEAVE) $(AWK)\weave$(O) $(MASTER)\common$(O) \
          $(MASTER)\pathopen$(O)

$(AWK)\weave$(O): $(AWK)\weave.c 
	cd $(AWK)
	$(CC) $(CFLAGS) -c weave.c
	cd $(OS2)

$(AWK)\weave.c: $(MASTER)\weave.web $(MASTER)\common.h $(AWK)\grammar.web
	copy $(MASTER)\weave.web $(AWK)
	copy $(MASTER)\common.h $(AWK)
	cd $(AWK)
	$(CTANGLE) weave $(OS2)\weave.ch
	cd $(OS2)

$(AWK)\grammar.web $(AWK)\outtoks.web $(OS2)\awkweb.tex:  \
                  $(MASTER)\cycle.awk $(MASTER)\spider.awk $(AWK)\awk.spider
	cd $(AWK)
	gawk -f $(MASTER)\spider.awk awk.spider
	cat $(MASTER)\transcheck.list trans_keys.unsorted | \
           gawk -f $(MASTER)\transcheck.awk
	gawk -f $(MASTER)\cycle.awk < cycle.test
	cat *.unsorted | sort | gawk -f $(MASTER)\nodups.awk
	copy awkweb.tex $(OS2)
	cd $(OS2)

$(MASTER)\spider.awk: $(MASTER)\spider.web
	cd $(MASTER)
	$(AWKTANGLE) $(MASTER)\spider.web
	cd $(OS2)


# This is how we make the files needed for all executables

$(MASTER)\pathopen$(O): $(MASTER)\pathopen.c
	cd $(MASTER)
	$(CC) $(CFLAGS) -c pathopen.c
	cd $(OS2)

$(MASTER)\pathopen.c $(MASTER)\pathopen.h: $(MASTER)\pathopen.web
	cd $(MASTER)
	$(CTANGLE) pathopen.web
	cd $(OS2)

# Note the OS2 change file here

$(MASTER)\common.c: $(MASTER)\common.web $(OS2)\common.ch
	cd $(MASTER)
	$(CTANGLE) common.web $(OS2)\common.ch
	cd $(OS2)

$(MASTER)\common$(O): $(MASTER)\common.c 
	cd $(MASTER)
	$(CC) $(CFLAGS) -c common.c
	cd $(OS2)

$(OS2)\common.dvi: $(MASTER)\common.tex $(OS2)\cweb.tex
	copy $(MASTER)\common.tex $(OS2)
	-$(TEX) common.tex
	rm $(OS2)\common.tex 

$(MASTER)\common.tex: $(MASTER)\common.web $(MASTER)\pathopen.h $(CWEAVE)
	cd $(MASTER)
	$(CWEAVE) common.web
	cd $(OS2)

$(OS2)\pathopen.dvi: $(MASTER)\pathopen.tex $(OS2)\cweb.tex
	copy $(MASTER)\pathopen.tex $(OS2)
	-$(TEX) pathopen.tex
	rm $(OS2)\pathopen.tex 

$(MASTER)\pathopen.tex: $(MASTER)\pathopen.web $(CWEAVE)
	cd $(MASTER)
	$(CWEAVE) pathopen.web
	cd $(OS2)

$(OS2)\cycle.dvi: $(MASTER)\cycle.tex $(OS2)\awkweb.tex
	copy $(MASTER)\cycle.tex $(OS2)
	-$(TEX) cycle.tex
	rm $(OS2)\cycle.tex 

$(MASTER)\cycle.tex: $(MASTER)\cycle.web $(AWKWEAVE)
	cd $(MASTER)
	$(AWKWEAVE) cycle.web
	cd $(OS2)

$(OS2)\spider.dvi: $(MASTER)\spider.tex $(OS2)\awkweb.tex
	copy $(MASTER)\spider.tex $(OS2)
	-$(TEX) spider.tex
	rm $(OS2)\spider.tex 

$(MASTER)\spider.tex: $(MASTER)\spider.web $(AWkWEAVE)
	cd $(MASTER)
	$(AWKWEAVE) spider.web
	cd $(OS2)

$(OS2)\atangle.dvi: $(AWK)\atangle.tex $(OS2)\cweb.tex
	copy $(AWK)\atangle.tex $(OS2)
	-$(TEX) atangle.tex
	rm $(OS2)\atangle.tex 

$(AWK)\atangle.tex: $(MASTER)\tangle.web $(AWK)\outtoks.web
	cd $(AWK)
	copy $(MASTER)\common.h $(AWK)
	copy $(MASTER)\tangle.web $(AWK)
	$(CWEAVE) tangle.web
	rename tangle.tex atangle.tex
	cd $(OS2)

$(OS2)\awkweave.dvi: $(AWK)\awkweave.tex $(OS2)\cweb.tex
	copy $(AWK)\awkweave.tex $(OS2)
	-$(TEX) awkweave.tex
	rm $(OS2)\awkweave.tex 

$(AWK)\awkweave.tex: $(MASTER)\weave.web $(AWK)\grammar.web $(OS2)\weave.ch
	cd $(AWK)
	copy $(MASTER)\common.h $(AWK)
	copy $(MASTER)\weave.web $(AWK)
	$(CWEAVE) weave.web $(OS2)\weave.ch
	rename weave.tex awkweave.tex
	cd $(OS2)

$(OS2)\ceeweave.dvi: $(C)\ceeweave.tex $(OS2)\cweb.tex
	copy $(C)\ceeweave.tex $(OS2)
	-$(TEX) ceeweave.tex
	rm $(OS2)\ceeweave.tex 

$(C)\ceeweave.tex: $(MASTER)\weave.web $(C)\grammar.web $(OS2)\weave.ch
	cd $(C)
	copy $(MASTER)\common.h $(C)
	copy $(MASTER)\weave.web $(C)
	$(CWEAVE) weave.web $(OS2)\weave.ch
	rename weave.tex ceeweave.tex
	cd $(OS2)

# I wanted to call this ceetangle.dvi, but tex386 only understands
# the 8.3 filenames right now so ceetangle was one character too long.

$(OS2)\ctangle.dvi: $(C)\ctangle.tex $(OS2)\cweb.tex
	copy $(C)\ctangle.tex $(OS2)
	-$(TEX) ctangle.tex
	rm $(OS2)\ctangle.tex 

$(C)\ctangle.tex: $(MASTER)\tangle.web $(C)\outtoks.web
	cd $(C)
	copy $(MASTER)\common.h $(C)
	copy $(MASTER)\tangle.web $(C)
	$(CWEAVE) tangle.web
	rename tangle.tex ctangle.tex
	cd $(OS2)

# This cleanup applies to the root directoru, master\, c\, and awk\.

clean:
	cd $(AWK)
	-rm  -f tangle.* weave.* common.* 
	-rm  -f *.unsorted *.list grammar.web outtoks.web scraps.web 
	-rm  -f cycle.test spider.slog *.obj
	-rm  -f *.c *.o *.tex *.toc *.dvi *.log *.makelog *~ *.wlog *.printlog
	cd $(C)
	-rm  -f tangle.* weave.* common.* 
	-rm  -f *.unsorted *.list grammar.web outtoks.web scraps.web 
	-rm  -f cycle.test spider.slog *.obj
	-rm  -f *.c *.o *.tex *.toc *.dvi *.log *.makelog *~ *.wlog *.printlog
	cd $(MASTER)
	-rm  -f *.tex *.obj common.c
	cd $(OS2)
	-rm  -f *.dvi *.log *.toc

$(CACM): $(DOC)\cacm.tex
	copy $(DOC)\cacm.* $(OS2)
	-$(LATEX) cacm
	-rm  -f cacm.tex cacm.aux cacm.log 

$(S_WEBMAN): $(DOC)\spiderwebman.tex
	copy $(DOC)\spiderwebman.tex $(OS2)\s_webman.tex
	-$(TEX) s_webman.tex
	-rm  -f *.log *.aux s_webman.tex

$(S_MAN): $(DOC)\spiderman.tex
	copy $(DOC)\spiderman.tex $(OS2)\s_man.tex
	-$(LATEX) s_man.tex
	-$(LATEX) s_man.tex
	-rm  -f *.log *.aux s_man.tex

$(OVERVIEW): $(DOC)\overview.tex
	copy $(DOC)\overview.tex $(OS2)
	-$(LATEX) overview.tex
	-$(LATEX) overview.tex
	-rm  -f *.log *.aux overview.tex