chiark / gitweb /
subdirmk: break out subdirmk_target in generated Makefile
[subdirmk.git] / generate
index 87e2214..22e8aff 100755 (executable)
--- a/generate
+++ b/generate
@@ -101,8 +101,9 @@ sub write_makefile ($$) {
 default: all
 \$(filter-out all,\$(MAKECMDGOALS)) all: run-main.mk
        \@:
+subdirmk_targets:=\$(or \$(MAKECMDGOALS),all)
 Makefile run-main.mk:
-       \$(MAKE) -C $cd -f main.mk \$(addprefix ${dir_prefix},\$(or \$(MAKECMDGOALS),all))
+       \$(MAKE) -C $cd -f main.mk \$(addprefix ${dir_prefix},\$(subdirmk_targets))
 .SUFFIXES:
 .PHONY:        run-main.mk
 END