OLD | NEW |
| (Empty) |
1 # UGH. GNU make comes with implicit rules. | |
2 # We don't want any of them, and can't force users to run | |
3 # --no-builtin-rules | |
4 | |
5 .SUFFIXES: | |
6 | |
7 #Compiling C programs | |
8 # `N.o' is made automatically from `N.c' with a command of the form | |
9 # `$(CC) -c $(CPPFLAGS) $(CFLAGS)'. | |
10 | |
11 %.o: %.c | |
12 | |
13 # Compiling C++ programs | |
14 # `N.o' is made automatically from `N.cc' or `N.C' with a command of | |
15 # the form `$(CXX) -c $(CPPFLAGS) $(CXXFLAGS)'. We encourage you to | |
16 # use the suffix `.cc' for C++ source files instead of `.C'. | |
17 | |
18 %.o: %.cc | |
19 | |
20 # Compiling Pascal programs | |
21 # `N.o' is made automatically from `N.p' with the command `$(PC) -c | |
22 # $(PFLAGS)'. | |
23 | |
24 %.o: %.p | |
25 | |
26 # Compiling Fortran and Ratfor programs | |
27 # `N.o' is made automatically from `N.r', `N.F' or `N.f' by running | |
28 # the Fortran compiler. The precise command used is as follows: | |
29 | |
30 # `.f' | |
31 # `$(FC) -c $(FFLAGS)'. | |
32 | |
33 %.o: %.f | |
34 | |
35 # `.F' | |
36 # `$(FC) -c $(FFLAGS) $(CPPFLAGS)'. | |
37 | |
38 %.o: %.F | |
39 | |
40 # `.r' | |
41 # `$(FC) -c $(FFLAGS) $(RFLAGS)'. | |
42 | |
43 %.o: %.r | |
44 | |
45 # Preprocessing Fortran and Ratfor programs | |
46 # `N.f' is made automatically from `N.r' or `N.F'. This rule runs | |
47 # just the preprocessor to convert a Ratfor or preprocessable | |
48 # Fortran program into a strict Fortran program. The precise | |
49 # command used is as follows: | |
50 | |
51 # `.F' | |
52 # `$(FC) -F $(CPPFLAGS) $(FFLAGS)'. | |
53 | |
54 %.f: %.F | |
55 | |
56 # `.r' | |
57 # `$(FC) -F $(FFLAGS) $(RFLAGS)'. | |
58 | |
59 %.f: %.r | |
60 | |
61 # Compiling Modula-2 programs | |
62 # `N.sym' is made from `N.def' with a command of the form `$(M2C) | |
63 # $(M2FLAGS) $(DEFFLAGS)'. `N.o' is made from `N.mod'; the form is: | |
64 # `$(M2C) $(M2FLAGS) $(MODFLAGS)'. | |
65 | |
66 %.sym: %.def | |
67 %.o: %.mod | |
68 | |
69 # Assembling and preprocessing assembler programs | |
70 # `N.o' is made automatically from `N.s' by running the assembler, | |
71 # `as'. The precise command is `$(AS) $(ASFLAGS)'. | |
72 | |
73 %.o: %.s | |
74 | |
75 # `N.s' is made automatically from `N.S' by running the C | |
76 # preprocessor, `cpp'. The precise command is `$(CPP) $(CPPFLAGS)'. | |
77 | |
78 %.s: %.S | |
79 | |
80 # Linking a single object file | |
81 # `N' is made automatically from `N.o' by running the linker | |
82 # (usually called `ld') via the C compiler. The precise command | |
83 # used is `$(CC) $(LDFLAGS) N.o $(LOADLIBES) $(LDLIBS)'. | |
84 | |
85 %: %.o | |
86 | |
87 # This rule does the right thing for a simple program with only one | |
88 # source file. It will also do the right thing if there are multiple | |
89 # object files (presumably coming from various other source files), | |
90 # one of which has a name matching that of the executable file. | |
91 # Thus, | |
92 | |
93 # x: y.o z.o | |
94 | |
95 # when `x.c', `y.c' and `z.c' all exist will execute: | |
96 | |
97 # cc -c x.c -o x.o | |
98 # cc -c y.c -o y.o | |
99 # cc -c z.c -o z.o | |
100 # cc x.o y.o z.o -o x | |
101 # rm -f x.o | |
102 # rm -f y.o | |
103 # rm -f z.o | |
104 | |
105 # In more complicated cases, such as when there is no object file | |
106 # whose name derives from the executable file name, you must write | |
107 # an explicit command for linking. | |
108 | |
109 # Each kind of file automatically made into `.o' object files will | |
110 # be automatically linked by using the compiler (`$(CC)', `$(FC)' or | |
111 # `$(PC)'; the C compiler `$(CC)' is used to assemble `.s' files) | |
112 # without the `-c' option. This could be done by using the `.o' | |
113 # object files as intermediates, but it is faster to do the | |
114 # compiling and linking in one step, so that's how it's done. | |
115 | |
116 # Yacc for C programs | |
117 # `N.c' is made automatically from `N.y' by running Yacc with the | |
118 # command `$(YACC) $(YFLAGS)'. | |
119 | |
120 %.c: %.y | |
121 | |
122 # Lex for C programs | |
123 # `N.c' is made automatically from `N.l' by by running Lex. The | |
124 # actual command is `$(LEX) $(LFLAGS)'. | |
125 | |
126 %.c: %.l | |
127 | |
128 # Lex for Ratfor programs | |
129 # `N.r' is made automatically from `N.l' by by running Lex. The | |
130 # actual command is `$(LEX) $(LFLAGS)'. | |
131 | |
132 %.r: %.l | |
133 | |
134 # The convention of using the same suffix `.l' for all Lex files | |
135 # regardless of whether they produce C code or Ratfor code makes it | |
136 # impossible for `make' to determine automatically which of the two | |
137 # languages you are using in any particular case. If `make' is | |
138 # called upon to remake an object file from a `.l' file, it must | |
139 # guess which compiler to use. It will guess the C compiler, because | |
140 # that is more common. If you are using Ratfor, make sure `make' | |
141 # knows this by mentioning `N.r' in the makefile. Or, if you are | |
142 # using Ratfor exclusively, with no C files, remove `.c' from the | |
143 # list of implicit rule suffixes with: | |
144 | |
145 # .SUFFIXES: | |
146 # .SUFFIXES: .o .r .f .l ... | |
147 | |
148 # Making Lint Libraries from C, Yacc, or Lex programs | |
149 # `N.ln' is made from `N.c' by running `lint'. The precise command | |
150 # is `$(LINT) $(LINTFLAGS) $(CPPFLAGS) -i'. The same command is | |
151 # used on the C code produced from `N.y' or `N.l'. | |
152 | |
153 %.ln: %.c | |
154 | |
155 # TeX and Web | |
156 # `N.dvi' is made from `N.tex' with the command `$(TEX)'. `N.tex' | |
157 # is made from `N.web' with `$(WEAVE)', or from `N.w' (and from | |
158 # `N.ch' if it exists or can be made) with `$(CWEAVE)'. `N.p' is | |
159 # made from `N.web' with `$(TANGLE)' and `N.c' is made from `N.w' | |
160 # (and from `N.ch' if it exists or can be made) with `$(CTANGLE)'. | |
161 | |
162 %.dvi: %.tex | |
163 %.tex: %.web | |
164 %.tex: %.w | |
165 %.tex: %.ch | |
166 %.p: %.web | |
167 %.c: %.w | |
168 %.w: %.ch | |
169 | |
170 # Texinfo and Info | |
171 # `N.dvi' is made from `N.texinfo', `N.texi', or `N.txinfo', with | |
172 # the command `$(TEXI2DVI) $(TEXI2DVI_FLAGS)'. `N.info' is made from | |
173 # `N.texinfo', `N.texi', or `N.txinfo', with the command | |
174 # `$(MAKEINFO) $(MAKEINFO_FLAGS)'. | |
175 | |
176 %.dvi: %.texinfo | |
177 %.dvi: %.texi | |
178 %.dvi: %.txinfo | |
179 | |
180 %.info: %.texinfo | |
181 %.info: %.texi | |
182 %.info: %.txinfo | |
183 | |
184 # RCS | |
185 # Any file `N' is extracted if necessary from an RCS file named | |
186 # either `N,v' or `RCS/N,v'. The precise command used is | |
187 # `$(CO) $(COFLAGS)'. `N' will not be extracted from RCS if it | |
188 # already exists, even if the RCS file is newer. The rules for RCS | |
189 # are terminal (*note Match-Anything Pattern Rules: Match-Anything | |
190 # Rules.), so RCS files cannot be generated from another source; | |
191 # they must actually exist. | |
192 | |
193 %: %,v | |
194 %: RCS/%,v | |
195 | |
196 # SCCS | |
197 # Any file `N' is extracted if necessary from an SCCS file named | |
198 # either `s.N' or `SCCS/s.N'. The precise command used is | |
199 # `$(GET) $(GFLAGS)'. The rules for SCCS are terminal (*note | |
200 # Match-Anything Pattern Rules: Match-Anything Rules.), so SCCS | |
201 # files cannot be generated from another source; they must actually | |
202 # exist. | |
203 | |
204 %: s.% | |
205 %: SCCS/s.% | |
206 | |
207 # For the benefit of SCCS, a file `N' is copied from `N.sh' and made | |
208 # executable (by everyone). This is for shell scripts that are | |
209 # checked into SCCS. Since RCS preserves the execution permission | |
210 # of a file, you do not need to use this feature with RCS. | |
211 | |
212 %: %.sh | |
213 | |
214 # We recommend that you avoid using of SCCS. RCS is widely held to | |
215 # be superior, and is also free. By choosing free software in place | |
216 # of comparable (or inferior) proprietary software, you support the | |
217 # free software movement. | |
218 | |
219 # Usually, you want to change only the variables listed in the table | |
220 # above, which are documented in the following section. | |
221 | |
222 # However, the commands in built-in implicit rules actually use | |
223 # variables such as `COMPILE.c', `LINK.p', and `PREPROCESS.S', whose | |
224 # values contain the commands listed above. | |
225 | |
226 # `make' follows the convention that the rule to compile a `.X' source | |
227 # file uses the variable `COMPILE.X'. Similarly, the rule to produce an | |
228 # executable from a `.X' file uses `LINK.X'; and the rule to preprocess a | |
229 # `.X' file uses `PREPROCESS.X'. | |
230 | |
231 # Every rule that produces an object file uses the variable | |
232 # `OUTPUT_OPTION'. `make' defines this variable either to contain `-o | |
233 # $@', or to be empty, depending on a compile-time option. You need the | |
234 # `-o' option to ensure that the output goes into the right file when the | |
235 # source file is in a different directory, as when using `VPATH' (*note | |
236 # Directory Search::). However, compilers on some systems do not accept | |
237 # a `-o' switch for object files. If you use such a system, and use | |
238 # `VPATH', some compilations will put their output in the wrong place. A | |
239 # possible workaround for this problem is to give `OUTPUT_OPTION' the | |
240 # value `; mv $*.o $@'. | |
241 | |
242 | |
OLD | NEW |