diff options
| author | Craig Jennings <c@cjennings.net> | 2025-08-14 22:58:58 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2025-08-14 22:58:58 -0500 |
| commit | 82ba818ff456bcd6d56a06226e3f27e98fbb55c3 (patch) | |
| tree | 158cfc17b2f644a10f063cb546752cfaae12c97f /devdocs/gnu_make/load-directive.html | |
| parent | 9278ddd4ea1a8b1a4c1edaa8894516e3f48d245b (diff) | |
| download | dotemacs-82ba818ff456bcd6d56a06226e3f27e98fbb55c3.tar.gz dotemacs-82ba818ff456bcd6d56a06226e3f27e98fbb55c3.zip | |
removing all downloaded devdocs files
Diffstat (limited to 'devdocs/gnu_make/load-directive.html')
| -rw-r--r-- | devdocs/gnu_make/load-directive.html | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/devdocs/gnu_make/load-directive.html b/devdocs/gnu_make/load-directive.html deleted file mode 100644 index fedce503..00000000 --- a/devdocs/gnu_make/load-directive.html +++ /dev/null @@ -1,14 +0,0 @@ - <h1 class="subsection">The load Directive</h1> <p>Objects are loaded into GNU <code>make</code> by placing the <code>load</code> directive into your makefile. The syntax of the <code>load</code> directive is as follows: </p> <div class="example"> <pre class="example">load <var>object-file</var> … -</pre> -</div> <p>or: </p> <div class="example"> <pre class="example">load <var>object-file</var>(<var>symbol-name</var>) … -</pre> -</div> <p>The file <var>object-file</var> is dynamically loaded by GNU <code>make</code>. If <var>object-file</var> does not include a directory path then it is first looked for in the current directory. If it is not found there, or a directory path is included, then system-specific paths will be searched. If the load fails for any reason, <code>make</code> will print a message and exit. </p> <p>If the load succeeds <code>make</code> will invoke an initializing function. </p> <p>If <var>symbol-name</var> is provided, it will be used as the name of the initializing function. </p> <p>If no <var>symbol-name</var> is provided, the initializing function name is created by taking the base file name of <var>object-file</var>, up to the first character which is not a valid symbol name character (alphanumerics and underscores are valid symbol name characters). To this prefix will be appended the suffix <code>_gmk_setup</code>. </p> <p>More than one object file may be loaded with a single <code>load</code> directive, and both forms of <code>load</code> arguments may be used in the same directive. </p> <p>The initializing function will be provided the file name and line number of the invocation of the <code>load</code> operation. It should return a value of type <code>int</code>, which must be <code>0</code> on failure and non-<code>0</code> on success. If the return value is <code>-1</code>, then GNU make will <em>not</em> attempt to rebuild the object file (see <a href="remaking-loaded-objects">How Loaded Objects Are Remade</a>). </p> <p>For example: </p> <div class="example"> <pre class="example">load ../mk_funcs.so -</pre> -</div> <p>will load the dynamic object <samp>../mk_funcs.so</samp>. After the object is loaded, <code>make</code> will invoke the function (assumed to be defined by the shared object) <code>mk_funcs_gmk_setup</code>. </p> <p>On the other hand: </p> <div class="example"> <pre class="example">load ../mk_funcs.so(init_mk_func) -</pre> -</div> <p>will load the dynamic object <samp>../mk_funcs.so</samp>. After the object is loaded, <code>make</code> will invoke the function <code>init_mk_func</code>. </p> <p>Regardless of how many times an object file appears in a <code>load</code> directive, it will only be loaded (and its setup function will only be invoked) once. </p> <p>After an object has been successfully loaded, its file name is appended to the <code>.LOADED</code> variable. </p> <p>If you would prefer that failure to load a dynamic object not be reported as an error, you can use the <code>-load</code> directive instead of <code>load</code>. GNU <code>make</code> will not fail and no message will be generated if an object fails to load. The failed object is not added to the <code>.LOADED</code> variable, which can then be consulted to determine if the load was successful. </p><div class="_attribution"> - <p class="_attribution-p"> - Copyright © 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 Free Software Foundation, Inc. <br>Licensed under the GNU Free Documentation License.<br> - <a href="https://www.gnu.org/software/make/manual/html_node/load-Directive.html" class="_attribution-link">https://www.gnu.org/software/make/manual/html_node/load-Directive.html</a> - </p> -</div> |
