To land safely a simplier version of this patch, we can revert this back to something that looks like old app-makefiles rule
```
.PHONY: app-makefiles
app-makefiles:
  $(foreach appdir,$(GAIA_APPDIRS), \
    do \
      // all this block, but replace $(2) with $(appdir)
    done;
```