Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!leah!rpi!weber.cs.rpi.edu!harrisr From: harrisr@cs.rpi.edu (Richard Harris) Newsgroups: comp.lang.lisp Subject: Re: Public defsystem Message-ID: <1175@rpi.edu> Date: 8 Apr 89 00:10:47 GMT References: <23321@coherent.com> Sender: usenet@rpi.edu Organization: Rensselaer Polytechnic Institute, Troy, NY Lines: 186 In article <23321@coherent.com> hastings@coherent.com (Reed Hastings) writes: > >Does anyone know where I can get a public domain defsystem >facility? > >Thanks, > -Reed. Here are three: arisia.xerox.com:pcl/defsys.lisp rascal.ics.utexas.edu:pub/akcl-1-100.tar.Z lsp/make.lsp turing.cs.rpi.edu:pub/lisp/xkcl.tar.Z lsp/system.lsp I am sure there are others around. Rick Harris Here is all the documentation I can find on these three: ------------------------------------------------------------ arisia.xerox.com:pcl/defsys.lisp ;;; Yet Another Sort Of General System Facility and friends. ;;; ;;; The entry points are defsystem and operate-on-system. defsystem is used ;;; to define a new system and the files with their load/compile constraints. ;;; Operate-on-system is used to operate on a system defined that has been ;;; defined by defsystem. For example: #|| (defsystem my-very-own-system "/usr/myname/lisp/" ((classes (precom) () ()) (methods (precom classes) (classes) ()) (precom () (classes methods) (classes methods)))) This defsystem should be read as follows: * Define a system named MY-VERY-OWN-SYSTEM, the sources and binaries should be in the directory "/usr/me/lisp/". There are three files in the system, there are named classes, methods and precom. (The extension the filenames have depends on the lisp you are running in.) * For the first file, classes, the (precom) in the line means that the file precom should be loaded before this file is loaded. The first () means that no other files need to be loaded before this file is compiled. The second () means that changes in other files don't force this file to be recompiled. * For the second file, methods, the (precom classes) means that both of the files precom and classes must be loaded before this file can be loaded. The (classes) means that the file classes must be loaded before this file can be compiled. The () means that changes in other files don't force this file to be recompiled. * For the third file, precom, the first () means that no other files need to be loaded before this file is loaded. The first use of (classes methods) means that both classes and methods must be loaded before this file can be compiled. The second use of (classes methods) mean that whenever either classes or methods changes precom must be recompiled. Then you can compile your system with: (operate-on-system 'my-very-own-system :compile) and load your system with: (operate-on-system 'my-very-own-system :load) ||# ------------------------------------------------------------ rascal.ics.utexas.edu:pub/akcl-1-100.tar.Z lsp/make.lsp ;;; ******* Description of Make Facility ************ ;; We provide a simple MAKE facility to allow ;;compiling and loading of a tree of files ;;If the tree is '(a b (d e g h) i) ;; a will be loaded before b is compiled, ;; b will be loaded before d, e, g, h are compiled ;; d e g h will be loaded before i is compiled. ;; A record is kept of write dates of loaded compiled files, and a file ;;won't be reloaded if it is the same version (unless a force flag is t). ;;Thus if you do (make :uinfor) twice in a row, the second one would not ;;load anything. NOTE: If you change a, and a macro in it would affect ;;b, b still will not be recompiled. You must choose the :recompile t ;;option, to force the recompiling if you change macro files. ;;Alternately you may specify dependency information (see :depends below). ;;****** Sample file which when loaded causes system ALGEBRA ;; to be compiled and loaded ****** ;;(require "MAKE") ;;(use-package "MAKE") ;;(setf (get :algebra :make) '(a b (d e) l)) ;;(setf (get :algebra :source-path) "/usr2/wfs/algebra/foo.lisp") ;;(setf (get :algebra :object-path) "/usr2/wfs/algebra/o/foo.o") ;;(make :algebra :compile t) ;; More complex systems may need to do some special operations ;;at certain points of the make. ;;the tree of files may contain some keywords which have special meaning. ;;eg. '(a b (:progn (gbc) (if make::*compile* ;; (format t "A and B finally compiled"))) ;; (:load-source h i) ;; (d e) l) ;;then during the load and compile phases the function (gbc) will be ;;called after a and b have been acted on, and during the compile phase ;;the message about "A and B finally.." will be printed. ;;the lisp files h and i will be loaded after merging the paths with ;;the source directory. This feature is extensible: see the definitions ;;of :load-source and :progn. ;; The keyword feature is extensible, and you may specify what ;;happens during the load or compile phase for your favorite keyword. ;;To do this look at the definition of :progn, and :load-source ;;in the source for make. ;;Dependency feature: ;; This make NEVER loads or compiles files in an order different from ;;that specified by the tree. It will omit loading files which are ;;loaded and up to date, but if two files are out of date, the first (in ;;the printed representation of the tree), will always be loaded before ;;the second. A consequence of this is that circular dependencies can ;;never occur. ;; ;; If the :make tree contains (a b c d (:depends (c d) (a b))) then c ;;and d depend on a and b, so that if a or b need recompilation then c ;;and d will also be recompiled. Thus the general form of a :depends ;;clause is (:depends later earlier) where LATER and EARLIER are either ;;a single file or a list of files. Read it as LATER depends on EARLIER. ;;A declaration of a (:depends (c) (d)) would have no effect, since the ;;order in the tree already rules out such a dependence. ;; An easy way of specifying a linear dependence is by using :serial. ;;The tree (a (:serial b c d) e) is completely equivalent to the tree ;;(a b c d e (:depends c b)(:depends d (b c))), but with a long list of ;;serial files, it is inconvenient to specify them in the ;;latter representation. ;;A common case is a set of macros whose dependence is serial followed by a set ;;of files whose order is unimportant. A conventient way of building that ;;tree is ;; ;;(let ((macros '(a b c d)) ;; (files '(c d e f g))) ;; `((:serial ,@ macros) ;; ,files ;; (:depends ,files ,macros))) ;; The depends clause may occur anywhere within the tree, since ;;an initial pass collects all dependency information. ;; Make takes a SHOW keyword argument. It is almost impossible to simulate ;;all the possible features of make, for show. Nonetheless, it is good ;;to get an idea of the compiling and loading sequence for a new system. ;;As a byproduct, you could use the output, as a simple sequence of calls ;;to compile-file and load, to do the required work, when make is not around ;;to help. ------------------------------------------------------------ turing.cs.rpi.edu:pub/lisp/xkcl.tar.Z lsp/system.lsp I wrote this one. It (partially) implements the Symbolics Genera functions: set-system-source-file, defsystem, compile-system, and load-system. An example: The directory "system/" contains files which point to various systems, and the defsystem facility has been told this with: (add-system-location-directory "system/") File "system/clx.lisp" contains: (in-package "USER") (defparameter clx-default-pathname (concatenate 'string lisp-root-directory "clx/")) (set-system-source-file 'clx "defsystem" clx-default-pathname) File "clx/defsystem.lisp" contains: (defsystem clx (:default-pathname #.clx-default-pathname :pretty-name "CLX") (:module clos pcl (:type :system)) (:parallel clos "depdefs" "clx" "dependent" "macros" "bufmac" "buffer" "display" "gcontext" "requests" "input" "fonts" "graphics" "text" "attributes" "translate" "keysyms" "manager" "image" "resource")) The system CLX can be compiled by typing: (compile-system 'clx) To load system CLX, type: (load-system 'clx) ------------------------------------------------------------