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