The script mkmakefile generates the following Makefile in the builddir.
If invoked all targets are passed to the srcdir Makefile.
Can anyone explain why? Where is the magic?
lastword = $(word $(words $(1)),$(1)) makedir := $(dir $(call lastword,\$(MAKEFILE_LIST))) MAKEARGS := -C path_to_srcdir MAKEARGS += O=$(if $(patsubst /%,,$(makedir)),$(CURDIR)/)$(patsubst %/,%,$(makedir)) MAKEFLAGS += --no-print-directory .PHONY: all $(MAKECMDGOALS) all := $(filter-out all Makefile,$(MAKECMDGOALS)) all: $(MAKE) $(MAKEARGS) $(all) Makefile:; $(all): all @: %/: all @: