Implement new "if... else if... endif" semantics.
[make.git] / default.c
blob58855c680b0c4cd69ddb92c621397ce1303e0e90
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.
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.
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.
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. */
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"
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
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. */
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
54 static struct pspec default_pattern_rules[] =
56 { "(%)", "%",
57 "$(AR) $(ARFLAGS) $@ $<" },
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) $^ $@" },
75 { 0, 0, 0 }
78 static struct pspec default_terminal_rules[] =
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)" },
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)" },
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 }
111 static char *default_suffix_rules[] =
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=$@",
135 ".com",
136 "copy $< >$@",
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=$@ $<",
167 ".y.c",
168 "$(YACC.y) $< \n rename y_tab.c $@",
169 ".l.c",
170 "$(LEX.l) $< \n rename lexyy.c $@",
172 ".texinfo.info",
173 "$(MAKEINFO) $<",
175 ".tex.dvi",
176 "$(TEX) $<",
178 #else /* ! VMS */
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 $@ $^",
205 ".def.sym",
206 "$(COMPILE.def) -o $@ $<",
208 ".sh",
209 "cat $< >$@ \n chmod a+x $@",
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 $@ $<",
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",
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) $< > $@",
254 ".F.f",
255 "$(PREPROCESS.F) $(OUTPUT_OPTION) $<",
256 ".r.f",
257 "$(PREPROCESS.r) $(OUTPUT_OPTION) $<",
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 $@",
265 ".S.s",
266 "$(PREPROCESS.S) $< > $@",
268 ".texinfo.info",
269 "$(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@",
271 ".texi.info",
272 "$(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@",
274 ".txinfo.info",
275 "$(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@",
277 ".tex.dvi",
278 "$(TEX) $<",
280 ".texinfo.dvi",
281 "$(TEXI2DVI) $(TEXI2DVI_FLAGS) $<",
283 ".texi.dvi",
284 "$(TEXI2DVI) $(TEXI2DVI_FLAGS) $<",
286 ".txinfo.dvi",
287 "$(TEXI2DVI) $(TEXI2DVI_FLAGS) $<",
289 ".w.c",
290 "$(CTANGLE) $< - $@", /* The `-' says there is no `.ch' file. */
292 ".web.p",
293 "$(TANGLE) $<",
295 ".w.tex",
296 "$(CWEAVE) $< - $@", /* The `-' says there is no `.ch' file. */
298 ".web.tex",
299 "$(WEAVE) $<",
301 #endif /* !VMS */
303 0, 0,
306 static char *default_variables[] =
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",
355 "RM", "delete/nolog",
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
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)",
387 "MV", "rename/new_version",
388 "CP", "copy",
390 #else /* !VMS */
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
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", "",
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",
467 "RM", "rm -f",
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)",
499 #ifndef NO_MINUS_C_MINUS_O
500 "OUTPUT_OPTION", "-o $@",
501 #endif
503 #ifdef SCCS_GET_MINUS_G
504 "SCCS_OUTPUT_OPTION", "-G$@",
505 #endif
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
517 #endif /* !VMS */
518 0, 0
521 /* Set up the default .SUFFIXES list. */
523 void
524 set_default_suffixes (void)
526 suffix_file = enter_file (".SUFFIXES");
528 if (no_builtin_rules_flag)
529 (void) define_variable ("SUFFIXES", 8, "", o_default, 0);
530 else
532 char *p = default_suffixes;
533 suffix_file->deps = (struct dep *)
534 multi_glob (parse_file_seq (&p, '\0', sizeof (struct dep), 1),
535 sizeof (struct dep));
536 (void) define_variable ("SUFFIXES", 8, default_suffixes, o_default, 0);
540 /* Enter the default suffix rules as file rules. This used to be done in
541 install_default_implicit_rules, but that loses because we want the
542 suffix rules installed before reading makefiles, and thee pattern rules
543 installed after. */
545 void
546 install_default_suffix_rules (void)
548 register char **s;
550 if (no_builtin_rules_flag)
551 return;
553 for (s = default_suffix_rules; *s != 0; s += 2)
555 register struct file *f = enter_file (s[0]);
556 /* Don't clobber cmds given in a makefile if there were any. */
557 if (f->cmds == 0)
559 f->cmds = (struct commands *) xmalloc (sizeof (struct commands));
560 f->cmds->fileinfo.filenm = 0;
561 f->cmds->commands = s[1];
562 f->cmds->command_lines = 0;
568 /* Install the default pattern rules. */
570 void
571 install_default_implicit_rules (void)
573 register struct pspec *p;
575 if (no_builtin_rules_flag)
576 return;
578 for (p = default_pattern_rules; p->target != 0; ++p)
579 install_pattern_rule (p, 0);
581 for (p = default_terminal_rules; p->target != 0; ++p)
582 install_pattern_rule (p, 1);
585 void
586 define_default_variables (void)
588 register char **s;
590 if (no_builtin_variables_flag)
591 return;
593 for (s = default_variables; *s != 0; s += 2)
594 (void) define_variable (s[0], strlen (s[0]), s[1], o_default, 1);