VirtualBox

source: kBuild/vendor/gnumake/3.82-cvs/default.c

Last change on this file was 2580, checked in by bird, 12 years ago

Importing the make-3-82 CVS tag with --auto-props but no keywords.

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