-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommonrules
129 lines (112 loc) · 2.65 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
# 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 -f 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 $*.aux $*.auxprev; \
else echo > $*.auxprev; \
fi
@echo "$(LATEX) $<"
@sh -c "$(LATEX) $< || (rm -f $*.aux; sleep 1; touch $*.stamp; exit 1)"
@-cmp -s $*.aux $*.auxprev; \
if test $$? = 1; \
then \
sleep 1; \
echo "==> Rebuilding $@"; \
touch $*.stamp; \
$(MAKE) $@; \
else \
echo "==> No need to rebuild $@"; \
fi
@rm -f $*.auxprev
.tex.pdf:
@if test -r "$*.aux"; \
then cp $*.aux $*.auxprev; \
else echo > $*.auxprev; \
fi
@echo "$(PDFLATEX) $<"
@sh -c "$(PDFLATEX) $< || (rm -f $*.aux; sleep 1; touch $*.stamp; exit 1)"
@-cmp -s $*.aux $*.auxprev; \
if test $$? = 1; \
then \
sleep 1; \
echo "==> Rebuilding $@"; \
touch $*.stamp; \
$(MAKE) $@; \
else \
echo "==> No need to rebuild $@"; \
fi
@rm -f $*.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 $(BIBOPTS) $* || echo"; else echo; fi
.tex.stamp: # backward compatibility
touch $@
.dvi.ps:
$(DVIPS) $(DVIPSOPTS) $< -o $@
.eps.pdf:
epstopdf $<
#
# 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