summaryrefslogtreecommitdiff
path: root/web/web2w/Makefile
blob: f35b1686180bf8923deb1d6a848318cbfa677a9d (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


all: ctex ctex.dvi


cweb/cweave.w: cweave.patch 
	patch --verbose cweb/cweave.w cweave.patch

cweb/ctangle.w: ctangle.patch 
	patch --verbose cweb/ctangle.w ctangle.patch

cweb/common.w: common.patch 
	patch --verbose cweb/common.w common.patch

CWEAVE=cweb/cweave
CTANGLE=cweb/ctangle

cweb/ctangle: cweb/ctangle.w cweb/common.w
	cd cweb ;\
	if [ ! -x ./ctangle ] ; then $(CC) $(CFLAGS) -o ctangle ctangle.c common.c ; fi ;\
	./ctangle ctangle.w ; \
	./ctangle common.w ; \
	$(CC) $(CFLAGS) -o ctangle ctangle.c common.c ; \
	cd ..

cweb/cweave: $(CTANGLE) cweb/cweave.w cweb/common.w
	cd cweb ;\
	./ctangle cweave.w ; \
	./ctangle common.w ; \
	$(CC) $(CFLAGS) -o cweave cweave.c common.c ; \
	cd ..


web.lex.c : web.l web2w.h pascal.tab.h
	flex -o web.lex.c web.l

pascal.tab.c pascal.tab.h: pascal.y
	bison -d -v $(NAMEPREFIX) pascal.y

web2w.c web2w.h: $(CTANGLE) web2w.w
	$(CTANGLE) web2w.w


web2w: web2w.c web.lex.c pascal.tab.c
	$(CC) -o web2w web2w.c web.lex.c pascal.tab.c

web2w.tex: $(CWEAVE) web2w.w
	$(CWEAVE) web2w.w

ctex.w: tex.w
	patch --verbose -o ctex.w tex.w ctex.patch

tex.w: web2w
	./web2w -o tex.w tex/tex.web

ctex.c: $(CTANGLE) ctex.w
	$(CTANGLE) ctex.w

ctex.tex: $(CWEAVE) ctex.w
	$(CWEAVE) ctex.w

ctex: ctex.c 
	$(CC) ctex.c -lm -o ctex

cinitex: ctex.c 
	$(CC) -DINIT ctex.c -lm -o cinitex


ctex.pdf: ctex.tex
	pdftex ctex.tex


plain.fmt: cinitex
	echo "plain \\dump" | ./cinitex 
	cp plain.fmt TeXformats/

ctex.dvi: ctex ctex.tex plain.fmt
	echo "&plain ctex" | ./ctex



clean:
	rm -f *.idx *.log *.dvi *.scn *.toc *~
	rm -f cinitex ctex web2w
	$(MAKE) -C cweb clean