1
0
Fork 0
cl-sites/asdf.common-lisp.dev/asdf/I-want-to-put-my-module_0027s-files-at-the-top-level_002e-How-do-I-do-this_003f.html
2023-11-12 11:34:18 +01:00

154 lines
8.4 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.8, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- This manual describes ASDF, a system definition facility
for Common Lisp programs and libraries.
You can find the latest version of this manual at
https://common-lisp.net/project/asdf/asdf.html.
ASDF Copyright (C) 2001-2019 Daniel Barlow and contributors.
This manual Copyright (C) 2001-2019 Daniel Barlow and contributors.
This manual revised (C) 2009-2019 Robert P. Goldman and Francois-Rene Rideau.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-->
<title>I want to put my module's files at the top level. How do I do this? (ASDF Manual)</title>
<meta name="description" content="I want to put my module's files at the top level. How do I do this? (ASDF Manual)">
<meta name="keywords" content="I want to put my module's files at the top level. How do I do this? (ASDF Manual)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link href="index.html" rel="start" title="Top">
<link href="Concept-Index.html" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Issues-with-using-and-extending-ASDF-to-define-systems.html" rel="up" title="Issues with using and extending ASDF to define systems">
<link href="How-do-I-create-a-system-definition-where-all-the-source-files-have-a-_002ecl-extension_003f.html" rel="next" title="How do I create a system definition where all the source files have a .cl extension?">
<link href="How-can-I-maintain-non_002dLisp-_0028e_002eg_002e-C_0029-source-files_003f.html" rel="prev" title="How can I maintain non-Lisp (e.g. C) source files?">
<style type="text/css">
<!--
a.copiable-anchor {visibility: hidden; text-decoration: none; line-height: 0em}
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
span:hover a.copiable-anchor {visibility: visible}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en">
<div class="subsection" id="I-want-to-put-my-module_0027s-files-at-the-top-level_002e-How-do-I-do-this_003f">
<div class="header">
<p>
Next: <a href="How-do-I-create-a-system-definition-where-all-the-source-files-have-a-_002ecl-extension_003f.html" accesskey="n" rel="next">How do I create a system definition where all the source files have a .cl extension?</a>, Previous: <a href="How-can-I-maintain-non_002dLisp-_0028e_002eg_002e-C_0029-source-files_003f.html" accesskey="p" rel="prev">&ldquo;How can I maintain non-Lisp (e.g. C) source files?&rdquo;</a>, Up: <a href="Issues-with-using-and-extending-ASDF-to-define-systems.html" accesskey="u" rel="up">Issues with using and extending ASDF to define systems</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<span id="g_t_0060_0060I-want-to-put-my-module_0027s-files-at-the-top-level_002e-How-do-I-do-this_003f_0027_0027"></span><h4 class="subsection">13.6.4 &ldquo;I want to put my module&rsquo;s files at the top level. How do I do this?&rdquo;</h4>
<p>By default, the files contained in an asdf module go
in a subdirectory with the same name as the module.
However, this can be overridden by adding a <code>:pathname &quot;&quot;</code> argument
to the module description.
For example, here is how it could be done
in the spatial-trees ASDF system definition for ASDF 2 or later:
</p>
<div class="example">
<pre class="example">(asdf:defsystem &quot;spatial-trees&quot;
:components
((:module &quot;base&quot;
:pathname &quot;&quot;
:components
((:file &quot;package&quot;)
(:file &quot;basedefs&quot; :depends-on (&quot;package&quot;))
(:file &quot;rectangles&quot; :depends-on (&quot;package&quot;))))
(:module tree-impls
:depends-on (&quot;base&quot;)
:pathname &quot;&quot;
:components
((:file &quot;r-trees&quot;)
(:file &quot;greene-trees&quot; :depends-on (&quot;r-trees&quot;))
(:file &quot;rstar-trees&quot; :depends-on (&quot;r-trees&quot;))
(:file &quot;rplus-trees&quot; :depends-on (&quot;r-trees&quot;))
(:file &quot;x-trees&quot; :depends-on (&quot;r-trees&quot; &quot;rstar-trees&quot;))))
(:module viz
:depends-on (&quot;base&quot;)
:pathname &quot;&quot;
:components
((:static-file &quot;spatial-tree-viz.lisp&quot;)))
(:module tests
:depends-on (&quot;base&quot;)
:pathname &quot;&quot;
:components
((:static-file &quot;spatial-tree-test.lisp&quot;)))
(:static-file &quot;LICENCE&quot;)
(:static-file &quot;TODO&quot;)))
</pre></div>
<p>All of the files in the <code>tree-impls</code> module are at the top level,
instead of in a <samp>tree-impls/</samp> subdirectory.
</p>
<p>Note that the argument to <code>:pathname</code> can be either a pathname object or a string.
A pathname object can be constructed with the <samp>#p&quot;foo/bar/&quot;</samp> syntax,
but this is discouraged because the results of parsing a namestring are not portable.
A pathname can only be portably constructed with such syntax as
<code>#.(make-pathname :directory '(:relative &quot;foo&quot; &quot;bar&quot;))</code>,
and similarly the current directory can only be portably specified as
<code>#.(make-pathname :directory '(:relative))</code>.
However, as of ASDF 2, you can portably use a string to denote a pathname.
The string will be parsed as a <code>/</code>-separated path from the current directory,
such that the empty string <code>&quot;&quot;</code> denotes the current directory, and
<code>&quot;foo/bar&quot;</code> (no trailing <code>/</code> required in the case of modules)
portably denotes the same subdirectory as above.
When files are specified, the last <code>/</code>-separated component is interpreted
either as the name component of a pathname
(if the component class specifies a pathname type),
or as a name component plus optional dot-separated type component
(if the component class doesn&rsquo;t specifies a pathname type).
</p>
</div>
<hr>
<div class="header">
<p>
Next: <a href="How-do-I-create-a-system-definition-where-all-the-source-files-have-a-_002ecl-extension_003f.html">How do I create a system definition where all the source files have a .cl extension?</a>, Previous: <a href="How-can-I-maintain-non_002dLisp-_0028e_002eg_002e-C_0029-source-files_003f.html">&ldquo;How can I maintain non-Lisp (e.g. C) source files?&rdquo;</a>, Up: <a href="Issues-with-using-and-extending-ASDF-to-define-systems.html">Issues with using and extending ASDF to define systems</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>