- $(MAKECMDGOALS): trace
- trace: FORCE
- @[ -f "$(MAKECMDGOALS)" ] || { \
- [ -z "$${PWD##$$TOPDIR}" ] || DIR=" -C $${PWD##$$TOPDIR/}"; \
- $(call MESSAGE, "make[$$(($(MAKELEVEL)+1))]$$DIR $(MAKECMDGOALS)"); \
- }
+ ifneq ($(CURDIR),$(TOPDIR))
+ _DIR:=$(patsubst $(TOPDIR)/%,%,${CURDIR})
+ else
+ _DIR:=
+ endif
+ _NULL:=$(if $(MAKECMDGOALS),$(shell \
+ $(call MESSAGE, "make[$(MAKELEVEL)]$(if $(_DIR), -C $(_DIR)) $(MAKECMDGOALS)"); \
+ ))