aurora,7:/tmp% /usr/local/apache2-install/www.apache.org/current/bin/apxs -gn foo >/dev/null aurora,7:/tmp% grep apxs foo/Makefile ## Autogenerated via ``apxs -n foo -g''. APXS=apxs The generated Makefile refers to the 'apxs' binary in $PATH. That is not the same binary as the one that generated the Makefile (in my case, there is no apxs in $PATH; but in general there could be a different install's apxs in $PATH). Instead I would expect apxs to generate a Makefile that refers to itself.
FWIW, this was fixed in trunk@1535699 with the removal of the unused APXS variable.