compat.c revision 1.82 1 /* $NetBSD: compat.c,v 1.82 2010/11/25 21:31:09 christos Exp $ */
2
3 /*
4 * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to Berkeley by
8 * Adam de Boor.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. Neither the name of the University nor the names of its contributors
19 * may be used to endorse or promote products derived from this software
20 * without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 */
34
35 /*
36 * Copyright (c) 1988, 1989 by Adam de Boor
37 * Copyright (c) 1989 by Berkeley Softworks
38 * All rights reserved.
39 *
40 * This code is derived from software contributed to Berkeley by
41 * Adam de Boor.
42 *
43 * Redistribution and use in source and binary forms, with or without
44 * modification, are permitted provided that the following conditions
45 * are met:
46 * 1. Redistributions of source code must retain the above copyright
47 * notice, this list of conditions and the following disclaimer.
48 * 2. Redistributions in binary form must reproduce the above copyright
49 * notice, this list of conditions and the following disclaimer in the
50 * documentation and/or other materials provided with the distribution.
51 * 3. All advertising materials mentioning features or use of this software
52 * must display the following acknowledgement:
53 * This product includes software developed by the University of
54 * California, Berkeley and its contributors.
55 * 4. Neither the name of the University nor the names of its contributors
56 * may be used to endorse or promote products derived from this software
57 * without specific prior written permission.
58 *
59 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
60 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
61 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
62 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
63 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
64 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
65 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
66 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
67 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
68 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
69 * SUCH DAMAGE.
70 */
71
72 #ifndef MAKE_NATIVE
73 static char rcsid[] = "$NetBSD: compat.c,v 1.82 2010/11/25 21:31:09 christos Exp $";
74 #else
75 #include <sys/cdefs.h>
76 #ifndef lint
77 #if 0
78 static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94";
79 #else
80 __RCSID("$NetBSD: compat.c,v 1.82 2010/11/25 21:31:09 christos Exp $");
81 #endif
82 #endif /* not lint */
83 #endif
84
85 /*-
86 * compat.c --
87 * The routines in this file implement the full-compatibility
88 * mode of PMake. Most of the special functionality of PMake
89 * is available in this mode. Things not supported:
90 * - different shells.
91 * - friendly variable substitution.
92 *
93 * Interface:
94 * Compat_Run Initialize things for this module and recreate
95 * thems as need creatin'
96 */
97
98 #include <sys/types.h>
99 #include <sys/stat.h>
100 #include <sys/wait.h>
101
102 #include <ctype.h>
103 #include <errno.h>
104 #include <signal.h>
105 #include <stdio.h>
106
107 #include "make.h"
108 #include "hash.h"
109 #include "dir.h"
110 #include "job.h"
111 #include "pathnames.h"
112
113 /*
114 * The following array is used to make a fast determination of which
115 * characters are interpreted specially by the shell. If a command
116 * contains any of these characters, it is executed by the shell, not
117 * directly by us.
118 */
119
120 static char meta[256];
121
122 static GNode *curTarg = NULL;
123 static GNode *ENDNode;
124 static void CompatInterrupt(int);
125
126 static void
127 Compat_Init(void)
128 {
129 const char *cp;
130
131 Shell_Init(); /* setup default shell */
132
133 for (cp = "#=|^(){};&<>*?[]:$`\\\n"; *cp != '\0'; cp++) {
134 meta[(unsigned char) *cp] = 1;
135 }
136 /*
137 * The null character serves as a sentinel in the string.
138 */
139 meta[0] = 1;
140 }
141
142 /*-
143 *-----------------------------------------------------------------------
144 * CompatInterrupt --
145 * Interrupt the creation of the current target and remove it if
146 * it ain't precious.
147 *
148 * Results:
149 * None.
150 *
151 * Side Effects:
152 * The target is removed and the process exits. If .INTERRUPT exists,
153 * its commands are run first WITH INTERRUPTS IGNORED..
154 *
155 *-----------------------------------------------------------------------
156 */
157 static void
158 CompatInterrupt(int signo)
159 {
160 GNode *gn;
161
162 if ((curTarg != NULL) && !Targ_Precious (curTarg)) {
163 char *p1;
164 char *file = Var_Value(TARGET, curTarg, &p1);
165
166 if (!noExecute && eunlink(file) != -1) {
167 Error("*** %s removed", file);
168 }
169 if (p1)
170 free(p1);
171
172 /*
173 * Run .INTERRUPT only if hit with interrupt signal
174 */
175 if (signo == SIGINT) {
176 gn = Targ_FindNode(".INTERRUPT", TARG_NOCREATE);
177 if (gn != NULL) {
178 Compat_Make(gn, gn);
179 }
180 }
181
182 }
183 exit(signo);
184 }
185
186 /*-
188 *-----------------------------------------------------------------------
189 * CompatRunCommand --
190 * Execute the next command for a target. If the command returns an
191 * error, the node's made field is set to ERROR and creation stops.
192 *
193 * Input:
194 * cmdp Command to execute
195 * gnp Node from which the command came
196 *
197 * Results:
198 * 0 if the command succeeded, 1 if an error occurred.
199 *
200 * Side Effects:
201 * The node's 'made' field may be set to ERROR.
202 *
203 *-----------------------------------------------------------------------
204 */
205 int
206 CompatRunCommand(void *cmdp, void *gnp)
207 {
208 char *cmdStart; /* Start of expanded command */
209 char *cp, *bp;
210 Boolean silent, /* Don't print command */
211 doIt; /* Execute even if -n */
212 volatile Boolean errCheck; /* Check errors */
213 int reason; /* Reason for child's death */
214 int status; /* Description of child's death */
215 pid_t cpid; /* Child actually found */
216 pid_t retstat; /* Result of wait */
217 LstNode cmdNode; /* Node where current command is located */
218 const char ** volatile av; /* Argument vector for thing to exec */
219 char ** volatile mav;/* Copy of the argument vector for freeing */
220 int argc; /* Number of arguments in av or 0 if not
221 * dynamically allocated */
222 Boolean local; /* TRUE if command should be executed
223 * locally */
224 Boolean useShell; /* TRUE if command should be executed
225 * using a shell */
226 char * volatile cmd = (char *)cmdp;
227 GNode *gn = (GNode *)gnp;
228
229 silent = gn->type & OP_SILENT;
230 errCheck = !(gn->type & OP_IGNORE);
231 doIt = FALSE;
232
233 cmdNode = Lst_Member(gn->commands, cmd);
234 cmdStart = Var_Subst(NULL, cmd, gn, FALSE);
235
236 /*
237 * brk_string will return an argv with a NULL in av[0], thus causing
238 * execvp to choke and die horribly. Besides, how can we execute a null
239 * command? In any case, we warn the user that the command expanded to
240 * nothing (is this the right thing to do?).
241 */
242
243 if (*cmdStart == '\0') {
244 free(cmdStart);
245 Error("%s expands to empty string", cmd);
246 return(0);
247 }
248 cmd = cmdStart;
249 Lst_Replace(cmdNode, cmdStart);
250
251 if ((gn->type & OP_SAVE_CMDS) && (gn != ENDNode)) {
252 (void)Lst_AtEnd(ENDNode->commands, cmdStart);
253 return(0);
254 }
255 if (strcmp(cmdStart, "...") == 0) {
256 gn->type |= OP_SAVE_CMDS;
257 return(0);
258 }
259
260 while ((*cmd == '@') || (*cmd == '-') || (*cmd == '+')) {
261 switch (*cmd) {
262 case '@':
263 silent = DEBUG(LOUD) ? FALSE : TRUE;
264 break;
265 case '-':
266 errCheck = FALSE;
267 break;
268 case '+':
269 doIt = TRUE;
270 if (!meta[0]) /* we came here from jobs */
271 Compat_Init();
272 break;
273 }
274 cmd++;
275 }
276
277 while (isspace((unsigned char)*cmd))
278 cmd++;
279
280 #if !defined(MAKE_NATIVE)
281 /*
282 * In a non-native build, the host environment might be weird enough
283 * that it's necessary to go through a shell to get the correct
284 * behaviour. Or perhaps the shell has been replaced with something
285 * that does extra logging, and that should not be bypassed.
286 */
287 useShell = TRUE;
288 #else
289 /*
290 * Search for meta characters in the command. If there are no meta
291 * characters, there's no need to execute a shell to execute the
292 * command.
293 */
294 for (cp = cmd; !meta[(unsigned char)*cp]; cp++) {
295 continue;
296 }
297 useShell = (*cp != '\0');
298 #endif
299
300 /*
301 * Print the command before echoing if we're not supposed to be quiet for
302 * this one. We also print the command if -n given.
303 */
304 if (!silent || NoExecute(gn)) {
305 printf("%s\n", cmd);
306 fflush(stdout);
307 }
308
309 /*
310 * If we're not supposed to execute any commands, this is as far as
311 * we go...
312 */
313 if (!doIt && NoExecute(gn)) {
314 return (0);
315 }
316 if (DEBUG(JOB))
317 fprintf(debug_file, "Execute: '%s'\n", cmd);
318
319 again:
320 if (useShell) {
321 /*
322 * We need to pass the command off to the shell, typically
323 * because the command contains a "meta" character.
324 */
325 static const char *shargv[4];
326
327 shargv[0] = shellPath;
328 /*
329 * The following work for any of the builtin shell specs.
330 */
331 if (DEBUG(SHELL))
332 shargv[1] = "-xc";
333 else
334 shargv[1] = "-c";
335 shargv[2] = cmd;
336 shargv[3] = NULL;
337 av = shargv;
338 argc = 0;
339 bp = NULL;
340 mav = NULL;
341 } else {
342 /*
343 * No meta-characters, so no need to exec a shell. Break the command
344 * into words to form an argument vector we can execute.
345 */
346 mav = brk_string(cmd, &argc, TRUE, &bp);
347 if (mav == NULL) {
348 useShell = 1;
349 goto again;
350 }
351 av = (const char **)mav;
352 }
353
354 local = TRUE;
355
356 #ifdef USE_META
357 if (useMeta) {
358 meta_compat_start();
359 }
360 #endif
361
362 /*
363 * Fork and execute the single command. If the fork fails, we abort.
364 */
365 cpid = vFork();
366 if (cpid < 0) {
367 Fatal("Could not fork");
368 }
369 if (cpid == 0) {
370 Check_Cwd(av);
371 Var_ExportVars();
372 #ifdef USE_META
373 if (useMeta) {
374 meta_compat_child();
375 }
376 #endif
377 if (local)
378 (void)execvp(av[0], (char *const *)UNCONST(av));
379 else
380 (void)execv(av[0], (char *const *)UNCONST(av));
381 execError("exec", av[0]);
382 _exit(1);
383 }
384 if (mav)
385 free(mav);
386 if (bp)
387 free(bp);
388 Lst_Replace(cmdNode, NULL);
389
390 #ifdef USE_META
391 if (useMeta) {
392 meta_compat_parent();
393 }
394 #endif
395
396 /*
397 * The child is off and running. Now all we can do is wait...
398 */
399 while (1) {
400
401 while ((retstat = wait(&reason)) != cpid) {
402 if (retstat > 0)
403 JobReapChild(retstat, reason, FALSE); /* not ours? */
404 if (retstat == -1 && errno != EINTR) {
405 break;
406 }
407 }
408
409 if (retstat > -1) {
410 if (WIFSTOPPED(reason)) {
411 status = WSTOPSIG(reason); /* stopped */
412 } else if (WIFEXITED(reason)) {
413 status = WEXITSTATUS(reason); /* exited */
414 #if defined(USE_META) && defined(USE_FILEMON_ONCE)
415 if (useMeta) {
416 meta_cmd_finish(NULL);
417 }
418 #endif
419 if (status != 0) {
420 if (DEBUG(ERROR)) {
421 fprintf(debug_file, "\n*** Failed target: %s\n*** Failed command: ",
422 gn->name);
423 for (cp = cmd; *cp; ) {
424 if (isspace((unsigned char)*cp)) {
425 fprintf(debug_file, " ");
426 while (isspace((unsigned char)*cp))
427 cp++;
428 } else {
429 fprintf(debug_file, "%c", *cp);
430 cp++;
431 }
432 }
433 fprintf(debug_file, "\n");
434 }
435 printf("*** Error code %d", status);
436 }
437 } else {
438 status = WTERMSIG(reason); /* signaled */
439 printf("*** Signal %d", status);
440 }
441
442
443 if (!WIFEXITED(reason) || (status != 0)) {
444 if (errCheck) {
445 #ifdef USE_META
446 if (useMeta) {
447 meta_job_error(NULL, gn, 0, status);
448 }
449 #endif
450 gn->made = ERROR;
451 if (keepgoing) {
452 /*
453 * Abort the current target, but let others
454 * continue.
455 */
456 printf(" (continuing)\n");
457 }
458 } else {
459 /*
460 * Continue executing commands for this target.
461 * If we return 0, this will happen...
462 */
463 printf(" (ignored)\n");
464 status = 0;
465 }
466 }
467 break;
468 } else {
469 Fatal("error in wait: %d: %s", retstat, strerror(errno));
470 /*NOTREACHED*/
471 }
472 }
473 free(cmdStart);
474
475 return (status);
476 }
477
478 /*-
480 *-----------------------------------------------------------------------
481 * Compat_Make --
482 * Make a target.
483 *
484 * Input:
485 * gnp The node to make
486 * pgnp Parent to abort if necessary
487 *
488 * Results:
489 * 0
490 *
491 * Side Effects:
492 * If an error is detected and not being ignored, the process exits.
493 *
494 *-----------------------------------------------------------------------
495 */
496 int
497 Compat_Make(void *gnp, void *pgnp)
498 {
499 GNode *gn = (GNode *)gnp;
500 GNode *pgn = (GNode *)pgnp;
501
502 if (!meta[0]) /* we came here from jobs */
503 Compat_Init();
504 if (gn->made == UNMADE && (gn == pgn || (pgn->type & OP_MADE) == 0)) {
505 /*
506 * First mark ourselves to be made, then apply whatever transformations
507 * the suffix module thinks are necessary. Once that's done, we can
508 * descend and make all our children. If any of them has an error
509 * but the -k flag was given, our 'make' field will be set FALSE again.
510 * This is our signal to not attempt to do anything but abort our
511 * parent as well.
512 */
513 gn->flags |= REMAKE;
514 gn->made = BEINGMADE;
515 if ((gn->type & OP_MADE) == 0)
516 Suff_FindDeps(gn);
517 Lst_ForEach(gn->children, Compat_Make, gn);
518 if ((gn->flags & REMAKE) == 0) {
519 gn->made = ABORTED;
520 pgn->flags &= ~REMAKE;
521 goto cohorts;
522 }
523
524 if (Lst_Member(gn->iParents, pgn) != NULL) {
525 char *p1;
526 Var_Set(IMPSRC, Var_Value(TARGET, gn, &p1), pgn, 0);
527 if (p1)
528 free(p1);
529 }
530
531 /*
532 * All the children were made ok. Now cmgn->mtime contains the
533 * modification time of the newest child, we need to find out if we
534 * exist and when we were modified last. The criteria for datedness
535 * are defined by the Make_OODate function.
536 */
537 if (DEBUG(MAKE)) {
538 fprintf(debug_file, "Examining %s...", gn->name);
539 }
540 if (! Make_OODate(gn)) {
541 gn->made = UPTODATE;
542 if (DEBUG(MAKE)) {
543 fprintf(debug_file, "up-to-date.\n");
544 }
545 goto cohorts;
546 } else if (DEBUG(MAKE)) {
547 fprintf(debug_file, "out-of-date.\n");
548 }
549
550 /*
551 * If the user is just seeing if something is out-of-date, exit now
552 * to tell him/her "yes".
553 */
554 if (queryFlag) {
555 exit(1);
556 }
557
558 /*
559 * We need to be re-made. We also have to make sure we've got a $?
560 * variable. To be nice, we also define the $> variable using
561 * Make_DoAllVar().
562 */
563 Make_DoAllVar(gn);
564
565 /*
566 * Alter our type to tell if errors should be ignored or things
567 * should not be printed so CompatRunCommand knows what to do.
568 */
569 if (Targ_Ignore(gn)) {
570 gn->type |= OP_IGNORE;
571 }
572 if (Targ_Silent(gn)) {
573 gn->type |= OP_SILENT;
574 }
575
576 if (Job_CheckCommands(gn, Fatal)) {
577 /*
578 * Our commands are ok, but we still have to worry about the -t
579 * flag...
580 */
581 if (!touchFlag || (gn->type & OP_MAKE)) {
582 curTarg = gn;
583 #ifdef USE_META
584 if (useMeta && !NoExecute(gn)) {
585 meta_job_start(NULL, gn);
586 }
587 #endif
588 Lst_ForEach(gn->commands, CompatRunCommand, gn);
589 curTarg = NULL;
590 } else {
591 Job_Touch(gn, gn->type & OP_SILENT);
592 }
593 } else {
594 gn->made = ERROR;
595 }
596 #ifdef USE_META
597 if (useMeta && !NoExecute(gn)) {
598 meta_job_finish(NULL);
599 }
600 #endif
601
602 if (gn->made != ERROR) {
603 /*
604 * If the node was made successfully, mark it so, update
605 * its modification time and timestamp all its parents. Note
606 * that for .ZEROTIME targets, the timestamping isn't done.
607 * This is to keep its state from affecting that of its parent.
608 */
609 gn->made = MADE;
610 pgn->flags |= Make_Recheck(gn) == 0 ? FORCE : 0;
611 if (!(gn->type & OP_EXEC)) {
612 pgn->flags |= CHILDMADE;
613 Make_TimeStamp(pgn, gn);
614 }
615 } else if (keepgoing) {
616 pgn->flags &= ~REMAKE;
617 } else {
618 PrintOnError(gn, "\n\nStop.");
619 exit(1);
620 }
621 } else if (gn->made == ERROR) {
622 /*
623 * Already had an error when making this beastie. Tell the parent
624 * to abort.
625 */
626 pgn->flags &= ~REMAKE;
627 } else {
628 if (Lst_Member(gn->iParents, pgn) != NULL) {
629 char *p1;
630 Var_Set(IMPSRC, Var_Value(TARGET, gn, &p1), pgn, 0);
631 if (p1)
632 free(p1);
633 }
634 switch(gn->made) {
635 case BEINGMADE:
636 Error("Graph cycles through %s", gn->name);
637 gn->made = ERROR;
638 pgn->flags &= ~REMAKE;
639 break;
640 case MADE:
641 if ((gn->type & OP_EXEC) == 0) {
642 pgn->flags |= CHILDMADE;
643 Make_TimeStamp(pgn, gn);
644 }
645 break;
646 case UPTODATE:
647 if ((gn->type & OP_EXEC) == 0) {
648 Make_TimeStamp(pgn, gn);
649 }
650 break;
651 default:
652 break;
653 }
654 }
655
656 cohorts:
657 Lst_ForEach(gn->cohorts, Compat_Make, pgnp);
658 return (0);
659 }
660
661 /*-
663 *-----------------------------------------------------------------------
664 * Compat_Run --
665 * Initialize this mode and start making.
666 *
667 * Input:
668 * targs List of target nodes to re-create
669 *
670 * Results:
671 * None.
672 *
673 * Side Effects:
674 * Guess what?
675 *
676 *-----------------------------------------------------------------------
677 */
678 void
679 Compat_Run(Lst targs)
680 {
681 GNode *gn = NULL;/* Current root target */
682 int errors; /* Number of targets not remade due to errors */
683
684 Compat_Init();
685
686 if (bmake_signal(SIGINT, SIG_IGN) != SIG_IGN) {
687 bmake_signal(SIGINT, CompatInterrupt);
688 }
689 if (bmake_signal(SIGTERM, SIG_IGN) != SIG_IGN) {
690 bmake_signal(SIGTERM, CompatInterrupt);
691 }
692 if (bmake_signal(SIGHUP, SIG_IGN) != SIG_IGN) {
693 bmake_signal(SIGHUP, CompatInterrupt);
694 }
695 if (bmake_signal(SIGQUIT, SIG_IGN) != SIG_IGN) {
696 bmake_signal(SIGQUIT, CompatInterrupt);
697 }
698
699 ENDNode = Targ_FindNode(".END", TARG_CREATE);
700 ENDNode->type = OP_SPECIAL;
701 /*
702 * If the user has defined a .BEGIN target, execute the commands attached
703 * to it.
704 */
705 if (!queryFlag) {
706 gn = Targ_FindNode(".BEGIN", TARG_NOCREATE);
707 if (gn != NULL) {
708 Compat_Make(gn, gn);
709 if (gn->made == ERROR) {
710 PrintOnError(gn, "\n\nStop.");
711 exit(1);
712 }
713 }
714 }
715
716 /*
717 * Expand .USE nodes right now, because they can modify the structure
718 * of the tree.
719 */
720 Make_ExpandUse(targs);
721
722 /*
723 * For each entry in the list of targets to create, call Compat_Make on
724 * it to create the thing. Compat_Make will leave the 'made' field of gn
725 * in one of several states:
726 * UPTODATE gn was already up-to-date
727 * MADE gn was recreated successfully
728 * ERROR An error occurred while gn was being created
729 * ABORTED gn was not remade because one of its inferiors
730 * could not be made due to errors.
731 */
732 errors = 0;
733 while (!Lst_IsEmpty (targs)) {
734 gn = (GNode *)Lst_DeQueue(targs);
735 Compat_Make(gn, gn);
736
737 if (gn->made == UPTODATE) {
738 printf("`%s' is up to date.\n", gn->name);
739 } else if (gn->made == ABORTED) {
740 printf("`%s' not remade because of errors.\n", gn->name);
741 errors += 1;
742 }
743 }
744
745 /*
746 * If the user has defined a .END target, run its commands.
747 */
748 if (errors == 0) {
749 Compat_Make(ENDNode, ENDNode);
750 if (gn->made == ERROR) {
751 PrintOnError(gn, "\n\nStop.");
752 exit(1);
753 }
754 }
755 }
756