def METHOD_NAME(
        name,
        relative_labels = [],
        relative_labels_map = {},
        actual_subdir = "",
        add_deprecation_warning = False,
        tags = [],
        **kwargs):
    """Generates a drake_cc_library filled with generated header files that
    merely include other header files, optionally with a deprecation warning.
    This automates the chore of adding compatibility headers when packages
    move.
    The relative_labels + relative_labels_map.keys() specify the header
    filenames to generate.  For each label name ':foo', this macro generates a
    header named 'foo.h' that includes 'drake/{actual_subdir}/{new_foo}.h'
    where new_foo for relative_labels is the same as foo, and new_foo for
    relative_labels_map is the value for the foo key (without the leading
    colon).
    When add_deprecation_warning is true, the generated header will have a
    #warning directive explaining the new location.
    """
    actual_subdir or fail("Missing required actual_subdir")
    # Generate one header file for each mapped label.
    hdrs = []
    mapping = _combine_relative_labels(relative_labels, relative_labels_map)
    for stub_relative_label, actual_relative_label in mapping.items():
        actual_include = "drake/{}/{}.h".format(
            actual_subdir,
            actual_relative_label[1:],
        )
        warning = "#warning This header is deprecated; use {} instead".format(
            actual_include,
        ) if add_deprecation_warning else ""
        basename = stub_relative_label[1:] + ".h"
        generate_file(
            name = basename,
            content = "\n".join([
                "#pragma once",
                "{warning}",
                "#include \"{actual_include}\"",
            ]).format(
                warning = warning,
                actual_include = actual_include,
            ),
        )
        hdrs.append(basename)
    # Place all of the header files into a library.
    drake_cc_library(
        name = name,
        hdrs = hdrs,
        tags = tags + ["nolint"],
        **kwargs
    )