logo

blog

My website can't be that messy, right? git clone https://anongit.hacktivis.me/git/blog.git/
commit: c49039afc0317bcc24d84d6f1f9fadb3cc68363b
parent 04f3668970670a55917097e625df98cf311aced1
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Fri, 26 Dec 2025 07:54:22 +0100

notes/buildsystems-conventions.shtml: add

Diffstat:

Anotes/buildsystems-conventions.shtml107+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 107 insertions(+), 0 deletions(-)

diff --git a/notes/buildsystems-conventions.shtml b/notes/buildsystems-conventions.shtml @@ -0,0 +1,107 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> +<!--#include file="/templates/head.shtml" --> + <title>Buildsystems Conventions — lanodan’s cyber-home</title> + </head> + <body> +<!--#include file="/templates/en/nav.shtml" --> + <main class="section-count"> + <h1>Buildsystems Conventions</h1> + <p> + This only contains the common bits accross buildsystems, not the ones specific to a particular buildsystem or particular project. + </p> + + <h2>Environment variables</h2> + <h3>POSIX</h3> + <dl> + <dt><var>CC</var></dt> + <dd>Command/path to target C Compiler</dd> + <dt><var>CFLAGS</var></dt> + <dd> + Flags passed to target C Compiler.<br /> + Should not be expected to contain values such as <code>-std=c99</code>. + </dd> + <dt><var>LDFLAGS</var></dt> + <dd>Linking flags passed to target Compiler</dd> + + <dt><var>YACC</var></dt> + <dd>Command/path to <code>yacc(1)</code></dd> + <dt><var>YFLAGS</var></dt> + <dd>Flags passed to <code>yacc(1)</code></dd> + + <dt><var>LEX</var></dt> + <dd>Command/path to <code>lex(1)</code></dd> + <dt><var>LFLAGS</var></dt> + <dd>Flags passed to <code>lex(1)</code></dd> + + <dt><var>AR</var></dt> + <dd>Command/path to <code>ar(1)</code></dd> + <dt><var>ARFLAGS</var></dt> + <dd> + Flags passed to <code>ar(1)</code>.<br /> + Default for <code>make(1)</code> specified as <code>-rv</code> by POSIX.1-2008. + </dd> + + <dt><var>FC</var></dt> + <dd>Command/path to target Fortran Compiler</dd> + <dt><var>FFLAGS</var></dt> + <dd>Flags passed to target Fortran Compiler</dd> + </dl> + + <h3>Widespread but nor formally specified</h3> + <dl> + <dt><var>RANLIB</var></dt> + <dd> + Command/path to <code>ranlib(1)</code>.<br /> + Usually not needed anymore due to modern <code>ar(1)</code> implementations maintaining their index. + </dd> + + <!-- Linux Kernel --> + <dt><var>CROSS_COMPILE</var></dt> + <dd> + Command prefix before default values of target-specific commands like <var>CC</var>, <var>AR</var>, <var>FC</var>, <var>RANLIB</var>, …<br /> + For example it can be set to <samp><code>CROSS_COMPILE=x86_64-pc-linux-musl-</code></samp> + </dd> + + <!-- Linux Kernel, onetrueawk, ... --> + <dt><var>HOSTCC</var></dt> + <dd>Command/path to build host C Compiler</dd> + <dt><var>HOSTCCFLAGS</var></dt> + <dd>Flags passed to build host C Compiler</dd> + + <!-- Linux Kernel --> + <dt><var>CXX</var></dt> + <dd>Command/path to target C++ Compiler</dd> + <dt><var>HOSTCXX</var></dt> + <dd>Command/path to build host C++ Compiler</dd> + <dt><var>HOSTCXXFLAGS</var></dt> + <dd>Flags passed to build host C++ Compiler</dd> + + <!-- mksh, own projects --> + <dt><var>LDSTATIC</var></dt> + <dd> + Flag(s) to enable static linking passed to target compiler when building executables.<br /> + For example <samp><code>LDSTATIC=-static</code></samp> + </dd> + + <!-- pretty much all makefiles --> + <dt><var>PREFIX</var></dt> + <dd>Common prefix for installation directories, typically defaulting to <code>/usr/local</code></dd> + <dt><var>BINDIR</var></dt> + <dd>Installation directory for executables, typically defaulting to <code>${PREFIX}/bin</code></dd> + <dt><var>MANDIR</var></dt> + <dd>Installation directory for manpages, typically defaulting to <code>${PREFIX}/share/man</code></dd> + + <!-- pretty much all makefiles --> + <dt><var>DESTDIR</var></dt> + <dd> + Sets the destination directory for installation into a different root, + for example a temporary installation directory later copied into + a distro package or the <code>/</code> + </dd> + </dl> + </main> +<!--#include file="/templates/en/footer.shtml" --> + </body> +</html>