VirtualBox

source: kBuild/vendor/gnumake/2003-11-23/default.c@ 1989

Last change on this file since 1989 was 54, checked in by (none), 21 years ago

This commit was manufactured by cvs2svn to create branch 'GNU'.

  • Property svn:eol-style set to native
File size: 15.6 KB
Line 
1/* Data base of default implicit rules for GNU Make.
2Copyright (C) 1988,89,90,91,92,93,94,95,96 Free Software Foundation, Inc.
3This file is part of GNU Make.
4
5GNU Make is free software; you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation; either version 2, or (at your option)
8any later version.
9
10GNU Make is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with GNU Make; see the file COPYING. If not, write to
17the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18Boston, 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
39static 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
54static 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
78static 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
111static 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
306static char *default_variables[] =
307 {
308#ifdef VMS
309#ifdef __ALPHA
310 "ARCH", "ALPHA",
311#else
312 "ARCH", "VAX",
313#endif
314 "AR", "library/obj",
315 "ARFLAGS", "/replace",
316 "AS", "macro",
317 "MACRO", "macro",
318#ifdef GCC_IS_NATIVE
319 "CC", "gcc",
320#else
321 "CC", "cc",
322#endif
323 "CD", "builtin_cd",
324 "MAKE", "make",
325 "ECHO", "write sys$$output \"",
326#ifdef GCC_IS_NATIVE
327 "C++", "gcc/plus",
328 "CXX", "gcc/plus",
329#else
330 "C++", "cxx",
331 "CXX", "cxx",
332 "CXXLD", "cxxlink",
333#endif
334 "CO", "co",
335 "CPP", "$(CC) /preprocess_only",
336 "FC", "fortran",
337 /* System V uses these, so explicit rules using them should work.
338 However, there is no way to make implicit rules use them and FC. */
339 "F77", "$(FC)",
340 "F77FLAGS", "$(FFLAGS)",
341 "LD", "link",
342 "LEX", "lex",
343 "PC", "pascal",
344 "YACC", "bison/yacc",
345 "YFLAGS", "/Define/Verbose",
346 "BISON", "bison",
347 "MAKEINFO", "makeinfo",
348 "TEX", "tex",
349 "TEXINDEX", "texindex",
350
351 "RM", "delete/nolog",
352
353 "CSTARTUP", "",
354#ifdef GCC_IS_NATIVE
355 "CRT0", ",sys$$library:vaxcrtl.olb/lib,gnu_cc_library:crt0.obj",
356 "CXXSTARTUP", "gnu_cc_library:crtbegin.obj",
357 "CXXRT0", ",sys$$library:vaxcrtl.olb/lib,gnu_cc_library:crtend.obj,gnu_cc_library:gxx_main.obj",
358 "LXLIBS", ",gnu_cc_library:libstdcxx.olb/lib,gnu_cc_library:libgccplus.olb/lib",
359 "LDLIBS", ",gnu_cc_library:libgcc.olb/lib",
360#else
361 "CRT0", "",
362 "CXXSTARTUP", "",
363 "CXXRT0", "",
364 "LXLIBS", "",
365 "LDLIBS", "",
366#endif
367
368 "LINK.obj", "$(LD) $(LDFLAGS)",
369#ifndef GCC_IS_NATIVE
370 "CXXLINK.obj", "$(CXXLD) $(LDFLAGS)",
371 "COMPILE.cxx", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
372#endif
373 "COMPILE.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
374 "COMPILE.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
375 "YACC.y", "$(YACC) $(YFLAGS)",
376 "LEX.l", "$(LEX) $(LFLAGS)",
377 "COMPILE.for", "$(FC) $(FFLAGS) $(TARGET_ARCH)",
378 "COMPILE.pas", "$(PC) $(PFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
379 "COMPILE.mar", "$(MACRO) $(MACROFLAGS)",
380 "COMPILE.s", "$(AS) $(ASFLAGS) $(TARGET_MACH)",
381 "LINT.c", "$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
382
383 "MV", "rename/new_version",
384 "CP", "copy",
385
386#else /* !VMS */
387
388 "AR", "ar",
389 "ARFLAGS", "rv",
390 "AS", "as",
391#ifdef GCC_IS_NATIVE
392 "CC", "gcc",
393# ifdef __MSDOS__
394 "CXX", "gpp", /* g++ is an invalid name on MSDOS */
395# else
396 "CXX", "gcc",
397# endif /* __MSDOS__ */
398#else
399 "CC", "cc",
400 "CXX", "g++",
401#endif
402
403 /* This expands to $(CO) $(COFLAGS) $< $@ if $@ does not exist,
404 and to the empty string if $@ does exist. */
405 "CHECKOUT,v", "+$(if $(wildcard $@),,$(CO) $(COFLAGS) $< $@)",
406 "CO", "co",
407 "COFLAGS", "",
408
409 "CPP", "$(CC) -E",
410#ifdef CRAY
411 "CF77PPFLAGS", "-P",
412 "CF77PP", "/lib/cpp",
413 "CFT", "cft77",
414 "CF", "cf77",
415 "FC", "$(CF)",
416#else /* Not CRAY. */
417#ifdef _IBMR2
418 "FC", "xlf",
419#else
420#ifdef __convex__
421 "FC", "fc",
422#else
423 "FC", "f77",
424#endif /* __convex__ */
425#endif /* _IBMR2 */
426 /* System V uses these, so explicit rules using them should work.
427 However, there is no way to make implicit rules use them and FC. */
428 "F77", "$(FC)",
429 "F77FLAGS", "$(FFLAGS)",
430#endif /* Cray. */
431 "GET", SCCS_GET,
432 "LD", "ld",
433#ifdef GCC_IS_NATIVE
434 "LEX", "flex",
435#else
436 "LEX", "lex",
437#endif
438 "LINT", "lint",
439 "M2C", "m2c",
440#ifdef pyr
441 "PC", "pascal",
442#else
443#ifdef CRAY
444 "PC", "PASCAL",
445 "SEGLDR", "segldr",
446#else
447 "PC", "pc",
448#endif /* CRAY. */
449#endif /* pyr. */
450#ifdef GCC_IS_NATIVE
451 "YACC", "bison -y",
452#else
453 "YACC", "yacc", /* Or "bison -y" */
454#endif
455 "MAKEINFO", "makeinfo",
456 "TEX", "tex",
457 "TEXI2DVI", "texi2dvi",
458 "WEAVE", "weave",
459 "CWEAVE", "cweave",
460 "TANGLE", "tangle",
461 "CTANGLE", "ctangle",
462
463 "RM", "rm -f",
464
465 "LINK.o", "$(CC) $(LDFLAGS) $(TARGET_ARCH)",
466 "COMPILE.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
467 "LINK.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
468 "COMPILE.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
469 "COMPILE.C", "$(COMPILE.cc)",
470 "COMPILE.cpp", "$(COMPILE.cc)",
471 "LINK.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
472 "LINK.C", "$(LINK.cc)",
473 "LINK.cpp", "$(LINK.cc)",
474 "YACC.y", "$(YACC) $(YFLAGS)",
475 "LEX.l", "$(LEX) $(LFLAGS) -t",
476 "COMPILE.f", "$(FC) $(FFLAGS) $(TARGET_ARCH) -c",
477 "LINK.f", "$(FC) $(FFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
478 "COMPILE.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
479 "LINK.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
480 "COMPILE.r", "$(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -c",
481 "LINK.r", "$(FC) $(FFLAGS) $(RFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
482 "COMPILE.def", "$(M2C) $(M2FLAGS) $(DEFFLAGS) $(TARGET_ARCH)",
483 "COMPILE.mod", "$(M2C) $(M2FLAGS) $(MODFLAGS) $(TARGET_ARCH)",
484 "COMPILE.p", "$(PC) $(PFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
485 "LINK.p", "$(PC) $(PFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
486 "LINK.s", "$(CC) $(ASFLAGS) $(LDFLAGS) $(TARGET_MACH)",
487 "COMPILE.s", "$(AS) $(ASFLAGS) $(TARGET_MACH)",
488 "LINK.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_MACH)",
489 "COMPILE.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(TARGET_MACH) -c",
490 "PREPROCESS.S", "$(CC) -E $(CPPFLAGS)",
491 "PREPROCESS.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -F",
492 "PREPROCESS.r", "$(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -F",
493 "LINT.c", "$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
494
495#ifndef NO_MINUS_C_MINUS_O
496 "OUTPUT_OPTION", "-o $@",
497#endif
498
499#ifdef SCCS_GET_MINUS_G
500 "SCCS_OUTPUT_OPTION", "-G$@",
501#endif
502
503#ifdef _AMIGA
504 ".LIBPATTERNS", "%.lib",
505#else
506#ifdef __MSDOS__
507 ".LIBPATTERNS", "lib%.a $(DJDIR)/lib/lib%.a",
508#else
509 ".LIBPATTERNS", "lib%.so lib%.a",
510#endif
511#endif
512
513#endif /* !VMS */
514 0, 0
515 };
516
517
518/* Set up the default .SUFFIXES list. */
519
520void
521set_default_suffixes (void)
522{
523 suffix_file = enter_file (".SUFFIXES");
524
525 if (no_builtin_rules_flag)
526 (void) define_variable ("SUFFIXES", 8, "", o_default, 0);
527 else
528 {
529 char *p = default_suffixes;
530 suffix_file->deps = (struct dep *)
531 multi_glob (parse_file_seq (&p, '\0', sizeof (struct dep), 1),
532 sizeof (struct dep));
533 (void) define_variable ("SUFFIXES", 8, default_suffixes, o_default, 0);
534 }
535}
536
537/* Enter the default suffix rules as file rules. This used to be done in
538 install_default_implicit_rules, but that loses because we want the
539 suffix rules installed before reading makefiles, and thee pattern rules
540 installed after. */
541
542void
543install_default_suffix_rules (void)
544{
545 register char **s;
546
547 if (no_builtin_rules_flag)
548 return;
549
550 for (s = default_suffix_rules; *s != 0; s += 2)
551 {
552 register struct file *f = enter_file (s[0]);
553 /* Don't clobber cmds given in a makefile if there were any. */
554 if (f->cmds == 0)
555 {
556 f->cmds = (struct commands *) xmalloc (sizeof (struct commands));
557 f->cmds->fileinfo.filenm = 0;
558 f->cmds->commands = s[1];
559 f->cmds->command_lines = 0;
560 }
561 }
562}
563
564
565/* Install the default pattern rules. */
566
567void
568install_default_implicit_rules (void)
569{
570 register struct pspec *p;
571
572 if (no_builtin_rules_flag)
573 return;
574
575 for (p = default_pattern_rules; p->target != 0; ++p)
576 install_pattern_rule (p, 0);
577
578 for (p = default_terminal_rules; p->target != 0; ++p)
579 install_pattern_rule (p, 1);
580}
581
582void
583define_default_variables (void)
584{
585 register char **s;
586
587 if (no_builtin_variables_flag)
588 return;
589
590 for (s = default_variables; *s != 0; s += 2)
591 (void) define_variable (s[0], strlen (s[0]), s[1], o_default, 1);
592}
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette