Protect STREAM-FILE-STREAM against non file-stream streams.
[clon.git] / Makefile.inc
blob15fcc6d61fb062124714d4f6c409641b4a4b6feb
1 ### Makefile.inc --- Inclusion part
3 ## Copyright (C) 2010, 2011, 2012 Didier Verna.
5 ## Author:     Didier Verna <didier@lrde.epita.fr>
6 ## Maintainer: Didier Verna <didier@lrde.epita.fr>
8 ## This file is part of Clon.
10 ## Permission to use, copy, modify, and distribute this software for any
11 ## purpose with or without fee is hereby granted, provided that the above
12 ## copyright notice and this permission notice appear in all copies.
14 ## THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
15 ## WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
16 ## MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
17 ## ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
18 ## WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
19 ## ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
20 ## OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23 ### Commentary:
25 ## Contents management by FCM version 0.1.
28 ### Code:
30 PROJECT   := clon
31 PACKAGE   := com.dvlsoft.$(PROJECT)
32 ASDF_FILE := $(PACKAGE).asd
34 PERL := perl
36 SHARE := $(PREFIX)/share
38 W3DIR := $(HOME)/www/software/lisp/$(PROJECT)
41 SBCL_CACHE  := sbcl
42 SBCL_BINLOC := sbcl
43 SBCL_LOAD   := --load
44 SBCL_EVAL   := --eval
45 SBCL_DUMP   := --script
47 CMUCL_CACHE  := cmu
48 CMUCL_BINLOC := cmu
49 CMUCL_LOAD   := -load
50 CMUCL_EVAL   := -eval
51 CMUCL_DUMP   := -noinit -nositeinit $(CMUCL_LOAD)
53 CCL_CACHE  := ccl
54 CCL_BINLOC := openmcl
55 CCL_LOAD   := --load
56 CCL_EVAL   := --eval
57 CCL_DUMP   := --no-init $(CCL_LOAD)
59 ECL_CACHE  := ecl
60 ECL_BINLOC := ecl
61 ECL_LOAD   := -load
62 ECL_EVAL   := -eval
63 ECL_DUMP   := -norc $(ECL_LOAD)
65 ACL_CACHE  := acl
66 ACL_BINLOC := acl
67 ACL_LOAD   := -L
68 ACL_EVAL   := -e
69 ACL_DUMP   := -qq $(ACL_LOAD)
71 CLISP_CACHE  := clisp
72 CLISP_BINLOC := clisp
73 CLISP_LOAD   := -i
74 CLISP_DUMP   := -norc $(CLISP_LOAD)
76 ABCL_CACHE  := abcl
77 ABCL_BINLOC := abcl
78 ABCL_LOAD   := --load
79 ABCL_EVAL   := --eval
80 ABCL_DUMP   := --batch $(ABCL_EVAL) '\
81 (progn (defvar cl-user::$(PACKAGE).configuration nil)\
82        (setf (getf cl-user::$(PACKAGE).configuration :dump) t))' \
83                $(ABCL_LOAD)
85 ifeq ($(RESTRICTED),t)
86 CONFIG := '(progn (defvar cl-user::$(PACKAGE).configuration nil) \
87              (setf (getf cl-user::$(PACKAGE).configuration :restricted) t))'
88   ifeq ($(LISP),CLISP)
89 EVAL_CONFIG := $($(LISP)_LOAD) $(TOP_DIR)/.clisp.cnf
90   else
91 EVAL_CONFIG := $($(LISP)_EVAL) $(CONFIG)
92   endif
93 else
94 CONFIG :=
95 EVAL_CONFIG :=
96 endif
98 # This is a gross hack for compensating the lack of --eval option to clisp.
99 # This rule doesn't actually create any clisp.inc file, but a clisp
100 # configuration file that will be loaded with -i, and which is redone every
101 # time make is called (several times actually). This is not a clean solution
102 # but it works. Every Makefile that needs to run $(LISP) needs to include
103 # clisp.inc in order for this to work.
104 $(TOP_DIR)/clisp.inc:
105         echo $(CONFIG) > $(TOP_DIR)/.clisp.cnf
107 # The rule below duplicates what the one above does, but it's needed for
108 # makefiles that include both version.inc and clisp.inc. This is necessary
109 # because Make wants to redo things in the wrong order and hence would call
110 # clisp -i .clisp.cnf without this file having been created first.
111 $(TOP_DIR)/version.inc: $(TOP_DIR)/version.cl $(TOP_DIR)/$(ASDF_FILE)
112 ifeq ($(LISP),CLISP)
113         echo $(CONFIG) > $(TOP_DIR)/.clisp.cnf
114 endif
115         $($(LISP)_PATH) $(EVAL_CONFIG)          \
116           $($(LISP)_LOAD) $(TOP_DIR)/version.cl \
117         | tail -2 > $@
121 ### Makefile.inc ends here