Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I made a half-hearted attempt at my previous job at making the build system (based on GNU make) completely non-recursive, but I ran into a number of problems:</p> <ul> <li>The artifacts (i.e. libraries and executables built) had their sources spread out over a number of directories, relying on vpath to find them</li> <li>Several source files with the same name existed in different directories</li> <li>Several source files were shared between artifacts, often compiled with different compiler flags</li> <li>Different artifacts often had different compiler flags, optimization settings, etc.</li> </ul> <p>One feature of GNU make which simplifies non-recursive use is <strong>target-specific variable values</strong>:</p> <pre><code>foo: FOO=banana bar: FOO=orange </code></pre> <p>This means that when building target "foo", $(FOO) will expand to "banana", but when building target "bar", $(FOO) will expand to "orange".</p> <p>One limitation of this is that it is not possible to have target-specific VPATH definitions, i.e. there is no way to uniquely define VPATH individually for each target. This was necessary in our case in order to find the correct source files.</p> <p>The main missing feature of GNU make needed in order to support non-recursiveness is that it lacks <strong>namespaces</strong>. Target-specific variables can in a limited manner be used to "simulate" namespaces, but what you really would need is to be able to include a Makefile in a sub-directory using a local scope.</p> <p>EDIT: Another very useful (and often under-used) feature of GNU make in this context is the macro-expansion facilities (see the <a href="http://www.gnu.org/software/make/manual/html_node/Eval-Function.html#Eval-Function" rel="noreferrer">eval</a> function, for example). This is very useful when you have several targets which have similar rules/goals, but differ in ways which cannot be expressed using regular GNU make syntax.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload