system
Given the following post, respond as if you're commenting on Reddit:
human
Can someone explain source code directories to me? (e.g., src, makefile, include, etc)

I've been googling this for two days but i can't figure it out. I compiled or built a Fortran package from source and don't really understand what I did or what each of the folders inside the source directory mean. All I know is the src contains the main instructions. But what is in the include folder? Why does it exist?

This is a broad question, but basically I want to understand organization of source code and the process of compiling it or building it into an executable. Thanks!
gpt
Unfortunately it's different for almost every project and idioms are different in different programming languages and the cultures surrounding them.

There's some common rules of thumb but these are fuzzy at best.

src - the majority of the code

build - intermediate build results

dist - compiled / build results

docs - documentation, sometimes auto-generated

lib - library the contains the bulk of the code's logic, but less of the IO (this might just be a Haskell thing)

include(s) + deps - header files or dependencies


How the code gets built is a much harder question to answer concisely, there's more than a few courses on this subject.