1LLVM libc build rules 2===================== 3 4At the cost of verbosity, we want to keep the build system of LLVM libc 5as simple as possible. We also want to be highly modular with our build 6targets. This makes picking and choosing desired pieces a straighforward 7task. 8 9Targets for entrypoints 10----------------------- 11 12Every entrypoint in LLVM-libc has its own build target. This target is listed 13using the ``add_entrypoint_object`` rule. This rule generates a single object 14file containing the implementation of the entrypoint. 15 16Targets for redirecting entrypoints are also listed using the 17``add_entrypoint_object`` rule. However, one will have to additionally specify 18the ``REDIRECTED`` option with the rule. 19 20Targets for entrypoint libraries 21-------------------------------- 22 23Standards like POSIX require that a libc provide certain library files like 24``libc.a``, ``libm.a``, etc. The targets for such library files are listed in 25the ``lib`` directory as ``add_entrypoint_library`` targets. An 26``add_entrypoint_library`` target takes a list of ``add_entrypoint_object`` 27targets and produces a static library containing the object files corresponding 28to the ``add_entrypoint_targets``. 29 30Targets for redirectors 31----------------------- 32 33Similar to how every entrypoint in LLVM-libc has its own build target, every 34redirector function also has its own build target. This target is listed using 35the ``add_redirector_object`` rule. This rule generates a single object file 36which can be packaged along with other redirector objects into shared library 37of redirectors (see below). 38 39Targets for library of redirectors 40---------------------------------- 41 42Targets for shared libraries of redirectors are listed using the 43``add_redirector_library`` rule. 44