-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommonrules
146 lines (127 loc) · 3.97 KB
/
commonrules
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
# Some basic recursive rules for building, installing, and cleaning up
# a source tree
#
subdirs:
@sub="$(SUBDIRS)"; \
for i in $$sub; do if test -n "$$i"; then \
(cd $$i; make); \
fi; done;
clean: localclean
@sub="$(SUBDIRS)"; \
for i in $$sub; do if test -n "$$i"; then \
(cd $$i; make $@); \
fi; done;
localclean:
$(RM) $(DIRT)
clobber: localclean
@sub="$(SUBDIRS)"; \
for i in $$sub; do if test -n "$$i"; then \
(cd $$i; make $@); \
fi; done;
$(RM) $(TARGETS) $(GENERATED)
install: default localinstall
@sub="$(SUBDIRS)"; \
for i in $$sub; do if test -n "$$i"; then \
(cd $$i; make $@); \
fi; done;
incdepend: .dependtime
depend: .dependtime
.dependtime: $(SOURCES)
touch temp
$(MKDEPEND) $(MKDEPC++FLAGS) -f temp $(C++FILES)
touch $(MKDEPFILE)
$(MKDEPEND) $(MKDEPCFLAGS) -f $(MKDEPFILE) $(CFILES)
cat temp >> $(MKDEPFILE)
$(RM) temp
touch $@
# Rules for TeX files
#
# The line that runs LATEX needs to run inside a subshell to turn off
# "make"'s status checking. It blows away .aux because the .aux file
# created is bad and also breaks bibtex. It touches .stamp to force a
# rebuild.
.tex.dvi:
@if test -r "$*.aux"; \
then cp "$(BUILDD)$*.aux" "$(BUILDD)$*.auxprev"; \
else echo > "$(BUILDD)$*.auxprev"; \
fi
@echo "$(LATEX) $<"
@sh -c "$(LATEX) $< || ($(RM) $*.aux; sleep 1; touch \"$(BUILDD)$*.stamp\"; exit 1)"
@-cmp -s "$(BUILDD)$*.aux" "$(BUILDD)$*.auxprev"; \
if test $$? = 1; \
then \
echo "==> Rebuilding $@"; \
touch "$(BUILDD)$*.stamp"; \
while [ ! $(BUILDD)$*.stamp -nt $@ ]; do \
sleep 0.2; \
touch "$(BUILDD)$*.stamp"; \
done; \
$(MAKE) $@; \
else \
echo "==> No need to rebuild $@"; \
fi
@$(RM) "$(BUILDD)$*.auxprev"
.tex.pdf:
@if test -r "$(BUILDD)$*.aux"; \
then cp "$(BUILDD)$*.aux" "$(BUILDD)$*.auxprev"; \
else echo > "$(BUILDD)$*.auxprev"; \
fi
@echo "$(PDFLATEX) $<"
@sh -c "$(PDFLATEX) $< || ($(RM) $*.aux; sleep 1; touch \"$(BUILDD)$*.stamp\"; exit 1)"
@-diff -q "$(BUILDD)$*.aux" "$(BUILDD)$*.auxprev"; \
if test $$? = 1; \
then \
echo "==> Rebuilding $@"; \
touch "$(BUILDD)$*.stamp"; \
while [ ! $(BUILDD)$*.stamp -nt $@ ]; do \
sleep 0.2; \
touch "$(BUILDD)$*.stamp"; \
done; \
$(MAKE) $@; \
else \
echo "==> No need to rebuild $@"; \
fi
@$(RM) "$(BUILDD)$*.auxprev"
# must add dependencies like
# foo.ind: foo.stamp
# foo.dvi: foo.ind
# to use this rule properly.
.tex.ind:
@if [ -f $*.idx ]; then \
echo makeindex $*.idx; \
makeindex $*.idx; \
else \
echo touch $@; \
touch $@; \
fi
# must add dependencies like
# foo.bbl: foo.bib
# foo.dvi: foo.bbl
# to use this rule properly.
.tex.bbl:
@if [ -r $*.aux ]; \
then echo $(BIBTEX) $*; \
sh -c "$(BIBTEX) $* || echo"; \
else echo; fi
.tex.stamp: # backward compatibility
touch $@
.dvi.ps:
$(DVIPS) $(DVIPSOPTS) $< -o $@
.eps.pdf:
epstopdf $(EPSTOPDFOPTS) $<
#
# Rules for C++ and .i files
#
.C.i:
$(C++F) -E $< > $@
.c.i:
$(CCF) -E $< > $@
.C.o:
$(C++F) -c $<
# include $(M3SU) # old Modula-3 rules
# Paper versions
$(PAPERVERSIONS):
@$(MAKE) SHELL=$(BINSH) DOC=$@
arxiv-expanded.tex: arxiv
latexpand -o arxiv-expanded.tex arxiv.tex
.PHONY: $(PAPERVERSIONS)