Another idea: Enable .ONESHELL to be per-target. Problem: According to the docs .ONESHELL is global in effect, so using it in an existing makefile requires a lot of rework. In many cases .ONESHELL is primarily only useful only for specific rules, and there's no need to rewrite the rest.
The current rules are also oddly inconsistent with many of the other special targets; most other special targets allow a list of dependencies where it makes sense to support them. Solution: Let's expand .ONESHELL so that if specific prerequisites are identified for it, it applies only to those prerequisites. If no prerequisites are listed, it would work just like it does now. As a result this change is completely backwards compatible. Note that this works especially well with target-specific variables, so you can even set SHELL and .SHELLFLAGS for a specific target: ~~~~ .ONESHELL: foo foo: SHELL = /usr/bin/perl foo: .SHELLFLAGS = -e foo: ... <TAB>commands that will run as a single shell. ~~~~ Note the ".SHELLFLAGS =", which is odd syntactically but should be allowed. This also works nicely with "Idea: Allow certain special targets as dependencies": ~~~~ bar: .ONESHELL ... <TAB>...commands that will run as a single shell ~~~~ --- David A. Wheeler _______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make