I'm trying to compile Android following the instructions at
https://source.android.com/docs/setup/build/building but running source build/envsetup.sh in the platform directory always returns "Couldn't locate the top of the tree. Always source build/envsetup.sh from the root of the tree." without fail. Trying to run the command from anywhere else just leads to bash not being able to find envsetup.sh at all, so that's out of the question. Some digging into the source code reveals that the script is looking for
build/make/core/envsetup.mk but no such file exists in the entire source tree, only build/core/
envsetup.mk so this will always fail. But I seem to be the only one who cannot compile Android at all, it works for everyone else despite the file not existing, otherwise this strange code would've been changed long ago. Is there anything I am doing wrong running the command? Thanks in advance!