forked from mit-pdos/xv6-book
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
85 lines (65 loc) · 1.36 KB
/
Makefile
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
CONTENTS_INDEXED=\
unix\
first\
mem\
trap\
lock\
sched\
fs\
sum\
apphw\
appboot\
CONTENTS=\
$(CONTENTS_INDEXED)\
index\
ORDER_INDEXED=\
title\
contents\
acks\
ORDER=\
$(ORDER_INDEXED)\
$(CONTENTS)\
INDEXED=\
$(ORDER_INDEXED)\
$(CONTENTS_INDEXED)\
SCRIPTS=\
run1\
twopage\
savelast\
figures\
runfig\
ditspaces\
PS=$(patsubst %,%.ps,$(ORDER))
PDF=$(patsubst %,%.pdf,$(ORDER))
DIT=$(patsubst %,%.dit,$(ORDER))
export UCB = /usr/local/ucb
all: book.pdf
pdf: $(PDF)
ps: $(PS)
dit: $(DIT)
.PHONY: all pdf ps dit
book.ps: $(DIT)
$(UCB)/dpost $(DIT) >book.ps || rm -f book.ps
%.dit: book.mac %.t z.%.first $(SCRIPTS) z.fignums
./run1 $*
%.ps: %.dit
/usr/ucb/dpost $*.dit >$*.ps || rm -f $*.ps
%.pdf: %.ps
ps2pdf $*.ps $*.pdf
clean:
rm -f $(PS) $(PDF) $(DIT) z.*
xv6-code.pdf: ../xv6/xv6.pdf
cp $^ $@
include $(shell ./make-pageorder $(ORDER))
include $(shell ./make-figdeps $(ORDER))
contents.dit: contents1.t
index.dit: index1.t
contents1.t: mkcontents $(patsubst %,%.t,$(CONTENTS)) $(patsubst %,z.%.first,$(CONTENTS))
./mkcontents $(CONTENTS) >$@ || rm -f $@
INDEXED_DIT=$(patsubst %,%.dit,$(INDEXED))
index1.t: mkindex $(INDEXED_DIT)
./mkindex $(INDEXED_DIT) >$@ || rm -f $@
bootstrap: $(patsubst %,z.%.first,$(ORDER))
INDEXED_T=$(patsubst %,%.t,$(INDEXED))
z.fignums: mkfignums book.mac $(INDEXED_T)
./mkfignums $(INDEXED_T) >$@ || rm -f $@