Lines Matching defs:makefile
83 static void redirect(const char *line, const char *makefile);
113 char *makefile = NULL;
335 makefile = argv[0] + 2;
336 if (*makefile == '\0') {
339 makefile = *(++argv);
415 redirect(startat, makefile);
722 redirect(const char *line, const char *makefile)
732 * if makefile is "-" then let it pour onto stdout.
734 if (makefile && *makefile == '-' && *(makefile + 1) == '\0') {
740 * use a default if makefile is not specified.
742 if (!makefile) {
744 makefile = "Makefile";
745 else if (stat("makefile", &st) == 0)
746 makefile = "makefile";
751 if (stat(makefile, &st) != 0)
752 fatalerr("\"%s\" is not present\n", makefile);
755 snprintf(backup, sizeof(backup), "%s.bak", makefile);
759 if (rename(makefile, backup) < 0)
760 fatalerr("cannot rename %s to %s\n", makefile, backup);
762 if (rename(backup, makefile) < 0)
764 makefile, backup);
765 fatalerr("cannot open \"%s\"\n", makefile);
767 if ((fdout = freopen(makefile, "w", stdout)) == NULL)
789 chmod(makefile, st.st_mode);