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