chiark / gitweb /
subdirmk/generate: Supply default target if none given in command line
authorMark Wooding <mdw@distorted.org.uk>
Wed, 13 Nov 2019 18:42:18 +0000 (18:42 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 13 Nov 2019 19:29:56 +0000 (19:29 +0000)
If you just run `make' then `$(MAKECMDGOALS)' is empty, so we get the
default target of `main.mk'.  Nothing is set up by `usual.mk', so we
end up with `$(srcdir)/configure' established by `regen.mk'.

Instead, propagate `all' to the `main.mk' makefile.  Maybe this should
be configurable, though I don't think that'll be very useful in real
life.

Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
subdirmk/generate

index 8669864df0620a521eff9d5d615156de6fb4c9d6..fbf07d4664fc6c46a7382679a2fc6affae8b90a5 100755 (executable)
@@ -102,7 +102,7 @@ default: all
 %:     FORCE-ALWAYS-RUN
        \@:
 Makefile FORCE-ALWAYS-RUN:
-       \$(MAKE) -C $cd -f main.mk \$(addprefix ${dir_prefix},\$(MAKECMDGOALS))
+       \$(MAKE) -C $cd -f main.mk \$(addprefix ${dir_prefix},\$(or \$(MAKECMDGOALS),all))
 .SUFFIXES:
 END
 }