summaryrefslogtreecommitdiff
path: root/graphics/tree/Makefile.kit
blob: 2b3db369b0c74042d4f9348603a3c1db50981ab3 (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
# Makefile for tree, June, 1990.  Greg Lee

#LEX = 
#LEXLIB = -ll
# or if you don't have flex, use:
LEX = lex
LEXLIB = -ll

INSTALL=install

# Use flag -u or -t to make .tex files:
UT = -u

# Keyword required by PS driver at the begining of TeX
# \specials to incorporate line of text directly in PS output
# (see explanation at the beginning of tex.c).  Default is
# no keyword.
#DEFS = -DSKEY=\"ps::\"
#DEFS = -DSKEY=\"ps-string \"
#DEFS = -DSKEY=\"ps-string=\"
#DEFS = -DSKEY=\"pstext=\"
DEFS =

install: all
	$(INSTALL) -o $(USER) -g $(GROUP) tree ${BIN}
	$(INSTALL) -o $(USER) -g $(GROUP) tpar ${BIN}
	$(INSTALL) -o $(USER) -g $(GROUP) unpar ${BIN}
	$(INSTALL) -o $(USER) -g $(GROUP) tree.1 $(MAN)/man1

all: tree tpar unpar

tree:	tree.l tex.c
	$(LEX) tree.l
	cc $(DEFS) -O -s -o tree lex.yy.c $(LEXLIB)
	rm lex.yy.c

tpar: tpar.l
	$(LEX) tpar.l
	cc -O -s -o tpar lex.yy.c $(LEXLIB)
	rm lex.yy.c

unpar: unpar.l
	$(LEX) unpar.l
	cc -O -s -o unpar lex.yy.c $(LEXLIB)
	rm lex.yy.c

mdoc:	mdoc.l
	$(LEX) mdoc.l
	cc -O -s -o mdoc lex.yy.c $(LEXLIB)
	@rm lex.yy.c

use.tre: use.raw mdoc
	rm -f use.tre
	mdoc <use.raw >use.tre

tex:	sample.tex texsample.tex tpsample.tex use.tex

sample.tex: sample tree
	rm -f sample.tex
	@echo '--- Expect a warning about an ill-formed \tree command ---'
	tree $(UT) sample >sample.tex
tpsample.tex: tpsample tree tpar
	rm -f tpsample.tex
	tpar -t tpsample |tree $(UT) >tpsample.tex
texsample.tex: texsample tree
	rm -f texsample.tex
	tree $(UT) texsample >texsample.tex
use.tex: use.tre tree
	rm -f use.tex
	@echo '--- Expect two warnings about discarded text ---'
	tree $(UT) use.tre >use.tex

shar:
	makekit -m
	mv Part01 tree.shar1
	mv Part02 tree.shar2
	mv Part03 tree.shar3

DIST = MANIFEST Makefile README mdoc.l sample tex.c \
	texsample tpar.l tpsample tree.1 tree.l unpar.l use.raw

tar:	$(DIST)
	tar cf tree.tar $(DIST)

clean:
	rm -f *.aux *.dvi *.lof *.log *.toc *.blg *.bbl *.ilg *.ind *.idx lex.yy.c tree tpar unpar