VirtualBox

source: kBuild/trunk/src/gmake/default.c@ 503

Last change on this file since 503 was 503, checked in by bird, 18 years ago

Untested merge with GNU Make v3.81 (vendor/gnumake/2005-05-16 -> vendor/gnumake/current).

  • 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 Free Software
4Foundation, 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 2, or (at your option) any later version.
10
11GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License along with
16GNU Make; see the file COPYING. If not, write to the Free Software
17Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
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#ifndef CONFIG_NO_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#else /* CONFIG_NO_DEFAULT_SUFFIXES */
54 = "";
55#endif /* CONFIG_NO_DEFAULT_SUFFIXES */
56
57static struct pspec default_pattern_rules[] =
58 {
59#ifndef CONFIG_NO_DEFAULT_PATTERN_RULES
60 { "(%)", "%",
61 "$(AR) $(ARFLAGS) $@ $<" },
62
63 /* The X.out rules are only in BSD's default set because
64 BSD Make has no null-suffix rules, so `foo.out' and
65 `foo' are the same thing. */
66#ifdef VMS
67 { "%.exe", "%",
68 "copy $< $@" },
69#else
70 { "%.out", "%",
71 "@rm -f $@ \n cp $< $@" },
72#endif
73 /* Syntax is "ctangle foo.w foo.ch foo.c". */
74 { "%.c", "%.w %.ch",
75 "$(CTANGLE) $^ $@" },
76 { "%.tex", "%.w %.ch",
77 "$(CWEAVE) $^ $@" },
78#endif /* !CONFIG_NO_DEFAULT_PATTERN_RULES */
79 { 0, 0, 0 }
80 };
81
82static struct pspec default_terminal_rules[] =
83 {
84#ifndef CONFIG_NO_DEFAULT_TERMINAL_RULES
85#ifdef VMS
86 /* RCS. */
87 { "%", "%$$5lv", /* Multinet style */
88 "if f$$search($@) .nes. \"\" then +$(CHECKOUT,v)" },
89 { "%", "[.$$rcs]%$$5lv", /* Multinet style */
90 "if f$$search($@) .nes. \"\" then +$(CHECKOUT,v)" },
91 { "%", "%_v", /* Normal style */
92 "if f$$search($@) .nes. \"\" then +$(CHECKOUT,v)" },
93 { "%", "[.rcs]%_v", /* Normal style */
94 "if f$$search($@) .nes. \"\" then +$(CHECKOUT,v)" },
95
96 /* SCCS. */
97 /* ain't no SCCS on vms */
98#else
99 /* RCS. */
100 { "%", "%,v",
101 "$(CHECKOUT,v)" },
102 { "%", "RCS/%,v",
103 "$(CHECKOUT,v)" },
104 { "%", "RCS/%",
105 "$(CHECKOUT,v)" },
106
107 /* SCCS. */
108 { "%", "s.%",
109 "$(GET) $(GFLAGS) $(SCCS_OUTPUT_OPTION) $<" },
110 { "%", "SCCS/s.%",
111 "$(GET) $(GFLAGS) $(SCCS_OUTPUT_OPTION) $<" },
112#endif /* !VMS */
113#endif /* !CONFIG_NO_DEFAULT_TERMINAL_RULES */
114 { 0, 0, 0 }
115 };
116
117static char *default_suffix_rules[] =
118 {
119#ifndef CONFIG_NO_DEFAULT_SUFFIX_RULES
120#ifdef VMS
121 ".obj.exe",
122 "$(LINK.obj) $^ $(LOADLIBES) $(LDLIBS) $(CRT0) /exe=$@",
123 ".mar.exe",
124 "$(COMPILE.mar) $^ \n $(LINK.obj) $(subst .mar,.obj,$^) $(LOADLIBES) $(LDLIBS) $(CRT0) /exe=$@",
125 ".s.exe",
126 "$(COMPILE.s) $^ \n $(LINK.obj) $(subst .s,.obj,$^) $(LOADLIBES) $(LDLIBS) $(CRT0) /exe=$@",
127 ".c.exe",
128 "$(COMPILE.c) $^ \n $(LINK.obj) $(subst .c,.obj,$^) $(LOADLIBES) $(LDLIBS) $(CRT0) /exe=$@",
129 ".cc.exe",
130#ifdef GCC_IS_NATIVE
131 "$(COMPILE.cc) $^ \n $(LINK.obj) $(CXXSTARTUP),sys$$disk:[]$(subst .cc,.obj,$^) $(LOADLIBES) $(LXLIBS) $(LDLIBS) $(CXXRT0) /exe=$@",
132#else
133 "$(COMPILE.cc) $^ \n $(CXXLINK.obj) $(subst .cc,.obj,$^) $(LOADLIBES) $(LXLIBS) $(LDLIBS) $(CXXRT0) /exe=$@",
134 ".cxx.exe",
135 "$(COMPILE.cxx) $^ \n $(CXXLINK.obj) $(subst .cxx,.obj,$^) $(LOADLIBES) $(LXLIBS) $(LDLIBS) $(CXXRT0) /exe=$@",
136#endif
137 ".for.exe",
138 "$(COMPILE.for) $^ \n $(LINK.obj) $(subst .for,.obj,$^) $(LOADLIBES) $(LDLIBS) /exe=$@",
139 ".pas.exe",
140 "$(COMPILE.pas) $^ \n $(LINK.obj) $(subst .pas,.obj,$^) $(LOADLIBES) $(LDLIBS) /exe=$@",
141
142 ".com",
143 "copy $< >$@",
144
145 ".mar.obj",
146 "$(COMPILE.mar) /obj=$@ $<",
147 ".s.obj",
148 "$(COMPILE.s) /obj=$@ $<",
149 ".ss.obj",
150 "$(COMPILE.s) /obj=$@ $<",
151 ".c.i",
152 "$(COMPILE.c)/prep /list=$@ $<",
153 ".c.s",
154 "$(COMPILE.c)/noobj/machine /list=$@ $<",
155 ".i.s",
156 "$(COMPILE.c)/noprep/noobj/machine /list=$@ $<",
157 ".c.obj",
158 "$(COMPILE.c) /obj=$@ $<",
159 ".cc.ii",
160 "$(COMPILE.cc)/prep /list=$@ $<",
161 ".cc.ss",
162 "$(COMPILE.cc)/noobj/machine /list=$@ $<",
163 ".ii.ss",
164 "$(COMPILE.cc)/noprep/noobj/machine /list=$@ $<",
165 ".cc.obj",
166 "$(COMPILE.cc) /obj=$@ $<",
167 ".cxx.obj",
168 "$(COMPILE.cxx) /obj=$@ $<",
169 ".for.obj",
170 "$(COMPILE.for) /obj=$@ $<",
171 ".pas.obj",
172 "$(COMPILE.pas) /obj=$@ $<",
173
174 ".y.c",
175 "$(YACC.y) $< \n rename y_tab.c $@",
176 ".l.c",
177 "$(LEX.l) $< \n rename lexyy.c $@",
178
179 ".texinfo.info",
180 "$(MAKEINFO) $<",
181
182 ".tex.dvi",
183 "$(TEX) $<",
184
185#else /* ! VMS */
186
187 ".o",
188 "$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@",
189 ".s",
190 "$(LINK.s) $^ $(LOADLIBES) $(LDLIBS) -o $@",
191 ".S",
192 "$(LINK.S) $^ $(LOADLIBES) $(LDLIBS) -o $@",
193 ".c",
194 "$(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $@",
195 ".cc",
196 "$(LINK.cc) $^ $(LOADLIBES) $(LDLIBS) -o $@",
197 ".C",
198 "$(LINK.C) $^ $(LOADLIBES) $(LDLIBS) -o $@",
199 ".cpp",
200 "$(LINK.cpp) $^ $(LOADLIBES) $(LDLIBS) -o $@",
201 ".f",
202 "$(LINK.f) $^ $(LOADLIBES) $(LDLIBS) -o $@",
203 ".p",
204 "$(LINK.p) $^ $(LOADLIBES) $(LDLIBS) -o $@",
205 ".F",
206 "$(LINK.F) $^ $(LOADLIBES) $(LDLIBS) -o $@",
207 ".r",
208 "$(LINK.r) $^ $(LOADLIBES) $(LDLIBS) -o $@",
209 ".mod",
210 "$(COMPILE.mod) -o $@ -e $@ $^",
211
212 ".def.sym",
213 "$(COMPILE.def) -o $@ $<",
214
215 ".sh",
216 "cat $< >$@ \n chmod a+x $@",
217
218 ".s.o",
219 "$(COMPILE.s) -o $@ $<",
220 ".S.o",
221 "$(COMPILE.S) -o $@ $<",
222 ".c.o",
223 "$(COMPILE.c) $(OUTPUT_OPTION) $<",
224 ".cc.o",
225 "$(COMPILE.cc) $(OUTPUT_OPTION) $<",
226 ".C.o",
227 "$(COMPILE.C) $(OUTPUT_OPTION) $<",
228 ".cpp.o",
229 "$(COMPILE.cpp) $(OUTPUT_OPTION) $<",
230 ".f.o",
231 "$(COMPILE.f) $(OUTPUT_OPTION) $<",
232 ".p.o",
233 "$(COMPILE.p) $(OUTPUT_OPTION) $<",
234 ".F.o",
235 "$(COMPILE.F) $(OUTPUT_OPTION) $<",
236 ".r.o",
237 "$(COMPILE.r) $(OUTPUT_OPTION) $<",
238 ".mod.o",
239 "$(COMPILE.mod) -o $@ $<",
240
241 ".c.ln",
242 "$(LINT.c) -C$* $<",
243 ".y.ln",
244#ifndef __MSDOS__
245 "$(YACC.y) $< \n $(LINT.c) -C$* y.tab.c \n $(RM) y.tab.c",
246#else
247 "$(YACC.y) $< \n $(LINT.c) -C$* y_tab.c \n $(RM) y_tab.c",
248#endif
249 ".l.ln",
250 "@$(RM) $*.c\n $(LEX.l) $< > $*.c\n$(LINT.c) -i $*.c -o $@\n $(RM) $*.c",
251
252 ".y.c",
253#ifndef __MSDOS__
254 "$(YACC.y) $< \n mv -f y.tab.c $@",
255#else
256 "$(YACC.y) $< \n mv -f y_tab.c $@",
257#endif
258 ".l.c",
259 "@$(RM) $@ \n $(LEX.l) $< > $@",
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%
267 directive in $*.l, but in that case why were you
268 trying to make $*.r anyway? */
269 ".l.r",
270 "$(LEX.l) $< > $@ \n mv -f lex.yy.r $@",
271
272 ".S.s",
273 "$(PREPROCESS.S) $< > $@",
274
275 ".texinfo.info",
276 "$(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@",
277
278 ".texi.info",
279 "$(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@",
280
281 ".txinfo.info",
282 "$(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@",
283
284 ".tex.dvi",
285 "$(TEX) $<",
286
287 ".texinfo.dvi",
288 "$(TEXI2DVI) $(TEXI2DVI_FLAGS) $<",
289
290 ".texi.dvi",
291 "$(TEXI2DVI) $(TEXI2DVI_FLAGS) $<",
292
293 ".txinfo.dvi",
294 "$(TEXI2DVI) $(TEXI2DVI_FLAGS) $<",
295
296 ".w.c",
297 "$(CTANGLE) $< - $@", /* The `-' says there is no `.ch' file. */
298
299 ".web.p",
300 "$(TANGLE) $<",
301
302 ".w.tex",
303 "$(CWEAVE) $< - $@", /* The `-' says there is no `.ch' file. */
304
305 ".web.tex",
306 "$(WEAVE) $<",
307
308#endif /* !VMS */
309#endif /* !CONFIG_NO_DEFAULT_SUFFIX_RULES */
310 0, 0,
311 };
312
313static char *default_variables[] =
314 {
315#ifndef CONFIG_NO_DEFAULT_VARIABLES
316#ifdef VMS
317#ifdef __ALPHA
318 "ARCH", "ALPHA",
319#endif
320#ifdef __ia64
321 "ARCH", "IA64",
322#endif
323#ifdef __VAX
324 "ARCH", "VAX",
325#endif
326 "AR", "library/obj",
327 "ARFLAGS", "/replace",
328 "AS", "macro",
329 "MACRO", "macro",
330#ifdef GCC_IS_NATIVE
331 "CC", "gcc",
332#else
333 "CC", "cc",
334#endif
335 "CD", "builtin_cd",
336 "MAKE", "make",
337 "ECHO", "write sys$$output \"",
338#ifdef GCC_IS_NATIVE
339 "C++", "gcc/plus",
340 "CXX", "gcc/plus",
341#else
342 "C++", "cxx",
343 "CXX", "cxx",
344 "CXXLD", "cxxlink",
345#endif
346 "CO", "co",
347 "CPP", "$(CC) /preprocess_only",
348 "FC", "fortran",
349 /* System V uses these, so explicit rules using them should work.
350 However, there is no way to make implicit rules use them and FC. */
351 "F77", "$(FC)",
352 "F77FLAGS", "$(FFLAGS)",
353 "LD", "link",
354 "LEX", "lex",
355 "PC", "pascal",
356 "YACC", "bison/yacc",
357 "YFLAGS", "/Define/Verbose",
358 "BISON", "bison",
359 "MAKEINFO", "makeinfo",
360 "TEX", "tex",
361 "TEXINDEX", "texindex",
362
363 "RM", "delete/nolog",
364
365 "CSTARTUP", "",
366#ifdef GCC_IS_NATIVE
367 "CRT0", ",sys$$library:vaxcrtl.olb/lib,gnu_cc_library:crt0.obj",
368 "CXXSTARTUP", "gnu_cc_library:crtbegin.obj",
369 "CXXRT0", ",sys$$library:vaxcrtl.olb/lib,gnu_cc_library:crtend.obj,gnu_cc_library:gxx_main.obj",
370 "LXLIBS", ",gnu_cc_library:libstdcxx.olb/lib,gnu_cc_library:libgccplus.olb/lib",
371 "LDLIBS", ",gnu_cc_library:libgcc.olb/lib",
372#else
373 "CRT0", "",
374 "CXXSTARTUP", "",
375 "CXXRT0", "",
376 "LXLIBS", "",
377 "LDLIBS", "",
378#endif
379
380 "LINK.obj", "$(LD) $(LDFLAGS)",
381#ifndef GCC_IS_NATIVE
382 "CXXLINK.obj", "$(CXXLD) $(LDFLAGS)",
383 "COMPILE.cxx", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
384#endif
385 "COMPILE.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
386 "COMPILE.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
387 "YACC.y", "$(YACC) $(YFLAGS)",
388 "LEX.l", "$(LEX) $(LFLAGS)",
389 "COMPILE.for", "$(FC) $(FFLAGS) $(TARGET_ARCH)",
390 "COMPILE.pas", "$(PC) $(PFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
391 "COMPILE.mar", "$(MACRO) $(MACROFLAGS)",
392 "COMPILE.s", "$(AS) $(ASFLAGS) $(TARGET_MACH)",
393 "LINT.c", "$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
394
395 "MV", "rename/new_version",
396 "CP", "copy",
397
398#else /* !VMS */
399
400 "AR", "ar",
401 "ARFLAGS", "rv",
402 "AS", "as",
403#ifdef GCC_IS_NATIVE
404 "CC", "gcc",
405# ifdef __MSDOS__
406 "CXX", "gpp", /* g++ is an invalid name on MSDOS */
407# else
408 "CXX", "gcc",
409# endif /* __MSDOS__ */
410#else
411 "CC", "cc",
412 "CXX", "g++",
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.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 "COMPILE.f", "$(FC) $(FFLAGS) $(TARGET_ARCH) -c",
489 "LINK.f", "$(FC) $(FFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
490 "COMPILE.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
491 "LINK.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
492 "COMPILE.r", "$(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -c",
493 "LINK.r", "$(FC) $(FFLAGS) $(RFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
494 "COMPILE.def", "$(M2C) $(M2FLAGS) $(DEFFLAGS) $(TARGET_ARCH)",
495 "COMPILE.mod", "$(M2C) $(M2FLAGS) $(MODFLAGS) $(TARGET_ARCH)",
496 "COMPILE.p", "$(PC) $(PFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
497 "LINK.p", "$(PC) $(PFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
498 "LINK.s", "$(CC) $(ASFLAGS) $(LDFLAGS) $(TARGET_MACH)",
499 "COMPILE.s", "$(AS) $(ASFLAGS) $(TARGET_MACH)",
500 "LINK.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_MACH)",
501 "COMPILE.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(TARGET_MACH) -c",
502 "PREPROCESS.S", "$(CC) -E $(CPPFLAGS)",
503 "PREPROCESS.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -F",
504 "PREPROCESS.r", "$(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -F",
505 "LINT.c", "$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
506
507#ifndef NO_MINUS_C_MINUS_O
508 "OUTPUT_OPTION", "-o $@",
509#endif
510
511#ifdef SCCS_GET_MINUS_G
512 "SCCS_OUTPUT_OPTION", "-G$@",
513#endif
514
515#ifdef _AMIGA
516 ".LIBPATTERNS", "%.lib",
517#else
518#ifdef __MSDOS__
519 ".LIBPATTERNS", "lib%.a $(DJDIR)/lib/lib%.a",
520#else
521 ".LIBPATTERNS", "lib%.so lib%.a",
522#endif
523#endif
524
525#endif /* !VMS */
526#endif /* !CONFIG_NO_DEFAULT_VARIABLES */
527 0, 0
528 };
529
530
531/* Set up the default .SUFFIXES list. */
532
533void
534set_default_suffixes (void)
535{
536 suffix_file = enter_file (".SUFFIXES");
537
538 if (no_builtin_rules_flag)
539 (void) define_variable ("SUFFIXES", 8, "", o_default, 0);
540 else
541 {
542 char *p = default_suffixes;
543 suffix_file->deps = (struct dep *)
544 multi_glob (parse_file_seq (&p, '\0', sizeof (struct dep), 1),
545 sizeof (struct dep));
546 (void) define_variable ("SUFFIXES", 8, default_suffixes, o_default, 0);
547 }
548}
549
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 thee pattern rules
553 installed after. */
554
555void
556install_default_suffix_rules (void)
557{
558 register char **s;
559
560 if (no_builtin_rules_flag)
561 return;
562
563 for (s = default_suffix_rules; *s != 0; s += 2)
564 {
565 register struct file *f = enter_file (s[0]);
566 /* Don't clobber cmds given in a makefile if there were any. */
567 if (f->cmds == 0)
568 {
569 f->cmds = (struct commands *) xmalloc (sizeof (struct commands));
570 f->cmds->fileinfo.filenm = 0;
571 f->cmds->commands = s[1];
572 f->cmds->command_lines = 0;
573 }
574 }
575}
576
577
578/* Install the default pattern rules. */
579
580void
581install_default_implicit_rules (void)
582{
583 register struct pspec *p;
584
585 if (no_builtin_rules_flag)
586 return;
587
588 for (p = default_pattern_rules; p->target != 0; ++p)
589 install_pattern_rule (p, 0);
590
591 for (p = default_terminal_rules; p->target != 0; ++p)
592 install_pattern_rule (p, 1);
593}
594
595void
596define_default_variables (void)
597{
598 register char **s;
599
600 if (no_builtin_variables_flag)
601 return;
602
603 for (s = default_variables; *s != 0; s += 2)
604 (void) define_variable (s[0], strlen (s[0]), s[1], o_default, 1);
605}
Note: See TracBrowser for help on using the repository browser.

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