How do modules end up in the profiles directory in distributions? I'm building a basic distribution and I cannot find any information on how contributed modules that are included in a distribution get placed into the drupal-root/profiles/profile-name/modules directory.

I've looked at a number of distributions, both hosted on drupal.org and not, trying to find some line(s) of code that does this, but there doesn't seem to be any. It has got to be happening "automatically" somehow, but it isn't working for me. When I add modules to my make file, they always end up in sites/all/modules.

I've spent hours trying to ask Google this question but every form I can come up with just gives me information on how to install a module, or how to move modules from the profile of a distribution into sites/all/modules - both of which I am well aware of...

So, can anyone direct me to documentation that can help me out? I'm sure it is out there, but I've hit a wall trying to find it.
I found the problem.

I have two make files - drupal-org.make.yml &amp; build-xq42_d7_sk.make.yml. I was including the following in the build-xq42_d7_sk.make.yml:

includes:
  - drupal-org.make.yml


Turns out this caused the problem. There's no need to include any reference to that file at all in the build-profile-name.make.yml file.

This is the first make file I've built and I created it by reading documentation and looking at existing make files for other projects. I saw this line in one of the make files I used as an example and assumed it was OK.

Now I know...!