~ubuntu-branches/ubuntu/vivid/cl-asdf/vivid

« back to all changes in this revision

Viewing changes to asdf.texinfo

  • Committer: Bazaar Package Importer
  • Author(s): Peter Van Eynde
  • Date: 2009-12-31 08:36:15 UTC
  • mfrom: (1.1.10 upstream) (2.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20091231083615-hmxl8y14zxcb0iq3
New upstream, version 1.374

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
@copying
14
14
This manual describes asdf, a system definition facility for Common
15
15
Lisp programs and libraries.
16
 
     
 
16
 
17
17
asdf Copyright @copyright{} 2001-2007 Daniel Barlow and contributors
18
18
 
19
19
This manual Copyright @copyright{} 2001-2007 Daniel Barlow and
20
20
contributors
 
21
This manual revised @copyright{} 2009 Robert P. Goldman
21
22
 
22
23
Permission is hereby granted, free of charge, to any person obtaining
23
24
a copy of this software and associated documentation files (the
44
45
 
45
46
@titlepage
46
47
@title asdf: another system definition facility
47
 
     
 
48
 
48
49
@c The following two commands start the copyright page.
49
50
@page
50
51
@vskip 0pt plus 1filll
51
52
@insertcopying
52
53
@end titlepage
53
 
     
 
54
 
54
55
@c Output the table of contents at the beginning.
55
56
@contents
56
57
 
58
59
 
59
60
@ifnottex
60
61
 
61
 
@node Top, Using asdf to load systems, (dir), (dir)
 
62
@node Top, Introduction, (dir), (dir)
62
63
@top asdf: another system definition facility
63
 
     
 
64
 
64
65
@insertcopying
65
66
 
66
67
@menu
67
 
* Using asdf to load systems::  
68
 
* Defining systems with defsystem::  
69
 
* The object model of asdf::    
70
 
* Error handling::              
71
 
* Compilation error and warning handling::  
 
68
* Introduction::
 
69
* Using asdf to load systems::
 
70
* Defining systems with defsystem::
 
71
* The object model of asdf::
 
72
* Controlling where ASDF saves compiled files::
 
73
* Error handling::
 
74
* Compilation error and warning handling::
72
75
* Miscellaneous additional functionality::
73
 
* Getting the latest version::  
74
 
* TODO list::                   
75
 
* missing bits in implementation::  
76
 
* Inspiration::                 
77
 
* Concept Index::               
78
 
* Function and Class Index::    
79
 
* Variable Index::              
 
76
* Getting the latest version::
 
77
* TODO list::
 
78
* missing bits in implementation::
 
79
* Inspiration::
 
80
* Concept Index::
 
81
* Function and Class Index::
 
82
* Variable Index::
80
83
 
81
84
@detailmenu
82
85
 --- The Detailed Node Listing ---
83
86
 
 
87
Using ASDF
 
88
 
 
89
@c * Installing ASDF::
 
90
 
84
91
Defining systems with defsystem
85
92
 
86
 
* The defsystem form::          
87
 
* A more involved example::     
88
 
* The defsystem grammar::       
 
93
* The defsystem form::
 
94
* A more involved example::
 
95
* The defsystem grammar::
 
96
* Other code in .asd files::
89
97
 
90
98
The object model of asdf
91
99
 
92
 
* Operations::                  
93
 
* Components::                  
 
100
* Operations::
 
101
* Components::
94
102
 
95
103
Operations
96
104
 
97
 
* Predefined operations of asdf::  
98
 
* Creating new operations::     
 
105
* Predefined operations of asdf::
 
106
* Creating new operations::
99
107
 
100
108
Components
101
109
 
102
 
* Common attributes of components::  
103
 
* Pre-defined subclasses of component::  
104
 
* Creating new component types::  
 
110
* Common attributes of components::
 
111
* Pre-defined subclasses of component::
 
112
* Creating new component types::
105
113
 
106
114
properties
107
115
 
108
 
* Pre-defined subclasses of component::  
109
 
* Creating new component types::  
 
116
* Pre-defined subclasses of component::
 
117
* Creating new component types::
110
118
 
111
119
@end detailmenu
112
120
@end menu
115
123
 
116
124
@c -------------------
117
125
 
118
 
 
119
 
@node  Using asdf to load systems, Defining systems with defsystem, Top, Top
120
 
@comment  node-name,  next,  previous,  up
121
 
@chapter Using asdf to load systems
 
126
@node Introduction, Using asdf to load systems, Top, Top
 
127
@comment  node-name,  next,  previous,  up
 
128
@chapter Introduction
 
129
 
 
130
ASDF is Another System Definition Facility: a tool for describing the
 
131
sub-systems and files that comprise a system and for operating on these
 
132
components in the right order so that they can be compiled, loaded,
 
133
tested, etc.
 
134
 
 
135
ASDF presents two faces: one for system implementors who need to be able
 
136
to describe their systems and one for Lisp programmers who want to use
 
137
those systems. @xref{Using asdf to load systems,the getting started guide}, to learn how to use ASDF to
 
138
load a system. @xref{Defining systems with defsystem}, to learn how to
 
139
define a system of your own.  Later chapters describe the ASDF internals
 
140
and how to extend ASDF.
 
141
 
 
142
 
 
143
@node  Using asdf to load systems, Defining systems with defsystem, Introduction, Top
 
144
@comment  node-name,  next,  previous,  up
 
145
@chapter Using ASDF
 
146
@vindex *central-registry*
 
147
@cindex link farm
 
148
@findex load-system
 
149
@findex compile-system
 
150
@findex test-system
122
151
@cindex system directory designator
123
 
@vindex *central-registry*
124
 
 
125
 
This chapter describes how to use asdf to compile and load ready-made
126
 
Lisp programs and libraries.
127
 
 
128
 
@section Downloading asdf
129
 
 
130
 
Some Lisp implementations (such as SBCL and OpenMCL) come with asdf
131
 
included already, so you don't need to download it separately.
132
 
Consult your Lisp system's documentation.  If you need to download
133
 
asdf and install it by hand, the canonical source is the cCLan CVS
134
 
repository at
135
 
@url{http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/cclan/asdf/}.
136
 
 
137
 
@section Setting up asdf
 
152
@findex operate
 
153
@findex oos
 
154
 
 
155
@c @menu
 
156
@c * Installing ASDF::
 
157
@c @end menu
 
158
 
 
159
@section Installing ASDF
 
160
 
 
161
Many Lisp implementations include a copy of ASDF. You can
 
162
usually load this copy using Common-Lisp's @code{require}
 
163
function:
 
164
 
 
165
@kbd{(require 'asdf)}
 
166
 
 
167
Consult your Lisp implementation's documentation for details. If ASDF
 
168
doesn't come bundled with your Lisp or if you want to make
 
169
sure that you have the most recent version, then you'll want
 
170
to download it from the
 
171
@url{http://common-lisp.net/project/asdf/,asdf-home} website.
 
172
 
 
173
Note to SBCL users:  you are cautioned that installing ASDF yourself may
 
174
break some SBCL contribs.  We are working to provide instructions for
 
175
doing this safely.
 
176
 
 
177
If you want to get the latest and greatest version of ASDF from its VCS
 
178
repository, @xref{Getting the latest version}.
 
179
 
 
180
@section Loading ASDF
 
181
 
 
182
If your CL implementation does @emph{not} provide ASDF through the
 
183
@code{require} feature, then you need to download ASDF and load it
 
184
yourself.
138
185
 
139
186
The single file @file{asdf.lisp} is all you need to use asdf normally.
140
187
Once you load it in a running Lisp, you're ready to use asdf.  For
143
190
startup script or dumping a custom core -- check your Lisp
144
191
implementation's manual for details.
145
192
 
 
193
@section Setting up a system to be loaded
 
194
 
 
195
To compile and load a system, you need to ensure that its
 
196
system definition can be found in one of the directories in
 
197
@code{*central-registry*}@footnote{It is possible to customize the
 
198
system definition file search.  That's considered advanced use, and
 
199
covered later: search forward for
 
200
@code{*system-definition-search-functions*}.  @xref{Defining systems
 
201
with defsystem}.}.
 
202
 
 
203
There are two ways that you can make a system definition findable
 
204
through @code{*central-registry*}.  One is to simply insert into
 
205
@code{*central-registry*} an entry that specifies the pathname of for
 
206
the directory containing the system definition file (a file whose name
 
207
is of the form @code{*.asd}).
 
208
For example, if we had a
 
209
system @var{foo} that is stored in a directory
 
210
@file{/home/me/src/foo/}, containing  @file{/home/me/src/foo/}, we could
 
211
make the foo system asdf-operable by doing @kbd{(push
 
212
"/home/me/src/foo/" asdf:*central-registry*)}.
 
213
 
 
214
ASDF will also properly handle the case where the
 
215
@code{*central-registry*} points to a directory containing a
 
216
@emph{symbolic link} to the system definition file.
 
217
 
 
218
For example, if @code{#p"/home/me/cl/systems/"} (note the trailing
 
219
slash) is a member of @code{*central-registry*}, you could set up the
 
220
system @var{foo} for loading with asdf with the following
 
221
commands at the shell:
 
222
 
 
223
@example
 
224
$ cd /home/me/cl/systems/
 
225
$ ln -s ~/src/foo/foo.asd .
 
226
@end example
 
227
 
 
228
Previous versions of the ASDF manual suggested that users create a
 
229
directory in their @code{*central-registry*} that would act as a ``link
 
230
farm.''  However, this method may cause problems if you work on multiple
 
231
lisp projects that contain different mixes of ASDF libraries.
 
232
 
146
233
The variable @code{asdf:*central-registry*} is a list of ``system
147
234
directory designators''@footnote{When we say ``directory'' here, we
148
235
mean ``designator for a pathname with a supplied DIRECTORY
159
246
         asdf:*central-registry*))
160
247
@end lisp
161
248
 
162
 
@section Setting up a system to be loaded
163
 
 
164
 
To compile and load a system, you need to ensure that a symbolic link to its
165
 
system definition is in one of the directories in
166
 
@code{*central-registry*}@footnote{It is possible to customize the
167
 
system definition file search.  That's considered advanced use, and
168
 
covered later: search forward for
169
 
@code{*system-definition-search-functions*}.  @xref{Defining systems
170
 
with defsystem}.}.
171
 
 
172
 
For example, if @code{#p"/home/me/cl/systems/"} (note the trailing
173
 
slash) is a member of @code{*central-registry*}, you would set up a
174
 
system @var{foo} that is stored in a directory
175
 
@file{/home/me/src/foo/} for loading with asdf with the following
176
 
commands at the shell (this has to be done only once):
177
 
 
178
 
@example
179
 
$ cd /home/me/cl/systems/
180
 
$ ln -s ~/src/foo/foo.asd .
181
 
@end example
182
 
 
183
249
@section Loading a system
184
250
 
 
251
@c{FIXME:  Add Gary's material about loading system definitions by hand.}
 
252
@c{FIXME:  Introduce ASDF-binary-locations.}
 
253
 
185
254
The system @var{foo} is loaded (and compiled, if necessary) by
186
255
evaluating the following form in your Lisp implementation:
187
256
 
188
257
@example
189
 
(asdf:operate 'asdf:load-op '@var{foo})
 
258
(asdf:load-system '@var{foo})
190
259
@end example
191
260
 
 
261
(In older versions of ASDF, you may need to use @code{(asdf:oos
 
262
'asdf:load-op 'foo)}, instead.)
 
263
 
192
264
Output from asdf and asdf extensions are supposed to be sent to the CL
193
265
stream @code{*standard-output*}, and so rebinding that stream around
194
266
calls to @code{asdf:operate} should redirect all output from asdf
195
267
operations.
196
268
 
 
269
ASDF provides three commands for the most common system
 
270
operations: @code{load-system}, @code{compile-system} or @code{test-system}.
 
271
 
 
272
Because ASDF is an extensible system for defining
 
273
@emph{operations} on @emph{components} also provides a generic
 
274
function: @code{operate} (which is usually abbreviated by
 
275
@code{oos}). You'll use @code{oos} whenever you want to do something
 
276
beyond compiling, loading and testing.
 
277
 
 
278
Reminder: before ASDF can operate on a system, however, it must be able
 
279
to find and load that system's definition.
 
280
 
 
281
@section Placement of compiled files
 
282
 
 
283
By default, ASDF will place the compiled files it creates in the same
 
284
directory as the source files.  This works for most simple use cases.
 
285
However, if you use multiple Common Lisp implementations, or for some
 
286
other reason need to place your compiled files elsewhere, you will want
 
287
to enable ASDF-BINARY-LOCATIONS.  @xref{Controlling where ASDF saves
 
288
compiled files}.
 
289
 
 
290
@section Summary
 
291
 
 
292
To use ASDF:
 
293
 
 
294
@itemize
 
295
@item
 
296
load @file{asdf.lisp} into your Lisp image, either through
 
297
@code{require} or @code{load}.
 
298
 
 
299
@item
 
300
make sure ASDF can find system definitions by loading them
 
301
yourself or setting up @code{*central-registry*}.
 
302
 
 
303
@item
 
304
use @code{operate} (or shorthand @code{oos})
 
305
to tell ASDF what you'd like to do to what systems.
 
306
For simple operations, you can use @code{load-system}, @code{compile-system} or @code{test-system}
 
307
instead.
 
308
 
 
309
@end itemize
 
310
 
 
311
@section Moving on
 
312
 
197
313
That's all you need to know to use asdf to load systems written by
198
314
others.  The rest of this manual deals with writing system
199
 
definitions for Lisp software you write yourself.
 
315
definitions for Lisp software you write yourself, including how to
 
316
extend ASDF to define new operation and component types.
200
317
 
201
318
@node   Defining systems with defsystem, The object model of asdf, Using asdf to load systems, Top
202
319
@comment  node-name,  next,  previous,  up
207
324
 
208
325
 
209
326
@menu
210
 
* The defsystem form::          
211
 
* A more involved example::     
212
 
* The defsystem grammar::       
 
327
* The defsystem form::
 
328
* A more involved example::
 
329
* The defsystem grammar::
213
330
* Other code in .asd files::
214
331
@end menu
215
332
 
254
371
will use for the application code.
255
372
 
256
373
This is not absolutely required by asdf, but helps avoid namespace
257
 
pollution and so is considered good form. 
 
374
pollution and so is considered good form.
258
375
 
259
376
@item
260
377
The defsystem form defines a system named "hello-lisp" that contains
289
406
@lisp
290
407
(defsystem "foo"
291
408
  :version "1.0"
292
 
  :components ((:module "foo" :components ((:file "bar") (:file"baz") 
 
409
  :components ((:module "foo" :components ((:file "bar") (:file"baz")
293
410
                                           (:file "quux"))
294
 
                :perform (compile-op :after (op c)
295
 
                          (do-something c))
296
 
                :explain (compile-op :after (op c)
297
 
                          (explain-something c)))
 
411
                :perform (compile-op :after (op c)
 
412
                          (do-something c))
 
413
                :explain (compile-op :after (op c)
 
414
                          (explain-something c)))
298
415
               (:file "blah")))
299
416
@end lisp
300
417
 
301
418
The method-form tokens need explaining: essentially, this part:
302
419
 
303
420
@lisp
304
 
                :perform (compile-op :after (op c)
305
 
                          (do-something c))
306
 
                :explain (compile-op :after (op c)
307
 
                          (explain-something c))
 
421
                :perform (compile-op :after (op c)
 
422
                          (do-something c))
 
423
                :explain (compile-op :after (op c)
 
424
                          (explain-something c))
308
425
@end lisp
309
426
 
310
427
has the effect of
311
428
 
312
429
@lisp
313
430
(defmethod perform :after ((op compile-op) (c (eql ...)))
314
 
           (do-something c))
 
431
           (do-something c))
315
432
(defmethod explain :after ((op compile-op) (c (eql ...)))
316
 
           (explain-something c))
 
433
           (explain-something c))
317
434
@end lisp
318
435
 
319
436
where @code{...} is the component in question; note that although this
323
440
have been processed, but before the component in question has been
324
441
compiled.
325
442
 
326
 
@node  The defsystem grammar,  Other code in .asd files, A more involved example, Defining systems with defsystem
 
443
@node  The defsystem grammar, Other code in .asd files, A more involved example, Defining systems with defsystem
327
444
@comment  node-name,  next,  previous,  up
328
445
@section The defsystem grammar
329
446
 
333
450
option := :components component-list
334
451
        | :pathname pathname
335
452
        | :default-component-class
336
 
        | :perform method-form 
 
453
        | :perform method-form
337
454
        | :explain method-form
338
 
        | :output-files  method-form
 
455
        | :output-files  method-form
339
456
        | :operation-done-p method-form
340
 
        | :depends-on ( {dependency-def}* ) 
341
 
        | :serial [ t | nil ]
 
457
        | :depends-on ( {dependency-def}* )
 
458
        | :serial [ t | nil ]
342
459
        | :in-order-to ( {dependency}+ )
343
460
 
344
461
component-list := ( {component-def}* )
345
 
                
 
462
 
346
463
component-def  := simple-component-name
347
464
                | ( component-type name {option}* )
348
465
 
360
477
 
361
478
simple-component-name := string
362
479
                      |  symbol
 
480
 
 
481
method-form := (operation-name qual lambda-list &rest body)
 
482
qual := method qualifier
363
483
@end verbatim
364
484
 
365
485
@subsection Serial dependencies
376
496
is equivalent to
377
497
 
378
498
@lisp
379
 
:components ((:file "a") 
380
 
             (:file "b" :depends-on ("a"))
381
 
             (:file "c" :depends-on ("a" "b")))
 
499
:components ((:file "a")
 
500
             (:file "b" :depends-on ("a"))
 
501
             (:file "c" :depends-on ("a" "b")))
382
502
@end lisp
383
503
 
384
504
 
423
543
within an editor without clobbering its source location)
424
544
@end itemize
425
545
 
426
 
@node Other code in .asd files, , The defsystem grammar, Defining systems with defsystem
 
546
@node Other code in .asd files,  , The defsystem grammar, Defining systems with defsystem
427
547
@section Other code in .asd files
428
548
 
429
549
Files containing defsystem forms are regular Lisp files that are
442
562
@end itemize
443
563
 
444
564
 
445
 
@node The object model of asdf, Error handling, Defining systems with defsystem, Top
 
565
@node The object model of asdf, Controlling where ASDF saves compiled files, Defining systems with defsystem, Top
446
566
@comment  node-name,  next,  previous,  up
447
567
@chapter The object model of asdf
448
568
 
461
581
 
462
582
 
463
583
@menu
464
 
* Operations::                  
465
 
* Components::                  
 
584
* Operations::
 
585
* Components::
466
586
@end menu
467
587
 
468
588
@node  Operations, Components, The object model of asdf, The object model of asdf
508
628
@end deffn
509
629
 
510
630
@menu
511
 
* Predefined operations of asdf::  
512
 
* Creating new operations::     
 
631
* Predefined operations of asdf::
 
632
* Creating new operations::
513
633
@end menu
514
634
 
515
635
@node Predefined operations of asdf, Creating new operations, Operations, Operations
558
678
operation - at least, where meaningful.
559
679
@end deffn
560
680
 
561
 
@deffn Operation test-system-version &key minimum
562
 
 
563
 
Asks the system whether it satisfies a version requirement.
564
 
 
565
 
The default method accepts a string, which is expected to contain of a
566
 
number of integers separated by #\. characters.  The method is not
567
 
recursive.  The component satisfies the version dependency if it has
568
 
the same major number as required and each of its sub-versions is
569
 
greater than or equal to the sub-version number required.
570
 
 
571
 
@lisp
572
 
(defun version-satisfies (x y)
573
 
  (labels ((bigger (x y)
574
 
             (cond ((not y) t)
575
 
                   ((not x) nil)
576
 
                   ((> (car x) (car y)) t)
577
 
                   ((= (car x) (car y))
578
 
                    (bigger (cdr x) (cdr y))))))
579
 
    (and (= (car x) (car y))
580
 
         (or (not (cdr y)) (bigger (cdr x) (cdr y))))))
581
 
@end lisp
582
 
 
583
 
If that doesn't work for your system, you can override it.  I hope
584
 
you have as much fun writing the new method as @verb{|#lisp|} did
585
 
reimplementing this one.
586
 
@end deffn
587
 
 
588
 
@deffn Operation feature-dependent-op
589
 
 
590
 
An instance of @code{feature-dependent-op} will ignore any components
591
 
which have a @code{features} attribute, unless the feature combination
592
 
it designates is satisfied by @code{*features*}.  This operation is
593
 
not intended to be instantiated directly, but other operations may
594
 
inherit from it.
595
 
 
596
 
@end deffn
 
681
@deffn Operation test-op
 
682
 
 
683
This operation will perform some tests on the module.  The default
 
684
method will do nothing.  The default dependency is to require
 
685
@code{load-op} to be performed on the module first.  The default
 
686
@code{operation-done-p} is that the operation is @emph{never} done ---
 
687
we assume that if you invoke the @code{test-op}, you want to test the
 
688
system, even if you have already done so.
 
689
 
 
690
The results of this operation are not defined by ASDF.  It has proven
 
691
difficult to define how the test operation should signal its results to
 
692
the user in a way that is compatible with all of the various test
 
693
libraries and test techniques in use in the community.
 
694
@end deffn
 
695
 
 
696
@c @deffn Operation test-system-version &key minimum
 
697
 
 
698
@c Asks the system whether it satisfies a version requirement.
 
699
 
 
700
@c The default method accepts a string, which is expected to contain of a
 
701
@c number of integers separated by #\. characters.  The method is not
 
702
@c recursive.  The component satisfies the version dependency if it has
 
703
@c the same major number as required and each of its sub-versions is
 
704
@c greater than or equal to the sub-version number required.
 
705
 
 
706
@c @lisp
 
707
@c (defun version-satisfies (x y)
 
708
@c   (labels ((bigger (x y)
 
709
@c           (cond ((not y) t)
 
710
@c                 ((not x) nil)
 
711
@c                 ((> (car x) (car y)) t)
 
712
@c                 ((= (car x) (car y))
 
713
@c                  (bigger (cdr x) (cdr y))))))
 
714
@c     (and (= (car x) (car y))
 
715
@c       (or (not (cdr y)) (bigger (cdr x) (cdr y))))))
 
716
@c @end lisp
 
717
 
 
718
@c If that doesn't work for your system, you can override it.  I hope
 
719
@c you have as much fun writing the new method as @verb{|#lisp|} did
 
720
@c reimplementing this one.
 
721
@c @end deffn
 
722
 
 
723
@c @deffn Operation feature-dependent-op
 
724
 
 
725
@c An instance of @code{feature-dependent-op} will ignore any components
 
726
@c which have a @code{features} attribute, unless the feature combination
 
727
@c it designates is satisfied by @code{*features*}.  This operation is
 
728
@c not intended to be instantiated directly, but other operations may
 
729
@c inherit from it.
 
730
 
 
731
@c @end deffn
597
732
 
598
733
@node  Creating new operations,  , Predefined operations of asdf, Operations
599
734
@comment  node-name,  next,  previous,  up
681
816
 
682
817
 
683
818
@menu
684
 
* Common attributes of components::  
685
 
* Pre-defined subclasses of component::  
686
 
* Creating new component types::  
 
819
* Common attributes of components::
 
820
* Pre-defined subclasses of component::
 
821
* Creating new component types::
687
822
@end menu
688
823
 
689
824
@node  Common attributes of components, Pre-defined subclasses of component, Components, Components
706
841
(Unix, Mac, windows) or silently convert lowercase to uppercase
707
842
(lpns), so this makes more sense than attempting to use @code{:case
708
843
:common} as argument to @code{make-pathname}, which is reported not to
709
 
work on some implementations
 
844
work on some implementations.
710
845
 
711
846
@subsubsection Version identifier
712
847
 
717
852
 
718
853
@subsubsection Required features
719
854
 
 
855
@emph{FIXME:  This subsection seems to contradict the defsystem grammar
 
856
subsection; which doesn't provide any obvious way to specify required
 
857
features.  Furthermore, recent discussion on the asdf-devel mailing list
 
858
suggests that the specification of required features may be broken.}
 
859
 
720
860
Traditionally defsystem users have used reader conditionals to include
721
861
or exclude specific per-implementation files.  This means that any
722
862
single implementation cannot read the entire system, which becomes a
743
883
 
744
884
@lisp
745
885
:in-order-to ((compile-op (load-op "a" "b") (compile-op "c"))
746
 
              (load-op (load-op "foo")))
 
886
              (load-op (load-op "foo")))
747
887
@end lisp
748
888
 
749
889
This means the following things:
780
920
@var{a} @emph{actually} means that
781
921
 
782
922
@verbatim
783
 
  (compile b) depends on (load a) 
 
923
  (compile b) depends on (load a)
784
924
@end verbatim
785
925
 
786
926
This is insufficient for e.g. the McCLIM system, which requires that
799
939
@code{component-depends-on} can be subclassed for more specific
800
940
component/operation types: these need to @code{(call-next-method)} and
801
941
append the answer to their dependency, unless they have a good reason
802
 
for completely overriding the default dependencies
 
942
for completely overriding the default dependencies.
803
943
 
804
 
(If it weren't for CLISP, we'd be using a @code{LIST} method
 
944
If it weren't for CLISP, we'd be using @code{LIST} method
805
945
combination to do this transparently.  But, we need to support CLISP.
806
946
If you have the time for some CLISP hacking, I'm sure they'd welcome
807
 
your fixes)
 
947
your fixes.
808
948
 
809
949
@subsubsection pathname
810
950
 
836
976
the top component in that system.  This is detailed
837
977
elsewhere, @xref{Defining systems with defsystem}.
838
978
 
839
 
The answer to the frequently asked question "how do I create a system 
 
979
The answer to the frequently asked question "how do I create a system
840
980
definition where all the source files have a .cl extension" is thus
841
981
 
842
982
@lisp
861
1001
keywords or something.
862
1002
 
863
1003
@menu
864
 
* Pre-defined subclasses of component::  
865
 
* Creating new component types::  
 
1004
* Pre-defined subclasses of component::
 
1005
* Creating new component types::
866
1006
@end menu
867
1007
 
868
1008
@node Pre-defined subclasses of component, Creating new component types, Common attributes of components, Components
872
1012
@deffn Component source-file
873
1013
 
874
1014
A source file is any file that the system does not know how to
875
 
generate from other components of the system. 
 
1015
generate from other components of the system.
876
1016
 
877
1017
Note that this is not necessarily the same thing as ``a file
878
1018
containing data that is typically fed to a compiler''.  If a file is
981
1121
    )
982
1122
@end lisp
983
1123
 
984
 
@node  Error handling, Compilation error and warning handling, The object model of asdf, Top
 
1124
@node Controlling where ASDF saves compiled files, Error handling, The object model of asdf, Top
 
1125
@comment  node-name,  next,  previous,  up
 
1126
@chapter Controlling where ASDF saves compiled files
 
1127
@cindex ASDF-binary-locations
 
1128
 
 
1129
Each Common Lisp implementation has its own format for
 
1130
compiled files (fasls for short). If you use multiple
 
1131
implementations (or multiple versions of the same
 
1132
implementation), you'll soon find your source directories
 
1133
littered with various `DFSL`s, `FASL`s, `CFSL`s and so on.
 
1134
Worse yet, some implementations use the same file extension
 
1135
or change formats from version to version which means that
 
1136
you'll have to recompile binaries as you switch from one
 
1137
implementation to the next.
 
1138
 
 
1139
As of version 1.365, ASDF includes @emph{ASDF-binary-locations} to
 
1140
mitigate the problem.
 
1141
 
 
1142
@section Default locations
 
1143
@findex output-files-for-system-and-operation
 
1144
 
 
1145
The default binary location for each Lisp implementation is a
 
1146
subdirectory of each source directory. To account for different Lisps,
 
1147
Operating Systems, Implementation versions, and so on, ASDF borrows code
 
1148
from SLIME to create reasonable custom directory names. Here are
 
1149
some examples:
 
1150
 
 
1151
@itemize
 
1152
@item SBCL, version 1.0 on Mac OS X for intel: @code{sbcl-1.0-darwin-x86}
 
1153
 
 
1154
@item Franz Allegro, version 8.0, ANSI Common Lisp:  @code{allegro-8.0a-macosx-x86}
 
1155
 
 
1156
@item Franz Allegro, version 8.1, Modern (case sensitive) Common Lisp: @code{allegro-8.1m-macosx-x86}
 
1157
@end itemize
 
1158
 
 
1159
If you want to keep compiled files out of the source tree entirely, use
 
1160
@code{*centralize-lisp-binaries*} to put compiled files into
 
1161
sub-directories of a single central location (see below).
 
1162
 
 
1163
Here is a summary of the variables that control ASDF's source-to-binary
 
1164
mappings.  All of them are in the ASDF package, so must be set
 
1165
@emph{after} loading ASDF.
 
1166
 
 
1167
@defvar *enable-asdf-binary-locations*
 
1168
   If false, then ASDF will place binaries in the same directory as the
 
1169
    source. If true, then ASDF will move the binaries using the rest of
 
1170
    the configuration. Defaults to @code{nil}.
 
1171
@end defvar
 
1172
 
 
1173
 @defvar *centralize-lisp-binaries*
 
1174
 If true, compiled lisp files
 
1175
    without an explicit mapping (see @code{*source-to-target-mappings*})
 
1176
    will be placed in subdirectories of
 
1177
    @code{*default-toplevel-directory*}. If false, then compiled lisp
 
1178
    files without an explicit mapping will be placed in subdirectories
 
1179
    of their sources. Defaults to @code{nil}.
 
1180
@end defvar
 
1181
 
 
1182
 @defvar *default-toplevel-directory*
 
1183
 If
 
1184
    @code{*centralize-lisp-binaries*} is true, then compiled lisp files
 
1185
    without an explicit mapping (see @code{*source-to-target-mappings*})
 
1186
    will be placed in subdirectories of
 
1187
    @code{*default-toplevel-directory*}.  Defaults to a sub-directory
 
1188
    named `.fasls` in the current user's home directory.
 
1189
@end defvar
 
1190
 
 
1191
 @defvar *include-per-user-information*
 
1192
 specifies whether or not
 
1193
    to include user information in the directory. Only used when
 
1194
    @code{*centralize-lisp-binaries*} is true. Defaults to @code{nil}.
 
1195
@end defvar
 
1196
 
 
1197
 @defvar *map-all-source-files*
 
1198
 If true, then all source files
 
1199
    will be mapped by ASDF. If @code{nil}, then only Common Lisp Source
 
1200
    Files (i.e., instances of cl-source-file or its subclasses) will
 
1201
    be. Defaults to @code{nil}.
 
1202
@end defvar
 
1203
 
 
1204
 @defvar *source-to-target-mappings*
 
1205
 This specifies mappings
 
1206
    from source to target. If the target is nil, then it
 
1207
    means to *not* map the source to anything. I.e., to leave
 
1208
    it as is. This has the effect of turning off
 
1209
    ASDF-Binary-Locations for the given source directory. The
 
1210
    default depends on the Lisp implementation.
 
1211
@end defvar
 
1212
 
 
1213
These variables are used by
 
1214
@code{output-files-for-system-and-operation} to determine where to
 
1215
place a source file's binary. You can further customize asdf-binary-locations
 
1216
by writing additional methods on the generic function
 
1217
@code{output-files-for-system-and-operation}.
 
1218
 
 
1219
@c See the [manual][binary-locations] for more details.
 
1220
 
 
1221
@subsection Notes and Issues
 
1222
 
 
1223
SBCL ships with several included ASDF libraries which used to confuse
 
1224
ABL because it would try to recompile the FASLs and then run into
 
1225
directory permission problems. ASDF knows about these and uses a mapping
 
1226
like @file{/usr/local/lib/sbcl} to @code{nil} so that the FASLs are not
 
1227
relocated.
 
1228
 
 
1229
@node  Error handling, Compilation error and warning handling, Controlling where ASDF saves compiled files, Top
985
1230
@comment  node-name,  next,  previous,  up
986
1231
@chapter Error handling
987
1232
@findex SYSTEM-DEFINITION-ERROR
1011
1256
@comment  node-name,  next,  previous,  up
1012
1257
@chapter Additional Functionality
1013
1258
 
1014
 
ASDF includes several additional features that are generally 
 
1259
@emph{FIXME:  Add discussion of @code{run-shell-command}?  Others?}
 
1260
 
 
1261
ASDF includes several additional features that are generally
1015
1262
useful for system definition and development. These include:
1016
1263
 
1017
1264
@enumerate
1018
1265
@item
1019
 
system-relative-pathname 
 
1266
system-relative-pathname
1020
1267
 
1021
 
It's often handy to locate a file relative to some system. The system-relative-pathname function meets this need. It takes two arguments: the name of a system and a relative pathname. It returns a pathname built from the 
 
1268
It's often handy to locate a file relative to some system. The system-relative-pathname function meets this need. It takes two arguments: the name of a system and a relative pathname. It returns a pathname built from the
1022
1269
location of the system's source file and the relative pathname. For example
1023
1270
 
1024
1271
@lisp
1033
1280
@comment  node-name,  next,  previous,  up
1034
1281
@chapter Getting the latest version
1035
1282
 
1036
 
@enumerate
1037
 
@item
 
1283
@emph{FIXME:  Need to revise this to give information about the git repository.}
 
1284
 
1038
1285
Decide which version you want.  HEAD is the newest version and
1039
1286
usually OK, whereas RELEASE is for cautious people (e.g. who already
1040
1287
have systems using asdf that they don't want broken), a slightly older
1041
1288
version about which none of the HEAD users have complained.
1042
 
 
1043
 
@item
1044
 
Check it out from sourceforge cCLan CVS:
1045
 
 
1046
 
@kbd{cvs -d:pserver:anonymous@@cvs.cclan.sourceforge.net:/cvsroot/cclan login}
1047
 
 
1048
 
(no password: just press @key{Enter})
1049
 
 
1050
 
@kbd{cvs -z3 -d:pserver:anonymous@@cvs.cclan.sourceforge.net:/cvsroot/cclan co -r RELEASE asdf}
1051
 
 
1052
 
or for the bleeding edge, instead
1053
 
 
1054
 
@kbd{cvs -z3 -d:pserver:anonymous@@cvs.cclan.sourceforge.net:/cvsroot/cclan co -A asdf}
1055
 
 
1056
 
@end enumerate
1057
 
 
1058
 
If you are tracking the bleeding edge, you may want to subscribe to
1059
 
the cclan-commits mailing list (see
1060
 
@url{http://sourceforge.net/mail/?group_id=28536}) to receive commit
1061
 
messages and diffs whenever changes are made.
1062
 
 
1063
 
For more CVS information, look at
1064
 
@url{http://sourceforge.net/cvs/?group_id=28536}.
1065
 
 
1066
 
 
1067
 
 
 
1289
There is also a STABLE version, which is earlier than release.
 
1290
 
 
1291
You may get the ASDF source repository using git:
 
1292
@kbd{git clone http://common-lisp.net/project/asdf/asdf.git}
 
1293
 
 
1294
You will find the above referenced tags in this repository.
 
1295
 
 
1296
Discussion of ASDF development is conducted on the mailing list
 
1297
@kbd{asdf-devel@@common-lisp.net}.
1068
1298
 
1069
1299
@node  TODO list, missing bits in implementation, Getting the latest version, Top
1070
1300
@comment  node-name,  next,  previous,  up
1151
1381
 
1152
1382
*** Propagation of the :force option.  ``I notice that
1153
1383
 
1154
 
        (oos 'compile-op :araneida :force t)
 
1384
        (oos 'compile-op :araneida :force t)
1155
1385
 
1156
1386
also forces compilation of every other system the :araneida system
1157
1387
depends on.  This is rarely useful to me; usually, when I want to force
1180
1410
Other possible interface: have a 'revert' function akin to 'make clean'
1181
1411
 
1182
1412
@lisp
1183
 
(asdf:revert 'asdf:compile-op 'araneida) 
 
1413
(asdf:revert 'asdf:compile-op 'araneida)
1184
1414
@end lisp
1185
1415
 
1186
1416
would delete any files produced by 'compile-op 'araneida.  Of course, it
1207
1437
language features (and is documented), and we intend to be portable
1208
1438
rather than just widely-ported.  No slight on the mk-defsystem authors
1209
1439
and maintainers is intended here; that implementation has the
1210
 
unenviable task of supporting pre-ANSI implementations, which is 
 
1440
unenviable task of supporting pre-ANSI implementations, which is
1211
1441
no longer necessary.
1212
1442
 
1213
1443
The surface defsystem syntax of asdf is more-or-less compatible with
1214
1444
mk-defsystem, except that we do not support the @code{source-foo} and
1215
 
@code{binary-foo} prefixes for separating source and binary files, and 
 
1445
@code{binary-foo} prefixes for separating source and binary files, and
1216
1446
we advise the removal of all options to specify pathnames.
1217
1447
 
1218
1448
The mk-defsystem code for topologically sorting a module's dependency
1226
1456
@itemize
1227
1457
@item
1228
1458
We don't specify output files or output file extensions as part of the
1229
 
system.  
 
1459
system.
1230
1460
 
1231
1461
If you want to find out what files an operation would create, ask the
1232
1462
operation.
1238
1468
in that file (ilisp / SLIME will like you more if you do this anyway)
1239
1469
 
1240
1470
@item
1241
 
There is no proposal here that defsystem does version control.  
 
1471
There is no proposal here that defsystem does version control.
1242
1472
 
1243
1473
A system has a given version which can be used to check dependencies,
1244
1474
but that's all.
1249
1479
 
1250
1480
@section kmp's ``The Description of Large Systems'', MIT AI Memu 801
1251
1481
 
1252
 
Available in updated-for-CL form on the web at 
1253
 
@url{http://world.std.com/~pitman/Papers/Large-Systems.html}
 
1482
Available in updated-for-CL form on the web at
 
1483
@url{http://nhplace.com/kent/Papers/Large-Systems.html}
1254
1484
 
1255
1485
In our implementation we borrow kmp's overall PROCESS-OPTIONS and
1256
1486
concept to deal with creating component trees from defsystem surface
1263
1493
 
1264
1494
@node Concept Index, Function and Class Index, Inspiration, Top
1265
1495
@unnumbered Concept Index
1266
 
     
 
1496
 
1267
1497
@printindex cp
1268
1498
 
1269
1499
@node Function and Class Index, Variable Index, Concept Index, Top
1270
1500
@unnumbered Function and Class Index
1271
 
     
 
1501
 
1272
1502
@printindex fn
1273
1503
 
1274
1504
@node Variable Index,  , Function and Class Index, Top
1275
1505
@unnumbered Variable Index
1276
 
     
 
1506
 
1277
1507
@printindex vr
1278
1508
 
1279
1509