jay@banzai.uucp (Jay Schuster) (02/15/89)
[ Apologies -- I have mailed this out before, but I never saw it hit the Usenet newsgroups, and it bounced in a number of interesting ways. Now that the gateway at osu-cis appears fixed, I am trying again. I have no idea if that was the cause of the problem. ] Here're two context diffs. The first fixes a problem whereby if you had a directory empty except for an RCS subdirectory, where a.c and Makefile were checked in, make would go and check out the Makefile, but then not re-exec itself to read the Makefile -- it would just use its default rules. It has to do with the code where it checks to see if it could make any of the Makefiles. The second adds yet another flag that disables the implicit make of makefile, Makefile, and GNUmakefile. Some of you may be interested in this. *** make.c~ Tue Jan 24 16:57:23 1989 --- make.c Fri Jan 27 16:07:57 1989 *************** *** 252,257 **** --- 259,265 ---- register struct dep *lastgoal; struct dep *read_makefiles; char current_directory[MAXPATHLEN]; + int updated_makefile; default_goal_file = 0; reading_filename = 0; *************** *** 591,596 **** --- 619,625 ---- case 1: /* Failed to update. Figure out if we care. */ + updated_makefile = 0; status = 0; while (read_makefiles != 0) { *************** *** 609,614 **** --- 638,646 ---- if (d->changed == 0) status = 1; } + /* set updated_makefile only if it really was successful */ + if (d->file->update_status == 0) + updated_makefile = 1; } else /* This makefile was not found at all. */ *************** *** 637,643 **** /* A makefile we care about couldn't be found or remade. */ die (1); ! break; case 0: /* Updated successfully. Re-exec ourselves. */ --- 669,677 ---- /* A makefile we care about couldn't be found or remade. */ die (1); ! if (!updated_makefile) ! break; ! /* Else, fall through to the Re-exec case */ case 0: /* Updated successfully. Re-exec ourselves. */ Here's the second diff. *** make.c~ Tue Jan 24 16:57:23 1989 --- make.c Fri Jan 27 16:07:57 1989 *** 57,62 **** --- 57,63 ---- * -j job_slots * -k keep_going * -m ignored for compatibility with something or other + * -M don't try to make makefile or its deps * -n just_print * -o consider file old * -p print_data_base *************** *** 157,162 **** --- 158,167 ---- int print_version_flag = 0; + /* Nonzero means don't try to make makefiles or their deps */ + + int dont_make_makefiles = 0; + /* List of makefiles given with -f switches. */ static struct stringlist *makefiles = 0; *************** *** 196,201 **** --- 201,207 ---- { 'j', positive_int, (char *) &job_slots, 1, 1 }, { 'k', flag, (char *) &keep_going_flag, 1, 1 }, { 'm', ignore, 0, 0, 0 }, + { 'M', flag, (char *) &dont_make_makefiles, 1, 1 }, { 'n', flag, (char *) &just_print_flag, 1, 1 }, { 'o', string, (char *) &old_files, 0, 0 }, { 'p', flag, (char *) &print_data_base_flag, 0, 0 }, *************** *** 573,579 **** } } ! if (read_makefiles != 0) { /* Update any makefiles if necessary. */ --- 601,607 ---- } } ! if (!dont_make_makefiles && read_makefiles != 0) { /* Update any makefiles if necessary. */ -- Jay Schuster uunet!uvm-gen!banzai!jay, attmail!banzai!jay The People's Computer Company `Revolutionary Programming'