logo

blog

My website can't be that messy, right? git clone https://anongit.hacktivis.me/git/blog.git/

buildsystems-conventions.shtml (3756B)


  1. <!DOCTYPE html>
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <!--#include file="/templates/head.shtml" -->
  5. <title>Buildsystems Conventions — lanodan’s cyber-home</title>
  6. </head>
  7. <body>
  8. <!--#include file="/templates/en/nav.shtml" -->
  9. <main class="section-count">
  10. <h1>Buildsystems Conventions</h1>
  11. <p>
  12. This only contains the common bits accross buildsystems, not the ones specific to a particular buildsystem or particular project.
  13. </p>
  14. <h2>Environment variables</h2>
  15. <h3>POSIX</h3>
  16. <dl>
  17. <dt><var>CC</var></dt>
  18. <dd>Command/path to target C Compiler</dd>
  19. <dt><var>CFLAGS</var></dt>
  20. <dd>
  21. Flags passed to target C Compiler.<br />
  22. Should not be expected to contain values such as <code>-std=c99</code>.
  23. </dd>
  24. <dt><var>LDFLAGS</var></dt>
  25. <dd>Linking flags passed to target Compiler</dd>
  26. <dt><var>YACC</var></dt>
  27. <dd>Command/path to <code>yacc(1)</code></dd>
  28. <dt><var>YFLAGS</var></dt>
  29. <dd>Flags passed to <code>yacc(1)</code></dd>
  30. <dt><var>LEX</var></dt>
  31. <dd>Command/path to <code>lex(1)</code></dd>
  32. <dt><var>LFLAGS</var></dt>
  33. <dd>Flags passed to <code>lex(1)</code></dd>
  34. <dt><var>AR</var></dt>
  35. <dd>Command/path to <code>ar(1)</code></dd>
  36. <dt><var>ARFLAGS</var></dt>
  37. <dd>
  38. Flags passed to <code>ar(1)</code>.<br />
  39. Default for <code>make(1)</code> specified as <code>-rv</code> by POSIX.1-2008.
  40. </dd>
  41. <dt><var>FC</var></dt>
  42. <dd>Command/path to target Fortran Compiler</dd>
  43. <dt><var>FFLAGS</var></dt>
  44. <dd>Flags passed to target Fortran Compiler</dd>
  45. </dl>
  46. <h3>Widespread but nor formally specified</h3>
  47. <dl>
  48. <dt><var>RANLIB</var></dt>
  49. <dd>
  50. Command/path to <code>ranlib(1)</code>.<br />
  51. Usually not needed anymore due to modern <code>ar(1)</code> implementations maintaining their index.
  52. </dd>
  53. <!-- Linux Kernel -->
  54. <dt><var>CROSS_COMPILE</var></dt>
  55. <dd>
  56. Command prefix before default values of target-specific commands like <var>CC</var>, <var>AR</var>, <var>FC</var>, <var>RANLIB</var>, …<br />
  57. For example it can be set to <samp><code>CROSS_COMPILE=x86_64-pc-linux-musl-</code></samp>
  58. </dd>
  59. <!-- Linux Kernel, onetrueawk, ... -->
  60. <dt><var>HOSTCC</var></dt>
  61. <dd>Command/path to build host C Compiler</dd>
  62. <dt><var>HOSTCCFLAGS</var></dt>
  63. <dd>Flags passed to build host C Compiler</dd>
  64. <!-- Linux Kernel -->
  65. <dt><var>CXX</var></dt>
  66. <dd>Command/path to target C++ Compiler</dd>
  67. <dt><var>HOSTCXX</var></dt>
  68. <dd>Command/path to build host C++ Compiler</dd>
  69. <dt><var>HOSTCXXFLAGS</var></dt>
  70. <dd>Flags passed to build host C++ Compiler</dd>
  71. <!-- mksh, own projects -->
  72. <dt><var>LDSTATIC</var></dt>
  73. <dd>
  74. Flag(s) to enable static linking passed to target compiler when building executables.<br />
  75. For example <samp><code>LDSTATIC=-static</code></samp>
  76. </dd>
  77. <!-- pretty much all makefiles -->
  78. <dt><var>PREFIX</var></dt>
  79. <dd>Common prefix for installation directories, typically defaulting to <code>/usr/local</code></dd>
  80. <dt><var>BINDIR</var></dt>
  81. <dd>Installation directory for executables, typically defaulting to <code>${PREFIX}/bin</code></dd>
  82. <dt><var>MANDIR</var></dt>
  83. <dd>Installation directory for manpages, typically defaulting to <code>${PREFIX}/share/man</code></dd>
  84. <!-- pretty much all makefiles -->
  85. <dt><var>DESTDIR</var></dt>
  86. <dd>
  87. Sets the destination directory for installation into a different root,
  88. for example a temporary installation directory later copied into
  89. a distro package or the <code>/</code>
  90. </dd>
  91. </dl>
  92. </main>
  93. <!--#include file="/templates/en/footer.shtml" -->
  94. </body>
  95. </html>