Skip to content

The target was already there

 1 min One Makefile alias exposed Kubernetes’ existing OpenAPI generator without adding another implementation.
Published

Aug 8, 2019

Kubernetes already had a gen_openapi target in its generated-files Makefile. Its comment called it the user-friendly entry point. The outer Makefile did not expose it.

My patch added the target name to the existing forwarding rule:

generated_files gen_openapi:
    $(MAKE) -f Makefile.generated_files $@ CALLED_FROM_MAIN_MAKEFILE=1

$@ carries the requested target into the inner Makefile. Asking for the whole generated-files operation continued to work, while asking specifically for OpenAPI generation reached the implementation that was already present.

The new entry point did not duplicate generator commands, dependencies, or flags. Those remained with the inner target. The forwarding layer only needed to admit another name.

The PR merged later that month.