-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile.am
306 lines (261 loc) · 10.7 KB
/
Makefile.am
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
# Process this with automake to create Makefile.in
SUBDIRS = doc testsuite gnu/bytecode gnu/math gnu/lists gnu/text \
gnu/mapping $(XML_SUBDIRS) gnu/expr \
gnu/kawa/util gnu/kawa/reflect gnu/kawa/functions gnu/kawa/lispexpr \
gnu/kawa/models gnu/kawa/swingviews gnu/kawa/swtviews \
kawa gnu/kawa/slib gnu/commonlisp gnu/q2 gnu/ecmascript \
gnu/kawa/servlet $(ECHO2_SUBDIRS) $(SAX_SUBDIR) gnu/kawa/ant \
$(JEMACS_SUBDIRS) $(XQUERY_SUBDIR) $(BRL_SUBDIRS) $(ANDROID_SUBDIRS) bin
if ENABLE_JEMACS
JEMACS_SUBDIRS = gnu/jemacs/lang gnu/jemacs/buffer gnu/jemacs/lisp \
gnu/jemacs/testsuite gnu/jemacs/swing gnu/jemacs/swt
endif
if ENABLE_XML
XML_SUBDIRS = gnu/xml gnu/kawa/xml
if ENABLE_BRL
BRL_SUBDIRS = gnu/brl gnu/kawa/brl
endif
if ENABLE_XQUERY
XQUERY_SUBDIR = gnu/xquery gnu/kawa/xslt
endif
if WITH_SAX2
SAX_SUBDIR = gnu/kawa/sax
endif
endif
if ENABLE_ECHO2
ECHO2_SUBDIRS = gnu/kawa/echo2
endif
if WITH_ANDROID
ANDROID_SUBDIRS = gnu/kawa/android
endif
javadir=$(datadir)/java
JAR = jar
GCJ_DBTOOL = gcj-dbtool
META_ScriptEngineFactory = META-INF/services/javax.script.ScriptEngineFactory
if WITH_JAVAX_SCRIPT
META_INF_FILES = $(META_ScriptEngineFactory)
endif
kawa-@VERSION@.jar: ./kawa-jar.stamp $(META_INF_FILES)
$(JAR) cmf $(srcdir)/jar-manifest $@ $(META_INF_FILES)\
`find gnu kawa -name '*.class' -print`
kawart-@VERSION@.jar: ./kawa-jar.stamp $(srcdir)/classes-to-skip-for-runtime
$(JAR) cf $@ \
`find gnu kawa -name '*.class' -print | grep -v -f $(srcdir)/classes-to-skip-for-runtime`
$(META_ScriptEngineFactory): Makefile
echo 'kawa.standard.SchemeScriptEngineFactory #Scheme' >tmp.ScriptEngineFactory
if ENABLE_XQUERY
echo 'gnu.xquery.lang.XQueryScriptEngineFactory #XQuery' >>tmp.ScriptEngineFactory
endif
mkdir -p META-INF/services
mv tmp.ScriptEngineFactory $(META_ScriptEngineFactory)
kawa-doc.tar.gz: kawa-doc-$(VERSION).tar.gz
kawa-doc-$(VERSION).tar.gz: doc/kawa.texi doc/kawa-tour.texi
cd doc; $(MAKE) ../kawa-doc-$(VERSION).tar.gz
dist-kawa-@VERSION@.jar: $(DIST_ARCHIVES)
srcdir=`(cd $(srcdir); /bin/pwd)` \
&& rm -rf tmpdir \
&& mkdir tmpdir \
&& cd tmpdir \
&& tar xzf ../$(distdir).tar.gz \
&& rm -f ./patch-source-list \
&& ./kawa-@VERSION@/configure --with-java-source=6compat5 --with-servlet \
&& CLASSPATH=@conf_classpath@.:$$CLASSPATH $(MAKE) \
&& mv kawa-@VERSION@.jar ../dist-kawa-@VERSION@.jar \
&& cd .. && rm -rf tmpdir
jemacs-@JEMACS_VERSION@.jar:
srcdir=`(cd $(srcdir); /bin/pwd)` \
&& rm -rf tmpdir \
&& mkdir tmpdir \
&& cd tmpdir \
&& $$srcdir/configure --with-swing \
&& $(MAKE) \
&& $(JAR) cmf $$srcdir/gnu/jemacs/jar-manifest \
../jemacs-@JEMACS_VERSION@.jar \
`find . -name '*.class' -print` \
&& cd .. && rm -rf tmpdir
bytecode-@BYTECODE_VERSION@.jar: ./gnu/bytecode/java-classes.stamp
$(JAR) cmf $(srcdir)/gnu/bytecode/jar-manifest \
bytecode-@BYTECODE_VERSION@.jar \
`find gnu/bytecode -name '*.class' -print`
kawa-@VERSION@-src.zip: kawa-@VERSION@.tar.gz
mkdir zip-temp
cd zip-temp ;\
tar xzf ../kawa-@VERSION@.tar.gz; \
zip -q -r ../kawa-@VERSION@-src.zip kawa-@VERSION@
rm -rf zip-temp
kawa-compiled.zip: kawa-@VERSION@-compiled.zip
kawa.jar: kawa-@VERSION@.jar
kawa-src.zip: kawa-@VERSION@-src.zip
jemacs.jar: jemacs-@JEMACS_VERSION@.jar
bytecode.jar: bytecode-@BYTECODE_VERSION@.jar
EXTRA_DIST = debian/control debian/rules debian/changelog debian/dirs \
config.guess config.sub install-sh ./mkinstalldirs \
patch-source-list selected-java-source \
build.xml build.properties \
gnu/jemacs/jar-manifest gnu/jemacs/status.html \
kawa/Version.java jar-manifest Make-rules classes-to-skip-for-runtime
MOSTLYCLEANFILES = tmp *.o kawa1$(exeext) *.stamp
CLEANFILES = *.jar kawa/Version.java $(META_ScriptEngineFactory)
HTML_HOME = $$HOME/public_html
JAVADOC_DIR = $$HOME/Kawa/api
JAVADOC_PACKAGES = \
gnu.bytecode gnu.ecmascript gnu.expr gnu.mapping gnu.math gnu.text gnu.lists\
gnu.xml gnu.kawa.reflect gnu.kawa.util gnu.kawa.lispexpr gnu.kawa.functions \
gnu.kawa.servlet gnu.kawa.ant kawa kawa.lang kawa.standard kawa.lib \
gnu.kawa.xml gnu.xquery.lang gnu.xquery.util gnu.brl gnu.kawa.brl \
gnu.kawa.xslt gnu.kawa.sax gnu.commonlisp.lang gnu.q2.lang \
gnu.kawa.models gnu.kawa.swingviews gnu.kawa.swtviews gnu.kawa.echo2 \
gnu.jemacs.lang gnu.jemacs.buffer gnu.jemacs.swing gnu.jemacs.swt \
gnu.kawa.android
JAVADOC = javadoc
JAVADOC_FLAGS = -use
#JAVADOC_FLAGS = -J-Xmx60m
# NOTE: To update javadoc:
# make install-javadoc-html
# When satisfied:
# make javadoc-cvs.log
# When satisfied:
# cd ~/Kawa/api && cvs ci -m 'Re-run javadoc.'
javadoc-cvs.log:
cd $(JAVADOC_DIR) \
&& find . -name CVS -prune -o -type f -exec echo rm '{}' ';'
$(MAKE) install-javadoc-html >&LOG.JAVADOC
(cd $(JAVADOC_DIR) && cvs -n update -d .>&/tmp/cvs-changes \
&& (grep '^[?] ' /tmp/cvs-changes |sed -e 's|[?] ||') >/tmp/cvs-adds \
&& (test '!' -s /tmp/cvs-adds || cvs add `cat /tmp/cvs-adds`) \
&& (grep '^[U] ' /tmp/cvs-changes |sed -e 's|[U] ||') >/tmp/cvs-rems\
&& (test '!' -s /tmp/cvs-rems || cvs remove `cat /tmp/cvs-rems`) \
&& cvs update -d .) >cvs-update.log
echo ExamineCheck ./cvs-update.log
echo then: "(cd $(JAVADOC_DIR) && cvs ci -m 'Re-run javadoc.')".
ECLIPSE_PLUGINS_PATH = /opt/eclipse/plugins
JAVADOC_ANT_JARS = $(ECLIPSE_PLUGINS_PATH)/org.apache.ant_1.6.5/lib/ant.jar
JAVADOC_ECLIPSE_JARS = $(ECLIPSE_PLUGINS_PATH)/org.eclipse.jface_3.1.0.jar:$(ECLIPSE_PLUGINS_PATH)/org.eclipse.swt.gtk.linux.x86_3.1.0.jar
JAVADOC_EXTRA_PATH = $(JAVADOC_ECLIPSE_JARS):$(JAVADOC_ANT_JARS)
install-javadoc-html:
-mkdir $(JAVADOC_DIR)
-#rm `find $(JAVADOC_DIR)/ -name CVS -prune -o '(' '!' -type d ')' -print`
-rm `find $(JAVADOC_DIR)/ -name '*.html'`
CLASSPATH=$(JAVADOC_EXTRA_PATH):@conf_classpath@$$CLASSPATH \
$(JAVADOC) $(JAVADOC_FLAGS) -sourcepath .:$(top_srcdir) -d $(JAVADOC_DIR) $(JAVADOC_PACKAGES)
cp $(srcdir)/COPYING $(JAVADOC_DIR)/COPYING
install-html: install-javadoc-html
cd doc; make install-html HTML_HOME="$(HTML_HOME)"
install-data-am: install-jar
install-jar:
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(javadir)
$(INSTALL_DATA) kawa-@VERSION@.jar \
$(DESTDIR)$(javadir)/kawa-@VERSION@.jar
cd $(DESTDIR)$(javadir) && rm -f kawa.jar \
&& $(LN_S) kawa-@VERSION@.jar kawa.jar
if WITH_GCJ_DBTOOL
$(GCJ_DBTOOL) -f $(DESTDIR)`$(GCJ_DBTOOL) -p` $(DESTDIR)$(javadir)/kawa-@VERSION@.jar $(libdir)/libkawa-$(VERSION).so
endif
install-bytecode-jar: bytecode-@BYTECODE_VERSION@.jar
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(javadir)
$(INSTALL_DATA) bytecode-@BYTECODE_VERSION@.jar \
$(DESTDIR)$(javadir)/bytecode-@BYTECODE_VERSION@.jar
cd $(DESTDIR)$(javadir) && rm -f bytecode.jar \
&& $(LN_S) bytecode-@BYTECODE_VERSION@.jar bytecode.jar
uninstall-local: uninstall-jar
uninstall-jar:
rm -f $(DESTDIR)$(javadir)/kawa-@VERSION@.jar \
$(DESTDIR)$(javadir)/kawa.jar
uninstall-bytecode-jar:
rm -f $(DESTDIR)$(javadir)/bytecode-@BYTECODE_VERSION@.jar \
$(DESTDIR)$(javadir)/bytecode.jar
kawa/Version.java: $(srcdir)/kawa/Version.java.in $(srcdir)/configure.in
test -f .svn/entries \
&& SVN_REVISION=`svnversion 2>/dev/null` \
&& test -n "$$SVN_REVISION" \
&& SVN_REVISION=" (revision $${SVN_REVISION})"; \
sed -e 's|VERSION|@VERSION@'"$$SVN_REVISION|" <$(srcdir)/kawa/Version.java.in >$@
all-recursive: kawa/Version.java selected-java-source
all: kawa-@VERSION@.jar kawart-@VERSION@.jar
JAVA_SOURCE = @JAVA_SOURCE@
if WITH_HTTPSERVER
PREPROCESS_HTTPSERVER = +use:com.sun.net.httpserver
else
PREPROCESS_HTTPSERVER = -use:com.sun.net.httpserver
endif
if ENABLE_XML
PREPROCESS_XML = +enable:XML
else
PREPROCESS_XML = -enable:XML
endif
selected-java-source: Makefile
@java_source=`cat $(srcdir)/selected-java-source 2>/dev/null || echo none`; \
if test "$$java_source" = "$(JAVA_SOURCE)"; \
then echo current java-source is ok; \
elif test "$(JAVA_SOURCE)" = 1; \
then $(MAKE) select-java1; \
elif test "$(JAVA_SOURCE)" = 2; \
then $(MAKE) select-java2; \
elif test "$(JAVA_SOURCE)" = 4; \
then $(MAKE) select-java4; \
elif test "$(JAVA_SOURCE)" = 4x; \
then $(MAKE) select-java4x; \
elif test "$(JAVA_SOURCE)" = 5; \
then $(MAKE) select-java5; \
elif test "$(JAVA_SOURCE)" = 6compat5; \
then $(MAKE) select-java6compat5; \
elif test "$(JAVA_SOURCE)" = 6; \
then $(MAKE) select-java6; \
elif test "$(JAVA_SOURCE)" = 7; \
then $(MAKE) select-java7; \
elif test "$(JAVA_SOURCE)" = android; \
then $(MAKE) select-android; \
else echo Unrecognized JAVA_SOURCE: $(JAVA_SOURCE); exit 1; \
fi
$(srcdir)/patch-source-list:
(cd $(srcdir); \
find . -name '*.java' -exec grep -lE ' #endif ' '{}' ';') \
| sed -e 's|./||' | sort > $@
COMMENT_IN = s|^\([[:space:]]*\)//[ ]*|\1|
COMMENT_OUT = s|^\([[:space:]]*\)\([^/[:space:]]\)|\1// \2|
gnu/kawa/util/PreProcess.class: $(srcdir)/gnu/kawa/util/PreProcess.java
$(JAVAC) -d . $(srcdir)/gnu/kawa/util/PreProcess.java
# JDK 1.1
select-java1: $(srcdir)/patch-source-list gnu/kawa/util/PreProcess.class
$(MAKE) do-preprocess SELECTOR='%java1'
# JDK 1.2+, GCJ-3.x
select-java2: $(srcdir)/patch-source-list gnu/kawa/util/PreProcess.class
$(MAKE) do-preprocess SELECTOR='%java2'
# JDK 1.4, GCJ-4.x, without JAXP
select-java4: $(srcdir)/patch-source-list gnu/kawa/util/PreProcess.class
$(MAKE) do-preprocess SELECTOR='%java4'
# JDK 1.4, GCJ-4.x with JAXP 1.3
select-java4x: $(srcdir)/patch-source-list gnu/kawa/util/PreProcess.class
$(MAKE) do-preprocess SELECTOR='%java4x'
# JDK 1.5 (default - matches SVN)
select-java5: $(srcdir)/patch-source-list gnu/kawa/util/PreProcess.class
$(MAKE) do-preprocess SELECTOR='%java5'
# JDK 1.5 with some Java6 features.
# Requires building with Java6, but runs on Java5 (without those features)
# or on Java6 (with those features).
select-java6compat5: $(srcdir)/patch-source-list gnu/kawa/util/PreProcess.class
$(MAKE) do-preprocess SELECTOR='%java6compat5'
# JDK 1.6
select-java6: $(srcdir)/patch-source-list gnu/kawa/util/PreProcess.class
$(MAKE) do-preprocess SELECTOR='%java6'
# JDK 1.7
select-java7: $(srcdir)/patch-source-list gnu/kawa/util/PreProcess.class
$(MAKE) do-preprocess SELECTOR='%java7'
# Android
select-android: $(srcdir)/patch-source-list gnu/kawa/util/PreProcess.class
$(MAKE) do-preprocess SELECTOR='%android'
do-preprocess:
CLASSPATH=.:$$CLASSPATH $(JAVA) gnu.kawa.util.PreProcess \
$(SELECTOR) $(PREPROCESS_HTTPSERVER) $(PREPROCESS_XML) \
`sed -e 's|\([^ ]*\)|$(srcdir)/\1|' < $(srcdir)/patch-source-list`
$(MAKE) set-selected-java-source JAVA_SOURCE=$(JAVA_SOURCE)
set-selected-java-source:
if test ! -e $(srcdir)/selected-java-source || \
test "$(JAVA_SOURCE)" != "`cat $(srcdir)/selected-java-source`"; \
then echo "$(JAVA_SOURCE)" >$(srcdir)/selected-java-source; \
fi
distall: distcheck dist-kawa-@VERSION@.jar kawa-doc-$(VERSION).tar.gz
# Consider also:
# kawa-@VERSION@-src.zip jemacs-@JEMACS_VERSION@.jar bytecode-@BYTECODE_VERSION@.jar