# src(7) -- layout of NetBSD sources ## DESCRIPTION > An outline of the NetBSD source code hierarchy. #### bin/ #### sbin/ #### usr.bin/ #### usr.sbin/ > Sources for utilities/files in directories with corresponding names. Every utility has its own subdirectory, where its source and Makefile are located. #### common/ > Sources shared between kernel and userland. > ##### dist/ > > Utilities. Every utility has its own subdirectory, where its source and Makefile are located. > ##### include/ > > Include headers. Every group of header files has its own subdirectory, where it and its Makefile are located. > ##### lib/ > > Libraries. Every library has its own subdirectory, where it and its Makefile are located. #### compat/ > A framework to (re)build the libraries shipped with NetBSD for different ABI than the default for that platform. > ##### compat/<arch1>/<arch2>/ > > Every `compat//` directory contains a Makefile and a makefile fragment for building an `` compat libraries for ``. E. g., `compat/amd64/i386/` is where the 32-bit compat libraries for the amd64 port are being built. > ##### compatsubdir.mk > > The list of subdirectories (the libraries and ld.elf_so) to build with this ABI. > ##### archdirs.mk > > The list of subdirectories for each port. > ##### Makefile.compat > > The basic framework to force the right paths for library and ld.elf_so linkage. > ##### dirshack/Makefile > > A hack to get objdirs created timely. #### crypto/ > Cryptographic source, which may have import or export restrictions. > ##### dist/ > > Original sources. This is deprecated; `crypto/external/` should be used instead. > ##### external/ > > Original sources, grouped by license, and then package per license. `crypto/external///dist/` contain original sources for given package; other directories contain Makefiles and given package's config files. #### dist/ > Unmodified sources from third parties. This is deprecated; `external/` should be used instead. #### distrib/ > Tools and data-files for making distributions. > ##### <arch>/ > > Architecture-specific files, grouped by image type. E. g., `distrib//floppies/` contains Makefiles for making images for various types of floppies; `/ramdisk/` contains makefiles for making ramdisks etc. > ##### cdrom/ > > Was used to create bootable CD images. This is deprecated; `build.sh`'s `iso-image` target should be used instead. > ##### common/ > > Common files for images generation. > ##### miniroot/ > > Files for miniroot. > ##### notes/<arch> > > Architecture-specific parts of release notes. > ##### sets/ > > Scripts for making file sets. > ##### utils/ > > Utilities for installation ramdisk. #### doc/ > Development documentation files: changelogs, build readmes etc. `doc/roadmaps/` contains roadmaps. #### etc/ > Default configuration files to be put into `/etc`. > ##### etc/etc.<arch>/ > > Architecture-specific config files. #### external/ > Unmodified sources from third parties, grouped by license. They are built with so-called "reachover" Makefiles which can be found in `src/*bin/` hierarchies. > Every `external///` may contain: > ##### dist/ > > Unmodified third party source for a given package > ##### bin/ > ##### usr.bin/ > ##### usr.sbin/ > ##### etc. > > Such subdirectories contain reachover Makefiles, README's and various import helper scripts. E. g., `external/public-domain/` contains sources licensed under Public Domain license; `external/public-domain/sqlite/dist/` contains original sources; `external/public-domain/sqlite/bin/`, `external/public-domain/sqlite/lib/` and `external/public-domain/sqlite/` itself contain reachover Makefiles. #### extsrc/ > Optional developer-provided sources that are built if `MKEXTSRC=yes`, as a way to include extra components in the build. #### games/ > Sources for utilities/files in `/usr/games`; each utility has it's own subdirectory, where its sources and Makefiles are located. #### gnu/ > Sources licensed under GNU GPL. This is deprecated; `external/gpl2/` or `external/gpl3/` should be used instead. `gnu/dists` contains the original GNU sources plus changes that were submitted to maintainers and that are not yet published. Other folders contain files that are never expected to be submitted to the FSF (reachover Makefiles, etc.) #### include/ > Files to be put into `/usr/include`. #### lib/ > Source for libraries in `/usr/lib` and some scripts for them. Every directory contains source for given library and Makefiles. #### libexec/ > Source for utilities in `/usr/libexec`. Every directory contains source for given utility and Makefiles. #### regress/ > Various regression tests in `/usr/tests`. This is deprecated; most tests are being migrated into `tests/` once they are migrated to the `atf(7) test framework. #### rescue/ > Makefiles for building utilities in `/rescue`. #### share/ > Source for utilities/files in `/usr/share`. Every utility has its own subdirectory, where its source and Makefile are located. #### sys/ > Kernel source. #### tests/ > Source for test programs in `/usr/tests`. These tests use the `atf(7)` test framework. For library routines, including system calls, the directory structure of the tests should follow the directory structure of the real source tree. For instance, interfaces available via the C library should follow: > `src/lib/libc/gen` -> `src/tests/lib/libc/gen` > `src/lib/libc/sys` -> `src/tests/lib/libc/sys` > Equivalently, all tests for userland utilities should try to follow their location in the source tree. If this can not be satisfied, the tests for a utility should be located under the directory to which the utility is installed. Thus, a test for `env(1)` should go to `src/tests/usr.bin/env`. Likewise, a test for `tcpdump(8)` should be in `src/tests/usr.sbin/tcpdump `, even though the source code for the program is located under `src/external`. #### tools/ > Reachover build structure for the host build tools. Every utility has its own directory, where its Makefile is located. #### x11/ > Reachover build structure for X11R7; the source is in `X11SRCDIR`. The directory structure copies the system's; every directory contains a Makefile. ## SEE ALSO > `hier(7)` ## AUTHOR > This manpage was initially written by Elvira Khabirova <skinder0@gmail.com> ## HISTORY > This file was created as a part of Google Code-in 2012.