1 | /* Data base of default implicit rules for GNU Make.
|
---|
2 | Copyright (C) 1988,89,90,91,92,93,94,95,96 Free Software Foundation, Inc.
|
---|
3 | This file is part of GNU Make.
|
---|
4 |
|
---|
5 | GNU Make is free software; you can redistribute it and/or modify
|
---|
6 | it under the terms of the GNU General Public License as published by
|
---|
7 | the Free Software Foundation; either version 2, or (at your option)
|
---|
8 | any later version.
|
---|
9 |
|
---|
10 | GNU Make is distributed in the hope that it will be useful,
|
---|
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
13 | GNU General Public License for more details.
|
---|
14 |
|
---|
15 | You should have received a copy of the GNU General Public License
|
---|
16 | along with GNU Make; see the file COPYING. If not, write to
|
---|
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
---|
18 | Boston, MA 02111-1307, USA. */
|
---|
19 |
|
---|
20 | #include "make.h"
|
---|
21 | #include "filedef.h"
|
---|
22 | #include "variable.h"
|
---|
23 | #include "rule.h"
|
---|
24 | #include "dep.h"
|
---|
25 | #include "job.h"
|
---|
26 | #include "commands.h"
|
---|
27 |
|
---|
28 | /* Define GCC_IS_NATIVE if gcc is the native development environment on
|
---|
29 | your system (gcc/bison/flex vs cc/yacc/lex). */
|
---|
30 | #if defined(__MSDOS__) || defined(__EMX__)
|
---|
31 | # define GCC_IS_NATIVE
|
---|
32 | #endif
|
---|
33 |
|
---|
34 |
|
---|
35 | /* This is the default list of suffixes for suffix rules.
|
---|
36 | `.s' must come last, so that a `.o' file will be made from
|
---|
37 | a `.c' or `.p' or ... file rather than from a .s file. */
|
---|
38 |
|
---|
39 | static char default_suffixes[]
|
---|
40 | #ifdef VMS
|
---|
41 | = ".exe .olb .ln .obj .c .cxx .cc .pas .p .for .f .r .y .l .mar \
|
---|
42 | .s .ss .i .ii .mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
|
---|
43 | .w .ch .cweb .web .com .sh .elc .el";
|
---|
44 | #elif defined(__EMX__)
|
---|
45 | = ".out .a .ln .o .c .cc .C .cpp .p .f .F .r .y .l .s .S \
|
---|
46 | .mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
|
---|
47 | .w .ch .web .sh .elc .el .obj .exe .dll .lib";
|
---|
48 | #else
|
---|
49 | = ".out .a .ln .o .c .cc .C .cpp .p .f .F .r .y .l .s .S \
|
---|
50 | .mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
|
---|
51 | .w .ch .web .sh .elc .el";
|
---|
52 | #endif
|
---|
53 |
|
---|
54 | static struct pspec default_pattern_rules[] =
|
---|
55 | {
|
---|
56 | { "(%)", "%",
|
---|
57 | "$(AR) $(ARFLAGS) $@ $<" },
|
---|
58 |
|
---|
59 | /* The X.out rules are only in BSD's default set because
|
---|
60 | BSD Make has no null-suffix rules, so `foo.out' and
|
---|
61 | `foo' are the same thing. */
|
---|
62 | #ifdef VMS
|
---|
63 | { "%.exe", "%",
|
---|
64 | "copy $< $@" },
|
---|
65 | #else
|
---|
66 | { "%.out", "%",
|
---|
67 | "@rm -f $@ \n cp $< $@" },
|
---|
68 | #endif
|
---|
69 | /* Syntax is "ctangle foo.w foo.ch foo.c". */
|
---|
70 | { "%.c", "%.w %.ch",
|
---|
71 | "$(CTANGLE) $^ $@" },
|
---|
72 | { "%.tex", "%.w %.ch",
|
---|
73 | "$(CWEAVE) $^ $@" },
|
---|
74 |
|
---|
75 | { 0, 0, 0 }
|
---|
76 | };
|
---|
77 |
|
---|
78 | static struct pspec default_terminal_rules[] =
|
---|
79 | {
|
---|
80 | #ifdef VMS
|
---|
81 | /* RCS. */
|
---|
82 | { "%", "%$$5lv", /* Multinet style */
|
---|
83 | "if f$$search($@) .nes. \"\" then +$(CHECKOUT,v)" },
|
---|
84 | { "%", "[.$$rcs]%$$5lv", /* Multinet style */
|
---|
85 | "if f$$search($@) .nes. \"\" then +$(CHECKOUT,v)" },
|
---|
86 | { "%", "%_v", /* Normal style */
|
---|
87 | "if f$$search($@) .nes. \"\" then +$(CHECKOUT,v)" },
|
---|
88 | { "%", "[.rcs]%_v", /* Normal style */
|
---|
89 | "if f$$search($@) .nes. \"\" then +$(CHECKOUT,v)" },
|
---|
90 |
|
---|
91 | /* SCCS. */
|
---|
92 | /* ain't no SCCS on vms */
|
---|
93 | #else
|
---|
94 | /* RCS. */
|
---|
95 | { "%", "%,v",
|
---|
96 | "$(CHECKOUT,v)" },
|
---|
97 | { "%", "RCS/%,v",
|
---|
98 | "$(CHECKOUT,v)" },
|
---|
99 | { "%", "RCS/%",
|
---|
100 | "$(CHECKOUT,v)" },
|
---|
101 |
|
---|
102 | /* SCCS. */
|
---|
103 | { "%", "s.%",
|
---|
104 | "$(GET) $(GFLAGS) $(SCCS_OUTPUT_OPTION) $<" },
|
---|
105 | { "%", "SCCS/s.%",
|
---|
106 | "$(GET) $(GFLAGS) $(SCCS_OUTPUT_OPTION) $<" },
|
---|
107 | #endif /* !VMS */
|
---|
108 | { 0, 0, 0 }
|
---|
109 | };
|
---|
110 |
|
---|
111 | static char *default_suffix_rules[] =
|
---|
112 | {
|
---|
113 | #ifdef VMS
|
---|
114 | ".obj.exe",
|
---|
115 | "$(LINK.obj) $^ $(LOADLIBES) $(LDLIBS) $(CRT0) /exe=$@",
|
---|
116 | ".mar.exe",
|
---|
117 | "$(COMPILE.mar) $^ \n $(LINK.obj) $(subst .mar,.obj,$^) $(LOADLIBES) $(LDLIBS) $(CRT0) /exe=$@",
|
---|
118 | ".s.exe",
|
---|
119 | "$(COMPILE.s) $^ \n $(LINK.obj) $(subst .s,.obj,$^) $(LOADLIBES) $(LDLIBS) $(CRT0) /exe=$@",
|
---|
120 | ".c.exe",
|
---|
121 | "$(COMPILE.c) $^ \n $(LINK.obj) $(subst .c,.obj,$^) $(LOADLIBES) $(LDLIBS) $(CRT0) /exe=$@",
|
---|
122 | ".cc.exe",
|
---|
123 | #ifdef GCC_IS_NATIVE
|
---|
124 | "$(COMPILE.cc) $^ \n $(LINK.obj) $(CXXSTARTUP),sys$$disk:[]$(subst .cc,.obj,$^) $(LOADLIBES) $(LXLIBS) $(LDLIBS) $(CXXRT0) /exe=$@",
|
---|
125 | #else
|
---|
126 | "$(COMPILE.cc) $^ \n $(CXXLINK.obj) $(subst .cc,.obj,$^) $(LOADLIBES) $(LXLIBS) $(LDLIBS) $(CXXRT0) /exe=$@",
|
---|
127 | ".cxx.exe",
|
---|
128 | "$(COMPILE.cxx) $^ \n $(CXXLINK.obj) $(subst .cxx,.obj,$^) $(LOADLIBES) $(LXLIBS) $(LDLIBS) $(CXXRT0) /exe=$@",
|
---|
129 | #endif
|
---|
130 | ".for.exe",
|
---|
131 | "$(COMPILE.for) $^ \n $(LINK.obj) $(subst .for,.obj,$^) $(LOADLIBES) $(LDLIBS) /exe=$@",
|
---|
132 | ".pas.exe",
|
---|
133 | "$(COMPILE.pas) $^ \n $(LINK.obj) $(subst .pas,.obj,$^) $(LOADLIBES) $(LDLIBS) /exe=$@",
|
---|
134 |
|
---|
135 | ".com",
|
---|
136 | "copy $< >$@",
|
---|
137 |
|
---|
138 | ".mar.obj",
|
---|
139 | "$(COMPILE.mar) /obj=$@ $<",
|
---|
140 | ".s.obj",
|
---|
141 | "$(COMPILE.s) /obj=$@ $<",
|
---|
142 | ".ss.obj",
|
---|
143 | "$(COMPILE.s) /obj=$@ $<",
|
---|
144 | ".c.i",
|
---|
145 | "$(COMPILE.c)/prep /list=$@ $<",
|
---|
146 | ".c.s",
|
---|
147 | "$(COMPILE.c)/noobj/machine /list=$@ $<",
|
---|
148 | ".i.s",
|
---|
149 | "$(COMPILE.c)/noprep/noobj/machine /list=$@ $<",
|
---|
150 | ".c.obj",
|
---|
151 | "$(COMPILE.c) /obj=$@ $<",
|
---|
152 | ".cc.ii",
|
---|
153 | "$(COMPILE.cc)/prep /list=$@ $<",
|
---|
154 | ".cc.ss",
|
---|
155 | "$(COMPILE.cc)/noobj/machine /list=$@ $<",
|
---|
156 | ".ii.ss",
|
---|
157 | "$(COMPILE.cc)/noprep/noobj/machine /list=$@ $<",
|
---|
158 | ".cc.obj",
|
---|
159 | "$(COMPILE.cc) /obj=$@ $<",
|
---|
160 | ".cxx.obj",
|
---|
161 | "$(COMPILE.cxx) /obj=$@ $<",
|
---|
162 | ".for.obj",
|
---|
163 | "$(COMPILE.for) /obj=$@ $<",
|
---|
164 | ".pas.obj",
|
---|
165 | "$(COMPILE.pas) /obj=$@ $<",
|
---|
166 |
|
---|
167 | ".y.c",
|
---|
168 | "$(YACC.y) $< \n rename y_tab.c $@",
|
---|
169 | ".l.c",
|
---|
170 | "$(LEX.l) $< \n rename lexyy.c $@",
|
---|
171 |
|
---|
172 | ".texinfo.info",
|
---|
173 | "$(MAKEINFO) $<",
|
---|
174 |
|
---|
175 | ".tex.dvi",
|
---|
176 | "$(TEX) $<",
|
---|
177 |
|
---|
178 | #else /* ! VMS */
|
---|
179 |
|
---|
180 | ".o",
|
---|
181 | "$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
---|
182 | ".s",
|
---|
183 | "$(LINK.s) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
---|
184 | ".S",
|
---|
185 | "$(LINK.S) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
---|
186 | ".c",
|
---|
187 | "$(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
---|
188 | ".cc",
|
---|
189 | "$(LINK.cc) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
---|
190 | ".C",
|
---|
191 | "$(LINK.C) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
---|
192 | ".cpp",
|
---|
193 | "$(LINK.cpp) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
---|
194 | ".f",
|
---|
195 | "$(LINK.f) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
---|
196 | ".p",
|
---|
197 | "$(LINK.p) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
---|
198 | ".F",
|
---|
199 | "$(LINK.F) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
---|
200 | ".r",
|
---|
201 | "$(LINK.r) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
---|
202 | ".mod",
|
---|
203 | "$(COMPILE.mod) -o $@ -e $@ $^",
|
---|
204 |
|
---|
205 | ".def.sym",
|
---|
206 | "$(COMPILE.def) -o $@ $<",
|
---|
207 |
|
---|
208 | ".sh",
|
---|
209 | "cat $< >$@ \n chmod a+x $@",
|
---|
210 |
|
---|
211 | ".s.o",
|
---|
212 | "$(COMPILE.s) -o $@ $<",
|
---|
213 | ".S.o",
|
---|
214 | "$(COMPILE.S) -o $@ $<",
|
---|
215 | ".c.o",
|
---|
216 | "$(COMPILE.c) $(OUTPUT_OPTION) $<",
|
---|
217 | ".cc.o",
|
---|
218 | "$(COMPILE.cc) $(OUTPUT_OPTION) $<",
|
---|
219 | ".C.o",
|
---|
220 | "$(COMPILE.C) $(OUTPUT_OPTION) $<",
|
---|
221 | ".cpp.o",
|
---|
222 | "$(COMPILE.cpp) $(OUTPUT_OPTION) $<",
|
---|
223 | ".f.o",
|
---|
224 | "$(COMPILE.f) $(OUTPUT_OPTION) $<",
|
---|
225 | ".p.o",
|
---|
226 | "$(COMPILE.p) $(OUTPUT_OPTION) $<",
|
---|
227 | ".F.o",
|
---|
228 | "$(COMPILE.F) $(OUTPUT_OPTION) $<",
|
---|
229 | ".r.o",
|
---|
230 | "$(COMPILE.r) $(OUTPUT_OPTION) $<",
|
---|
231 | ".mod.o",
|
---|
232 | "$(COMPILE.mod) -o $@ $<",
|
---|
233 |
|
---|
234 | ".c.ln",
|
---|
235 | "$(LINT.c) -C$* $<",
|
---|
236 | ".y.ln",
|
---|
237 | #ifndef __MSDOS__
|
---|
238 | "$(YACC.y) $< \n $(LINT.c) -C$* y.tab.c \n $(RM) y.tab.c",
|
---|
239 | #else
|
---|
240 | "$(YACC.y) $< \n $(LINT.c) -C$* y_tab.c \n $(RM) y_tab.c",
|
---|
241 | #endif
|
---|
242 | ".l.ln",
|
---|
243 | "@$(RM) $*.c\n $(LEX.l) $< > $*.c\n$(LINT.c) -i $*.c -o $@\n $(RM) $*.c",
|
---|
244 |
|
---|
245 | ".y.c",
|
---|
246 | #ifndef __MSDOS__
|
---|
247 | "$(YACC.y) $< \n mv -f y.tab.c $@",
|
---|
248 | #else
|
---|
249 | "$(YACC.y) $< \n mv -f y_tab.c $@",
|
---|
250 | #endif
|
---|
251 | ".l.c",
|
---|
252 | "@$(RM) $@ \n $(LEX.l) $< > $@",
|
---|
253 |
|
---|
254 | ".F.f",
|
---|
255 | "$(PREPROCESS.F) $(OUTPUT_OPTION) $<",
|
---|
256 | ".r.f",
|
---|
257 | "$(PREPROCESS.r) $(OUTPUT_OPTION) $<",
|
---|
258 |
|
---|
259 | /* This might actually make lex.yy.c if there's no %R%
|
---|
260 | directive in $*.l, but in that case why were you
|
---|
261 | trying to make $*.r anyway? */
|
---|
262 | ".l.r",
|
---|
263 | "$(LEX.l) $< > $@ \n mv -f lex.yy.r $@",
|
---|
264 |
|
---|
265 | ".S.s",
|
---|
266 | "$(PREPROCESS.S) $< > $@",
|
---|
267 |
|
---|
268 | ".texinfo.info",
|
---|
269 | "$(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@",
|
---|
270 |
|
---|
271 | ".texi.info",
|
---|
272 | "$(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@",
|
---|
273 |
|
---|
274 | ".txinfo.info",
|
---|
275 | "$(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@",
|
---|
276 |
|
---|
277 | ".tex.dvi",
|
---|
278 | "$(TEX) $<",
|
---|
279 |
|
---|
280 | ".texinfo.dvi",
|
---|
281 | "$(TEXI2DVI) $(TEXI2DVI_FLAGS) $<",
|
---|
282 |
|
---|
283 | ".texi.dvi",
|
---|
284 | "$(TEXI2DVI) $(TEXI2DVI_FLAGS) $<",
|
---|
285 |
|
---|
286 | ".txinfo.dvi",
|
---|
287 | "$(TEXI2DVI) $(TEXI2DVI_FLAGS) $<",
|
---|
288 |
|
---|
289 | ".w.c",
|
---|
290 | "$(CTANGLE) $< - $@", /* The `-' says there is no `.ch' file. */
|
---|
291 |
|
---|
292 | ".web.p",
|
---|
293 | "$(TANGLE) $<",
|
---|
294 |
|
---|
295 | ".w.tex",
|
---|
296 | "$(CWEAVE) $< - $@", /* The `-' says there is no `.ch' file. */
|
---|
297 |
|
---|
298 | ".web.tex",
|
---|
299 | "$(WEAVE) $<",
|
---|
300 |
|
---|
301 | #endif /* !VMS */
|
---|
302 |
|
---|
303 | 0, 0,
|
---|
304 | };
|
---|
305 |
|
---|
306 | static char *default_variables[] =
|
---|
307 | {
|
---|
308 | #ifdef VMS
|
---|
309 | #ifdef __ALPHA
|
---|
310 | "ARCH", "ALPHA",
|
---|
311 | #endif
|
---|
312 | #ifdef __ia64
|
---|
313 | "ARCH", "IA64",
|
---|
314 | #endif
|
---|
315 | #ifdef __VAX
|
---|
316 | "ARCH", "VAX",
|
---|
317 | #endif
|
---|
318 | "AR", "library/obj",
|
---|
319 | "ARFLAGS", "/replace",
|
---|
320 | "AS", "macro",
|
---|
321 | "MACRO", "macro",
|
---|
322 | #ifdef GCC_IS_NATIVE
|
---|
323 | "CC", "gcc",
|
---|
324 | #else
|
---|
325 | "CC", "cc",
|
---|
326 | #endif
|
---|
327 | "CD", "builtin_cd",
|
---|
328 | "MAKE", "make",
|
---|
329 | "ECHO", "write sys$$output \"",
|
---|
330 | #ifdef GCC_IS_NATIVE
|
---|
331 | "C++", "gcc/plus",
|
---|
332 | "CXX", "gcc/plus",
|
---|
333 | #else
|
---|
334 | "C++", "cxx",
|
---|
335 | "CXX", "cxx",
|
---|
336 | "CXXLD", "cxxlink",
|
---|
337 | #endif
|
---|
338 | "CO", "co",
|
---|
339 | "CPP", "$(CC) /preprocess_only",
|
---|
340 | "FC", "fortran",
|
---|
341 | /* System V uses these, so explicit rules using them should work.
|
---|
342 | However, there is no way to make implicit rules use them and FC. */
|
---|
343 | "F77", "$(FC)",
|
---|
344 | "F77FLAGS", "$(FFLAGS)",
|
---|
345 | "LD", "link",
|
---|
346 | "LEX", "lex",
|
---|
347 | "PC", "pascal",
|
---|
348 | "YACC", "bison/yacc",
|
---|
349 | "YFLAGS", "/Define/Verbose",
|
---|
350 | "BISON", "bison",
|
---|
351 | "MAKEINFO", "makeinfo",
|
---|
352 | "TEX", "tex",
|
---|
353 | "TEXINDEX", "texindex",
|
---|
354 |
|
---|
355 | "RM", "delete/nolog",
|
---|
356 |
|
---|
357 | "CSTARTUP", "",
|
---|
358 | #ifdef GCC_IS_NATIVE
|
---|
359 | "CRT0", ",sys$$library:vaxcrtl.olb/lib,gnu_cc_library:crt0.obj",
|
---|
360 | "CXXSTARTUP", "gnu_cc_library:crtbegin.obj",
|
---|
361 | "CXXRT0", ",sys$$library:vaxcrtl.olb/lib,gnu_cc_library:crtend.obj,gnu_cc_library:gxx_main.obj",
|
---|
362 | "LXLIBS", ",gnu_cc_library:libstdcxx.olb/lib,gnu_cc_library:libgccplus.olb/lib",
|
---|
363 | "LDLIBS", ",gnu_cc_library:libgcc.olb/lib",
|
---|
364 | #else
|
---|
365 | "CRT0", "",
|
---|
366 | "CXXSTARTUP", "",
|
---|
367 | "CXXRT0", "",
|
---|
368 | "LXLIBS", "",
|
---|
369 | "LDLIBS", "",
|
---|
370 | #endif
|
---|
371 |
|
---|
372 | "LINK.obj", "$(LD) $(LDFLAGS)",
|
---|
373 | #ifndef GCC_IS_NATIVE
|
---|
374 | "CXXLINK.obj", "$(CXXLD) $(LDFLAGS)",
|
---|
375 | "COMPILE.cxx", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
|
---|
376 | #endif
|
---|
377 | "COMPILE.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
|
---|
378 | "COMPILE.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
|
---|
379 | "YACC.y", "$(YACC) $(YFLAGS)",
|
---|
380 | "LEX.l", "$(LEX) $(LFLAGS)",
|
---|
381 | "COMPILE.for", "$(FC) $(FFLAGS) $(TARGET_ARCH)",
|
---|
382 | "COMPILE.pas", "$(PC) $(PFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
|
---|
383 | "COMPILE.mar", "$(MACRO) $(MACROFLAGS)",
|
---|
384 | "COMPILE.s", "$(AS) $(ASFLAGS) $(TARGET_MACH)",
|
---|
385 | "LINT.c", "$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
|
---|
386 |
|
---|
387 | "MV", "rename/new_version",
|
---|
388 | "CP", "copy",
|
---|
389 |
|
---|
390 | #else /* !VMS */
|
---|
391 |
|
---|
392 | "AR", "ar",
|
---|
393 | "ARFLAGS", "rv",
|
---|
394 | "AS", "as",
|
---|
395 | #ifdef GCC_IS_NATIVE
|
---|
396 | "CC", "gcc",
|
---|
397 | # ifdef __MSDOS__
|
---|
398 | "CXX", "gpp", /* g++ is an invalid name on MSDOS */
|
---|
399 | # else
|
---|
400 | "CXX", "gcc",
|
---|
401 | # endif /* __MSDOS__ */
|
---|
402 | #else
|
---|
403 | "CC", "cc",
|
---|
404 | "CXX", "g++",
|
---|
405 | #endif
|
---|
406 |
|
---|
407 | /* This expands to $(CO) $(COFLAGS) $< $@ if $@ does not exist,
|
---|
408 | and to the empty string if $@ does exist. */
|
---|
409 | "CHECKOUT,v", "+$(if $(wildcard $@),,$(CO) $(COFLAGS) $< $@)",
|
---|
410 | "CO", "co",
|
---|
411 | "COFLAGS", "",
|
---|
412 |
|
---|
413 | "CPP", "$(CC) -E",
|
---|
414 | #ifdef CRAY
|
---|
415 | "CF77PPFLAGS", "-P",
|
---|
416 | "CF77PP", "/lib/cpp",
|
---|
417 | "CFT", "cft77",
|
---|
418 | "CF", "cf77",
|
---|
419 | "FC", "$(CF)",
|
---|
420 | #else /* Not CRAY. */
|
---|
421 | #ifdef _IBMR2
|
---|
422 | "FC", "xlf",
|
---|
423 | #else
|
---|
424 | #ifdef __convex__
|
---|
425 | "FC", "fc",
|
---|
426 | #else
|
---|
427 | "FC", "f77",
|
---|
428 | #endif /* __convex__ */
|
---|
429 | #endif /* _IBMR2 */
|
---|
430 | /* System V uses these, so explicit rules using them should work.
|
---|
431 | However, there is no way to make implicit rules use them and FC. */
|
---|
432 | "F77", "$(FC)",
|
---|
433 | "F77FLAGS", "$(FFLAGS)",
|
---|
434 | #endif /* Cray. */
|
---|
435 | "GET", SCCS_GET,
|
---|
436 | "LD", "ld",
|
---|
437 | #ifdef GCC_IS_NATIVE
|
---|
438 | "LEX", "flex",
|
---|
439 | #else
|
---|
440 | "LEX", "lex",
|
---|
441 | #endif
|
---|
442 | "LINT", "lint",
|
---|
443 | "M2C", "m2c",
|
---|
444 | #ifdef pyr
|
---|
445 | "PC", "pascal",
|
---|
446 | #else
|
---|
447 | #ifdef CRAY
|
---|
448 | "PC", "PASCAL",
|
---|
449 | "SEGLDR", "segldr",
|
---|
450 | #else
|
---|
451 | "PC", "pc",
|
---|
452 | #endif /* CRAY. */
|
---|
453 | #endif /* pyr. */
|
---|
454 | #ifdef GCC_IS_NATIVE
|
---|
455 | "YACC", "bison -y",
|
---|
456 | #else
|
---|
457 | "YACC", "yacc", /* Or "bison -y" */
|
---|
458 | #endif
|
---|
459 | "MAKEINFO", "makeinfo",
|
---|
460 | "TEX", "tex",
|
---|
461 | "TEXI2DVI", "texi2dvi",
|
---|
462 | "WEAVE", "weave",
|
---|
463 | "CWEAVE", "cweave",
|
---|
464 | "TANGLE", "tangle",
|
---|
465 | "CTANGLE", "ctangle",
|
---|
466 |
|
---|
467 | "RM", "rm -f",
|
---|
468 |
|
---|
469 | "LINK.o", "$(CC) $(LDFLAGS) $(TARGET_ARCH)",
|
---|
470 | "COMPILE.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
|
---|
471 | "LINK.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
|
---|
472 | "COMPILE.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
|
---|
473 | "COMPILE.C", "$(COMPILE.cc)",
|
---|
474 | "COMPILE.cpp", "$(COMPILE.cc)",
|
---|
475 | "LINK.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
|
---|
476 | "LINK.C", "$(LINK.cc)",
|
---|
477 | "LINK.cpp", "$(LINK.cc)",
|
---|
478 | "YACC.y", "$(YACC) $(YFLAGS)",
|
---|
479 | "LEX.l", "$(LEX) $(LFLAGS) -t",
|
---|
480 | "COMPILE.f", "$(FC) $(FFLAGS) $(TARGET_ARCH) -c",
|
---|
481 | "LINK.f", "$(FC) $(FFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
|
---|
482 | "COMPILE.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
|
---|
483 | "LINK.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
|
---|
484 | "COMPILE.r", "$(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -c",
|
---|
485 | "LINK.r", "$(FC) $(FFLAGS) $(RFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
|
---|
486 | "COMPILE.def", "$(M2C) $(M2FLAGS) $(DEFFLAGS) $(TARGET_ARCH)",
|
---|
487 | "COMPILE.mod", "$(M2C) $(M2FLAGS) $(MODFLAGS) $(TARGET_ARCH)",
|
---|
488 | "COMPILE.p", "$(PC) $(PFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
|
---|
489 | "LINK.p", "$(PC) $(PFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
|
---|
490 | "LINK.s", "$(CC) $(ASFLAGS) $(LDFLAGS) $(TARGET_MACH)",
|
---|
491 | "COMPILE.s", "$(AS) $(ASFLAGS) $(TARGET_MACH)",
|
---|
492 | "LINK.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_MACH)",
|
---|
493 | "COMPILE.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(TARGET_MACH) -c",
|
---|
494 | "PREPROCESS.S", "$(CC) -E $(CPPFLAGS)",
|
---|
495 | "PREPROCESS.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -F",
|
---|
496 | "PREPROCESS.r", "$(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -F",
|
---|
497 | "LINT.c", "$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
|
---|
498 |
|
---|
499 | #ifndef NO_MINUS_C_MINUS_O
|
---|
500 | "OUTPUT_OPTION", "-o $@",
|
---|
501 | #endif
|
---|
502 |
|
---|
503 | #ifdef SCCS_GET_MINUS_G
|
---|
504 | "SCCS_OUTPUT_OPTION", "-G$@",
|
---|
505 | #endif
|
---|
506 |
|
---|
507 | #ifdef _AMIGA
|
---|
508 | ".LIBPATTERNS", "%.lib",
|
---|
509 | #else
|
---|
510 | #ifdef __MSDOS__
|
---|
511 | ".LIBPATTERNS", "lib%.a $(DJDIR)/lib/lib%.a",
|
---|
512 | #else
|
---|
513 | ".LIBPATTERNS", "lib%.so lib%.a",
|
---|
514 | #endif
|
---|
515 | #endif
|
---|
516 |
|
---|
517 | #endif /* !VMS */
|
---|
518 | 0, 0
|
---|
519 | };
|
---|
520 | |
---|
521 |
|
---|
522 | /* Set up the default .SUFFIXES list. */
|
---|
523 |
|
---|
524 | void
|
---|
525 | set_default_suffixes (void)
|
---|
526 | {
|
---|
527 | suffix_file = enter_file (".SUFFIXES");
|
---|
528 |
|
---|
529 | if (no_builtin_rules_flag)
|
---|
530 | (void) define_variable ("SUFFIXES", 8, "", o_default, 0);
|
---|
531 | else
|
---|
532 | {
|
---|
533 | char *p = default_suffixes;
|
---|
534 | suffix_file->deps = (struct dep *)
|
---|
535 | multi_glob (parse_file_seq (&p, '\0', sizeof (struct dep), 1),
|
---|
536 | sizeof (struct dep));
|
---|
537 | (void) define_variable ("SUFFIXES", 8, default_suffixes, o_default, 0);
|
---|
538 | }
|
---|
539 | }
|
---|
540 |
|
---|
541 | /* Enter the default suffix rules as file rules. This used to be done in
|
---|
542 | install_default_implicit_rules, but that loses because we want the
|
---|
543 | suffix rules installed before reading makefiles, and thee pattern rules
|
---|
544 | installed after. */
|
---|
545 |
|
---|
546 | void
|
---|
547 | install_default_suffix_rules (void)
|
---|
548 | {
|
---|
549 | register char **s;
|
---|
550 |
|
---|
551 | if (no_builtin_rules_flag)
|
---|
552 | return;
|
---|
553 |
|
---|
554 | for (s = default_suffix_rules; *s != 0; s += 2)
|
---|
555 | {
|
---|
556 | register struct file *f = enter_file (s[0]);
|
---|
557 | /* Don't clobber cmds given in a makefile if there were any. */
|
---|
558 | if (f->cmds == 0)
|
---|
559 | {
|
---|
560 | f->cmds = (struct commands *) xmalloc (sizeof (struct commands));
|
---|
561 | f->cmds->fileinfo.filenm = 0;
|
---|
562 | f->cmds->commands = s[1];
|
---|
563 | f->cmds->command_lines = 0;
|
---|
564 | }
|
---|
565 | }
|
---|
566 | }
|
---|
567 |
|
---|
568 |
|
---|
569 | /* Install the default pattern rules. */
|
---|
570 |
|
---|
571 | void
|
---|
572 | install_default_implicit_rules (void)
|
---|
573 | {
|
---|
574 | register struct pspec *p;
|
---|
575 |
|
---|
576 | if (no_builtin_rules_flag)
|
---|
577 | return;
|
---|
578 |
|
---|
579 | for (p = default_pattern_rules; p->target != 0; ++p)
|
---|
580 | install_pattern_rule (p, 0);
|
---|
581 |
|
---|
582 | for (p = default_terminal_rules; p->target != 0; ++p)
|
---|
583 | install_pattern_rule (p, 1);
|
---|
584 | }
|
---|
585 |
|
---|
586 | void
|
---|
587 | define_default_variables (void)
|
---|
588 | {
|
---|
589 | register char **s;
|
---|
590 |
|
---|
591 | if (no_builtin_variables_flag)
|
---|
592 | return;
|
---|
593 |
|
---|
594 | for (s = default_variables; *s != 0; s += 2)
|
---|
595 | (void) define_variable (s[0], strlen (s[0]), s[1], o_default, 1);
|
---|
596 | }
|
---|