From the variable glossary manual of yocto kirkstone (https://docs.yoctoproject.org/4.0.30/ref-manual/variables.html):
S
The location in the Build Directory where unpacked recipe source code resides. By default, this directory is
${WORKDIR}/${BPN}-${PV}, where${BPN}is the base recipe name and${PV}is the recipe version. If the source tarball extracts the code to a directory named anything other than${BPN}-${PV}, or if the source code is fetched from an SCM such as Git or Subversion, then you must set S in the recipe so that the OpenEmbedded build system knows where to find the unpacked source.
WORKDIR
The pathname of the work directory in which the OpenEmbedded build system builds a recipe. This directory is located within the TMPDIR directory structure and is specific to the recipe being built and the system for which it is being built.
If I want to create a simple hello world recipe, I would expect from the variable definition that the source file hello.c would be placed under S. However yocto only copies that to WORKDIR.
What is the reason for this ? Is the expectation on the developer to set the S variable correctly for each recipe or copy the files to S in a do_config task ?