Asuswrt-Merlin is published under the GPLv2 license. The source code is published on Github where it can be browsed from the web, or checked out using a git client. Note that there are two code repositories.
The legacy branch (up to version 380.xx, no longer under active development):
The current / new generation branch (starting with release 382.1):
Development is done in a Ubuntu-Linux 16.04 LTS virtual machine. Ubuntu 10.04 and 12.04 are other development environments known to work for compiling the firmware, but might require some adjustments. See the Wiki for guides on how to set up a build environment.
Note that some components are proprietary to various entities (Asus, Broadcom, Quantenna, Paragon Software, Tuxera, etc...). For these, the precompiled binary blobs are included in the repository, and the build system is able to make use of them to generate a fully working firmware.
Copyrights belong to their respective owners.