VirtualBox

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

Last change on this file since 192 was 192, checked in by bird, 20 years ago

fixing / libc

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