#endif
}
\f
-/* Set the 'command_state' member of FILE and all its 'also_make's. */
+/* Set the 'command_state' member of FILE and all its 'also_make's.
+ Don't decrease the state of also_make's (e.g., don't downgrade a 'running'
+ also_make to a 'deps_running' also_make). */
void
set_command_state (struct file *file, enum cmd_state state)
file->command_state = state;
for (d = file->also_make; d != 0; d = d->next)
- d->file->command_state = state;
+ if (state > d->file->command_state)
+ d->file->command_state = state;
}
\f
/* Convert an external file timestamp to internal form. */
us_question, /* Needs to be updated (-q is is set). */
us_failed /* Update failed. */
} update_status ENUM_BITFIELD (2);
- enum cmd_state /* State of the commands. */
+ enum cmd_state /* State of commands. ORDER IS IMPORTANT! */
{
cs_not_started = 0, /* Not yet started. Must be 0! */
cs_deps_running, /* Dep commands running. */
1;
+# Test pattern rules building the same targets
+# See SV 54233. Rely on our standard test timeout to break the loop
+
+touch('a.c');
+
+run_make_test(q!
+all: a.elf a.dbg
+
+%.elf %.lnk: %.c ; : $*.elf $*.lnk
+
+%.elf %.dbg: %.lnk ; : $*.elf $*.dbg
+!,
+ '-j2', ": a.elf a.lnk\n: a.elf a.dbg\n");
+
+unlink('a.c');
+
# This tells the test driver that the perl test script executed properly.
1;