forked from mozart/mozart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
316 lines (274 loc) · 8.86 KB
/
Makefile.in
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
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
#
# Authors:
# Michael Mehl ([email protected])
#
# Contributors:
# Denys Duchier ([email protected])
# Christian Schulte <[email protected]>
#
# Copyright:
# Michael Mehl, 1998
#
# Last change:
# $Date$ by $Author$
# $Revision$
#
# This file is part of Mozart, an implementation
# of Oz 3:
# http://www.mozart-oz.org
#
# See the file "LICENSE" or
# http://www.mozart-oz.org/LICENSE.html
# for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL
# WARRANTIES.
# !!! THIS MAKEFILE REQUIRES GNU MAKE !!!!
######################################################################
# path
######################################################################
BUILDTOP= @BUILDTOP@
SRCTOP= @SRCTOP@
SRCDIR= @srcdir@
VPATH= @srcdir@
PREFIX= @prefix@
PLATFORM= @PLATFORM@
HOMEURL= @HOMEURL@
HOMECACHE= @HOMECACHE@
BINDIR= $(PREFIX)/bin
SHAREDIR= $(PREFIX)/share
TOOLSDIR= $(SHAREDIR)/tools
ELISPDIR= $(SHAREDIR)/elisp
IMAGESDIR= $(SHAREDIR)/images
CACHEDIR= $(PREFIX)/$(HOMECACHE)
CACHETOOLS= $(CACHEDIR)/tools
CACHEBIN= $(CACHEDIR)/bin
SHARECACHE= $(CACHEDIR)/share
######################################################################
# programs
######################################################################
MAKE= @MAKE@
INSTALL= @INSTALL@
INSTALL_BIN= $(INSTALL) -m 555
INSTALL_FILE= $(INSTALL) -m 444
INSTALL_DIR= @INSTALL_DIR@
######################################################################
# other variables
######################################################################
OZVERSION= $(SRCTOP)/OZVERSION
OZBUILD= @OZBUILDDATE@
FILES= README LICENSE LICENSE.html LICENSE.rtf
ALLFILES= $(FILES:%=$(PREFIX)/%)
# sub directories for recursive makes
SUBDIRS= @oz_subdirs@
######################################################################
# common targets
######################################################################
.PHONY: all bootstrap install clean veryclean distclean check
bootstrap::
all bootstrap clean veryclean depend distclean check install::
dirs="$(SUBDIRS)"; \
for i in $$dirs; do \
if (cd $$i && $(MAKE) $@); \
then true; \
else exit 1; \
fi; \
done
clean::
-rm -f *~
veryclean::
$(MAKE) clean SUBDIRS=
distclean::
$(MAKE) veryclean SUBDIRS=
-rm -f Makefile config.cache config.log config.status
install:: $(PREFIX)
$(PREFIX):
$(INSTALL_DIR) $@
all:: Makefile
Makefile: Makefile.in ./config.status
./config.status
./config.status: ./configure
./config.status --recheck
install:: $(ALLFILES)
$(ALLFILES): $(PREFIX)/% : % $(PREFIX)
$(INSTALL_FILE) $< $@
######################################################################
# other targets
######################################################################
PLATFORMS= solaris-sparc aix3-rs600 freebsd-i486 hpux-700 \
irix6-mips linux-i486 netbsd-i486 netbsd-m68k netbsd-sparc \
osf1-alpha solaris-i486 sunos-sparc freebsdelf-i486
COMPRESS= gzip -9
ZIP= zip -r
TAR= tar
PACKDIR= /tmp/pack
MPD= $(PACKDIR)/mozart
WIN32CACHEDIR= $(MPD)/cache/$(HOMECACHE)
NOTDIRSRCTOP = $(notdir $(SRCTOP))
.PHONY: src doc $(PLATFORMS)
ifeq ($(USER),root)
# make sure that what goes into the tar files for preparing the RPMs
# is actually owned by root, otherwise the owner and group of the file
# itself will be used, which aren't likely to exist on a user's machine.
TARTAR = $(TAR) --owner=root --group=root
else
TARTAR = $(TAR)
endif
src: $(PACKDIR)
echo "[" $(NOTDIRSRCTOP) "]"
test -n "$(NOTDIRSRCTOP)" || { echo "bad"; exit 1; }
(cd $(PACKDIR); \
mkdir -p $(NOTDIRSRCTOP); \
cd $(NOTDIRSRCTOP); \
(cd $(SRCTOP); \
$(TAR) -cf - .) | $(TAR) -xf - ; \
cd ..; \
tbr=`find $(NOTDIRSRCTOP) -name CVS -type d 2>/dev/null` ; \
rm -rf $$tbr ; \
find $(NOTDIRSRCTOP) -name '.cvsignore' -type f -exec rm -f '{}' ';' ; \
mv $(NOTDIRSRCTOP) mozart-`$(OZVERSION)`.$(OZBUILD); \
$(TARTAR) -cf - mozart-`$(OZVERSION)`.$(OZBUILD) ) | \
$(COMPRESS) > mozart-`$(OZVERSION)`.$(OZBUILD)-src.tar.gz
rm -rf $(PACKDIR)/mozart-`$(OZVERSION)`.$(OZBUILD)
doc: $(PACKDIR) $(PACKDIR)/mozart
rm -f files.doc
$(MAKE) files.doc
rm -rf $(PACKDIR)/mozart
$(INSTALL_DIR) $(PACKDIR)/mozart
( (cd $(PREFIX); \
$(TAR) -cf - -T $(BUILDTOP)/files.doc ) | \
(cd $(PACKDIR)/mozart; $(TAR) -xf - ) )
(cd $(PACKDIR); $(TARTAR) -cf - mozart ) | \
$(COMPRESS) > mozart-`$(OZVERSION)`.$(OZBUILD)-doc.tar.gz
rm -rf $(PACKDIR)/mozart
rm -f files.doc
bin: $(PLATFORM)
$(PLATFORMS): $(PACKDIR) $(PACKDIR)/mozart
rm -f files.base files.base-$@ files.contrib files.contrib-$@
$(MAKE) files.base files.base-$@ files.contrib files.contrib-$@
rm -f files.all
cat files.base files.base-$@ files.contrib files.contrib-$@ > files.all
rm -rf $(PACKDIR)/mozart
$(INSTALL_DIR) $(PACKDIR)/mozart
( (cd $(PREFIX); \
$(TAR) -cf - -T $(BUILDTOP)/files.all ) | \
(cd $(PACKDIR)/mozart; $(TAR) -xf - ) )
(cd $(PACKDIR); $(TARTAR) -cf - mozart ) | \
$(COMPRESS) > mozart-`$(OZVERSION)`.$(OZBUILD)[email protected]
rm -rf $(PACKDIR)/mozart
ldd $(PREFIX)/platform/$(PLATFORM)/emulator.exe \
$(PREFIX)/platform/$(PLATFORM)/tk.exe | \
sed 's/^.*emulator.exe:/emulator.exe dynamically linked against:/' | \
sed 's/^.*tk.exe:/tk.exe dynamically linked against:/' > README-`$(OZVERSION)`.$(OZBUILD)-$@
rm -f files.base files.base-$@ files.contrib files.contrib-$@ files.all
$(PACKDIR) $(PACKDIR)/mozart:
INSTALL_DIR_CHMOD=777; export INSTALL_DIR_CHMOD && $(INSTALL_DIR) $@
win32-i486-cygwin: $(PACKDIR) $(PACKDIR)/mozart
( cd $(PREFIX) && \
$(TAR) c --exclude platform/win32-i486/oztool.sh -f - \
$(FILES) \
include share \
doc examples \
cache/x-oz/contrib cache/x-oz/system \
bin platform/win32-i486 \
) | (cd $(MPD) && $(TAR) xf -)
find $(MPD) -name '*.so-*' -a \! \( -name '*.so-win32-i486' \) \
-exec rm -f '{}' ';'
rm -rf mozart-win32
$(INSTALL_DIR) mozart-win32
(cd $(MPD) && \
$(TAR) cf - $(FILES) bin cache/x-oz/system cache/x-oz/contrib \
doc examples \
include share/Init.ozf share/elisp platform) | \
(cd mozart-win32 && $(TAR) xf -)
$(INSTALL_DIR) mozart-win32/doc
$(INSTALL) -m 644 $(SRCTOP)/doc/utilities/ozdoc-iexplorer.css \
mozart-win32/doc/ozdoc.css
rm -rf $(PACKDIR)/mozart
rm -f mozart-win32.zip
$(ZIP) mozart-win32.zip mozart-win32
rm -rf mozart-win32
win32-i486-cross: $(PACKDIR) $(PACKDIR)/mozart
( cd $(PREFIX); \
$(TAR) cf - \
$(FILES) \
include share \
doc examples \
cache/x-oz/contrib cache/x-oz/system \
winbin platform/win32-i486 \
) | (cd $(MPD); $(TAR) xf -)
find $(MPD) -name '*.so-*' -a \! \( -name '*.so-win32-i486' \) \
-exec rm -f '{}' ';'
for i in ozc ozd ozl; do \
cat $(MPD)/winbin/ozwrapper.bin \
$(PREFIX)/bin/$$i > $(MPD)/winbin/$$i.exe; \
done
for i in convertTextPickle; do \
if [ -r $(PREFIX)/bin/$$i ]; then \
cat $(MPD)/winbin/ozwrapper.bin \
$(PREFIX)/bin/$$i > $(MPD)/winbin/$$i.exe; \
fi; \
done
mv $(MPD)/winbin $(MPD)/bin
chmod -R a+x $(MPD)/bin
rm -rf mozart-win32
$(INSTALL_DIR) mozart-win32
(cd $(MPD); \
$(TAR) cf - $(FILES) bin cache/x-oz/system cache/x-oz/contrib \
doc examples \
include share/Init.ozf share/elisp platform) | \
(cd mozart-win32; $(TAR) xf -)
$(INSTALL_DIR) mozart-win32/doc/doc
$(INSTALL_FILE) $(SRCTOP)/doc/utilities/ozdoc-iexplorer.css \
mozart-win32/doc/doc/ozdoc.css
rm -rf /tmp/pack/mozart
rm -f mozart-win32.zip
$(ZIP) -r mozart-win32.zip mozart-win32
rm -rf mozart-win32
files.base:
(cd $(PREFIX); \
find . \( -type f -o -type l \) -a \( \
! -path './platform/*' -a \
! -path './winbin/*' -a \
! -path './cache/x-oz/contrib/*' -a \
! -path './cache/x-oz/doc/*' -a \
! -path './doc/*' -a \
! -path './print/*' -a \
! -path './examples/*' -a \
! -path './cache/x-oz/system/gump/examples/*' -a \
! -path './share/doc/*' -a \
! -path './bin/ozdoc' -a \
! -path './bin/convertTextPickle' -a \
! -name '*.so-*' -a \
! -path './share/elisp/Fontifier.el' \
\) ) > $@
files.base-%:
(cd $(PREFIX); \
find . \( -type f -o -type l \) -a \
\( -path './platform/$*/*' -o \
-path './cache/x-oz/boot/*.so-$*' -o \
-path './cache/x-oz/system/*.so-$*' \) \
) > $@
files.contrib:
(cd $(PREFIX); \
find . \( -type f -o -type l \) -a \( \
\( -path './cache/x-oz/contrib/*' -a ! -name '*.so-*' \) -o \
-path './bin/ozdoc' -o \
-path './bin/convertTextPickle' -o \
-path './share/doc/*' -o \
-path './share/elisp/Fontifier.el' \
\) ) > $@
files.contrib-%:
(cd $(PREFIX); \
find . \( -type f -o -type l \) -a \
-path './cache/x-oz/contrib/*' -a \
-name '*.so-$*' \
) > $@
files.doc:
(cd $(PREFIX); \
find . \( -type f -o -type l \) -a \( \
-path './doc/*' -o \
-path './cache/x-oz/system/gump/examples/*' -o \
-path './cache/x-oz/doc/*' -o \
-path './examples/*' \
\) -a \! \( -path './doc/Mozart.hh?' -o \
-path './doc/add-ons/*/*' \) ) > $@