/* Whether or not .SECONDARY with no prerequisites was given. */
static int all_secondary = 0;
-/* Whether or not .NOTINTERMEDIATE with no prerequisites was given. */
-static int no_intermediates = 0;
-
/* Access the hash table of all file records.
lookup_file given a name, return the struct file * for that name,
or nil if there is none.
int doneany = 0;
/* If there's no way we will ever remove anything anyway, punt early. */
- if (question_flag || touch_flag || all_secondary)
+ if (question_flag || touch_flag || all_secondary || no_intermediates)
return;
if (sig && just_print_flag)
/* If .NOTINTERMEDIATE is set with no deps, mark all targets as
notintermediate, unless the target is a prereq of .INTERMEDIATE. */
if (no_intermediates && !f->intermediate && !f->secondary)
- f->notintermediate = 1;
+ f->notintermediate = 1;
/* If .EXTRA_PREREQS is set, add them as ignored by automatic variables. */
if (f->variables)
f->also_make = imf->also_make;
f->is_target = 1;
f->is_explicit |= imf->is_explicit || pat->is_explicit;
- f->notintermediate |= imf->notintermediate;
+ f->notintermediate |= imf->notintermediate || no_intermediates;
f->intermediate |= !f->is_explicit && !f->notintermediate;
f->tried_implicit = 1;
{
if (f->precious)
file->precious = 1;
- if (f->notintermediate)
+ if (f->notintermediate || no_intermediates)
file->notintermediate = 1;
}
}
{
if (f->precious)
new->file->precious = 1;
- if (f->notintermediate)
+ if (f->notintermediate || no_intermediates)
new->file->notintermediate = 1;
}
char cmd_prefix = '\t';
+/* Whether or not .NOTINTERMEDIATE with no prerequisites was given. */
+unsigned int no_intermediates;
+
/* Count the number of commands we've invoked, that might change something in
the filesystem. Start with 1 so calloc'd memory never matches. */
#define RECIPEPREFIX_DEFAULT '\t'
extern char cmd_prefix;
+extern unsigned int no_intermediates;
+
#define JOBSERVER_AUTH_OPT "jobserver-auth"
extern char *jobserver_auth;
/* Since make has not created this file, make should not remove it,
even if the file is intermediate. */
- file->secondary = 1;
+ if (!file->notintermediate && no_intermediates == 0)
+ file->secondary = 1;
notice_finished_file (file);
# Test 4. .NOTINTERMEDIATE without prerequisites makes everything
# notintermediate.
-unlink('hello.z');
run_make_test(q!
hello.z:
%.z: %.x; touch $@
.SECONDARY:
!, '', "touch hello.z\n");
-
-
unlink('hello.z');
# This tells the test driver that the perl test script executed properly.
1;