forked from andreer/lispbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GNUmakefile
290 lines (223 loc) · 8.88 KB
/
GNUmakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
#
# GNUmakefile to build Practical Common Lisp Lispbox distro.
# Copyright 2005 Peter Seibel.
#
# N.B. I know about the z flag to tar. However, on OS X gzip complains
# about trailing garbage if not passed the -q flag. And tar doesn't
# seem to pay attention to the GZIP environment variable.
include GNUmakefile.vars
#LISPBOX_LISP := sbcl
LISPBOX_LISP := clozurecl
GNU_LINUX_EMACS_VERSION := 23.2
WINDOWS_EMACS_VERSION := 23.2
CLISP_VERSION := 2.41
ALLEGRO_VERSION := 70_trial
SBCL_VERSION := 1.0.42
CLOZURECL_VERSION := 1.5
CLOZURECL_PLATFORM := darwinx86
CLOZURECL_SCRIPT := dx86cl64
SLIME_VERSION := 20101009.090831
PRACTICALS_VERSION := 1.0.3
QUICKLISP_VERSION := beta-2010-10-09
ifeq ($(os),Linux)
emacs := emacs-$(GNU_LINUX_EMACS_VERSION)
endif
ifeq ($(os),Darwin)
emacs := Emacs.app
endif
ifeq ($(os),Windows)
emacs := emacs-$(WINDOWS_EMACS_VERSION)
endif
clisp := clisp-$(CLISP_VERSION)
allegro := acl$(ALLEGRO_VERSION)
sbcl := sbcl-$(SBCL_VERSION)
clozurecl := ccl-$(CLOZURECL_VERSION)-$(CLOZURECL_PLATFORM)
lisp := $($(LISPBOX_LISP))
slime := slime-$(SLIME_VERSION)
practicals := practicals-$(PRACTICALS_VERSION)
quicklisp := quicklisp-$(QUICKLISP_VERSION)
ifeq ($(os),Darwin)
lispbox_script_dir := $(prefix)/Emacs.app/Contents/MacOS
emacs_lisp := $(prefix)/Emacs.app/Contents/Resources/lisp
emacs_site_lisp := $(prefix)/Emacs.app/Contents/Resources/site-lisp
export LISPBOX_HOME_RELATIVE := /../../..
export EMACS_EXE := Emacs.app/Contents/MacOS/Emacs
endif
ifeq ($(os),Linux)
lispbox_script_dir := $(prefix)
emacs_site_lisp := $(prefix)/$(emacs)/share/emacs/site-lisp
export LISPBOX_HOME_RELATIVE :=
export EMACS_EXE := $(emacs)/bin/emacs
export LINUX=yes
endif
ifeq ($(os),Windows)
lispbox_script_dir := $(prefix)
emacs_site_lisp := $(prefix)/$(emacs)/site-lisp
export LISPBOX_HOME_RELATIVE :=
export EMACS_EXE := $(emacs)/bin/runemacs.exe
endif
export EMACS := $(emacs)
lispbox_elisp_dir := $(if $(NO_EMACS),$(prefix),$(emacs_site_lisp))
all: distro
distros:
$(MAKE) -f GNUmakefile.distros
clean:
rm -rf staging
rm -rf $(prefix)
source-dist: $(LISPBOX_HOME)-source.tar.gz
$(LISPBOX_HOME)-source.tar.gz:
mkdir $(prefix)
mkdir -p $(prefix)/binary-archives
cp binary-archives/$(practicals).tar.gz $(prefix)/binary-archives/
mkdir -p $(prefix)/source-archives
mkdir -p $(prefix)/staging-archives
cp asdf-extensions.lisp $(prefix)
cp asdf.lisp $(prefix)
cp COPYING $(prefix)
cp ChangeLog $(prefix)
cp GNUmakefile $(prefix)
cp GNUmakefile.allegro $(prefix)
cp GNUmakefile.base $(prefix)
cp GNUmakefile.clisp $(prefix)
cp GNUmakefile.emacs $(prefix)
cp GNUmakefile.practicals $(prefix)
cp GNUmakefile.sbcl $(prefix)
cp GNUmakefile.slime $(prefix)
cp GNUmakefile.vars $(prefix)
cp Info.plist $(prefix)
cp README $(prefix)
cp README.source $(prefix)
cp write-lispbox-el.sh $(prefix)
cp write-lispbox.sh $(prefix)
cp new-lispbox.bat $(prefix)
cp write-site-init-lisp.sh $(prefix)
(cd $(TOP); tar czf - $(LISPBOX_HOME)) > $@
$(prefix) staging:
mkdir -p $@
staging/%: source-archives/%.tar.gz staging
cat $< | (cd staging; gzip -cdq | tar xf -)
find $@ -exec touch {} \;
staging/%: source-archives/%.tar.bz2 staging
cat $< | (cd staging; tar xjf -)
find $@ -exec touch {} \;
######################################################################
# Installer
ifeq ($(os),Linux)
distro_no_emacs := lispbox-$(LISPBOX_VERSION)-no-emacs-with-$(lisp).tar.gz
distro_with_emacs := lispbox-$(LISPBOX_VERSION)-$(lisp).tar.gz
distro_just_lisp := lispbox-$(LISPBOX_VERSION)-just-lisp-$(lisp).tar.gz
distro := $(if $(JUST_LISP),$(distro_just_lisp),$(if $(NO_EMACS),$(distro_no_emacs),$(distro_with_emacs)))
distro: $(distro)
$(distro): lispbox
(cd $(TOP); tar czf - $(LISPBOX_HOME)) > $@
endif
ifeq ($(os),Darwin)
distro_with_emacs := Lispbox-$(LISPBOX_VERSION)-with-$(lisp).zip
distro_no_emacs := LispboxNoEmacs-$(LISPBOX_VERSION)-with-$(lisp).zip
distro_just_lisp := LispboxJustLisp-$(LISPBOX_VERSION)-$(lisp).zip
distro := $(if $(JUST_LISP),$(distro_just_lisp),$(if $(NO_EMACS),$(distro_no_emacs),$(distro_with_emacs)))
distro: $(distro)
$(distro): lispbox
(cd $(TOP); zip --recurse-paths - $(LISPBOX_HOME)) > $@
endif
ifeq ($(os),Windows)
distro_no_emacs := lispbox-$(LISPBOX_VERSION)-no-emacs-with-$(lisp).zip
distro_with_emacs := lispbox-$(LISPBOX_VERSION)-$(lisp).zip
distro_just_lisp := lispbox-$(LISPBOX_VERSION)-just-lisp-$(lisp).zip
distro := $(if $(JUST_LISP),$(distro_just_lisp),$(if $(NO_EMACS),$(distro_no_emacs),$(distro_with_emacs)))
distro: $(distro)
$(distro): lispbox
(cd $(TOP); zip --recurse-paths - $(LISPBOX_HOME)) > $@
endif
######################################################################
# Lispbox
lispbox: staging
ifndef JUST_LISP
ifndef NO_EMACS
lispbox: $(emacs)
ifeq ($(os),Windows)
lispbox: $(lispbox_script_dir)/lispbox.bat
endif
ifneq ($(os),Windows)
lispbox: $(lispbox_script_dir)/lispbox.sh
endif
ifeq ($(os),Darwin)
lispbox: $(prefix)/Emacs.app/Contents/Info.plist
endif # Darwin
endif # not NO_EMACS
lispbox: $(slime)
# lispbox: $(practicals)
lispbox: $(quicklisp)
lispbox: $(prefix)/$(slime)/site-init.lisp
lispbox: $(lispbox_elisp_dir)/lispbox.el
lispbox: $(prefix)/asdf.lisp
lispbox: $(prefix)/asdf-extensions.lisp
endif # not JUST_LISP
lispbox: $(lisp)
lispbox: $(prefix)/$(lisp)/lispbox-register.el
$(lispbox_script_dir)/lispbox.bat: lispbox.bat
cp $< $@
$(lispbox_script_dir)/lispbox.sh: write-lispbox.sh $(prefix)
SBCL_DIR=$(sbcl) CLOZURECL_DIR=$(clozurecl) $(SH) $< > $@
chmod +x $@
foo: $(lispbox_elisp_dir)/lispbox.el
$(lispbox_elisp_dir)/lispbox.el: write-lispbox-el.sh $(if $(NO_EMACS),$(prefix),$(emacs))
SLIME_DIR=$(slime) SBCL_DIR=$(sbcl) CLOZURECL_DIR=$(clozurecl) $(SH) $< > $@
$(prefix)/$(slime)/site-init.lisp: write-site-init-lisp.sh $(prefix)/$(slime)
PRACTICALS=$(practicals) $(SH) $< > $@
chmod 0644 $@
$(prefix)/asdf.lisp: asdf.lisp
cp $< $@
chmod 0644 $@
$(prefix)/asdf-extensions.lisp: asdf-extensions.lisp
cp $< $@
chmod 0644 $@
$(prefix)/$(allegro)/lispbox-register.el: lisppath := (lispbox-list-to-filename (list (file-name-directory load-file-name) \"alisp\"))
$(prefix)/$(allegro)/lispbox-register.el: license := \"devel.lic\"
ifneq ($(os),Windows)
$(prefix)/$(clisp)/lispbox-register.el: lisppath := (lispbox-list-to-filename (list (file-name-directory load-file-name) \"bin\" \"clisp\")) \"-ansi\" \"-K\" \"full\" \"-B\" (lispbox-list-to-filename (list (file-name-directory load-file-name) \"lib\" \"clisp\"))
endif
ifeq ($(os),Windows)
$(prefix)/$(clisp)/lispbox-register.el: lisppath := \
(lispbox-list-to-filename (list (file-name-directory load-file-name) \"full\" \"lisp.exe\")) \"-ansi\" \
\"-M\" (lispbox-list-to-filename (list (file-name-directory load-file-name) \"full\" \"lispinit.mem\")) \
\"-B\" (lispbox-list-to-filename (list (file-name-directory load-file-name) \"full/\"))
endif
$(prefix)/$(sbcl)/lispbox-register.el: lisppath := (lispbox-list-to-filename (list (file-name-directory load-file-name) \"bin\" \"sbcl\"))
ifneq ($(os),Windows)
$(prefix)/$(clozurecl)/lispbox-register.el: lisppath := (lispbox-list-to-filename (list (file-name-directory load-file-name) \"$(CLOZURECL_SCRIPT)\"))
endif
ifeq ($(os),Windows)
$(prefix)/$(clozurecl)/lispbox-register.el: lisppath := (lispbox-list-to-filename (list (file-name-directory load-file-name) (if (getenv \"PROGRAMW6432\") \"wx86cl64.exe\" \"wx86cl.exe\")))
endif
$(prefix)/%/lispbox-register.el: $(lisp)
echo "(push (list '$(LISPBOX_LISP) (list $(lisppath))) slime-lisp-implementations)" > $@
if [ ! -z "$(license)" ]; \
then echo "(lispbox-install-lisp-license (list $(license)) \"$(*)\")" >> $@; \
fi
ifeq ($(os),Darwin)
$(prefix)/Emacs.app/Contents/Info.plist: Info.plist $(emacs)
cp Info.plist $(prefix)/Emacs.app/Contents/
endif
# Unpacking pre-built staging archives into prefix.
components := $(emacs) $(allegro) $(clisp) $(sbcl) $(slime) $(practicals) $(quicklisp) $(clozurecl)
$(components): %: staging-archives/%.tar.gz $(prefix)
cat $< | (cd $(prefix); gzip -cdq | tar xf -)
$(sbcl): staging-archives/$(sbcl).tar.gz $(prefix)
cat $< | (cd $(prefix); gzip -cdq | tar xf -)
# Building staging archives if necessary
staging-archives/$(emacs).tar.gz: makefile := GNUmakefile.emacs
staging-archives/$(allegro).tar.gz: makefile := GNUmakefile.allegro
staging-archives/$(clisp).tar.gz: makefile := GNUmakefile.clisp
staging-archives/$(clozurecl).tar.gz: makefile := GNUmakefile.clozurecl
staging-archives/$(sbcl).tar.gz: makefile := GNUmakefile.sbcl
staging-archives/$(slime).tar.gz: makefile := GNUmakefile.slime
staging-archives/$(practicals).tar.gz: makefile := GNUmakefile.practicals
staging-archives/$(quicklisp).tar.gz: makefile := GNUmakefile.quicklisp
staging-archives/%.tar.gz:
$(MAKE) -f $(makefile) THING=$*
### EMACS ###
emacs: $(emacs)
slime-docs: emacs
cd $(prefix)/$(slime)/doc; \
$(MAKE) infodir=$(prefix)/$(emacs)/info install-info