OSDN Git Service

* configure, Makefile.in: Rebuilt.
[pf3gnuchains/gcc-fork.git] / libjava / Makefile.am
1 ## Process this file with automake to produce Makefile.in.
2
3 AUTOMAKE_OPTIONS = foreign subdir-objects
4
5 ACLOCAL_AMFLAGS = -I . -I .. -I ../config
6
7 # May be used by various substitution variables.
8 gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
9
10 SUBDIRS = $(DIRLTDL) gcj include classpath
11 if TESTSUBDIR
12 SUBDIRS += testsuite
13 endif
14
15 # write_entries_to_file - writes each entry in a list
16 # to the specified file. Each entry is written individually
17 # to accomodate systems with severe command-line-length
18 # limitations.
19 # Parameters:
20 # $(1): variable containing entries to iterate over
21 # $(2): output file
22 write_entries_to_file = $(shell rm -f $(2) || :) $(shell touch $(2)) $(foreach object,$(1),$(shell echo $(object) >> $(2)))
23
24 ## ################################################################
25
26 # autoconf2.13's target_alias
27 target_noncanonical = @target_noncanonical@
28
29 # This is required by TL_AC_GXX_INCLUDE_DIR.
30 libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
31
32 libexecsubdir = $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
33
34 ##
35 ## What gets installed, and where.
36 ##
37
38 toolexeclib_LTLIBRARIES = libgcj.la libgij.la libgcj-tools.la
39 toolexecmainlib_DATA = libgcj.spec
40
41 if USE_LIBGCJ_BC
42 toolexeclib_LTLIBRARIES += libgcj_bc.la
43 endif
44
45 if XLIB_AWT
46 toolexeclib_LTLIBRARIES += lib-gnu-awt-xlib.la
47 endif
48
49 dbexec_LTLIBRARIES = libjvm.la
50
51 pkgconfigdir = $(libdir)/pkgconfig
52
53 jardir = $(datadir)/java
54 jar_DATA = libgcj-$(gcc_version).jar libgcj-tools-$(gcc_version).jar
55 if INSTALL_ECJ_JAR
56 jar_DATA += $(ECJ_BUILD_JAR)
57 endif
58
59 if JAVA_HOME_SET
60 JAVA_HOME_DIR = $(JAVA_HOME)
61 BOOT_CLASS_PATH_DIR = $(JAVA_HOME)/lib/rt.jar
62 else
63 JAVA_HOME_DIR = $(prefix)
64 BOOT_CLASS_PATH_DIR = $(jardir)/libgcj-$(gcc_version).jar
65 endif
66
67 ## Name of the default .db.
68 db_name = classmap.db
69 ## Compiler specific component of the .db file
70 db_pathtail = gcj-$(gcc_version)/$(db_name)
71
72 ## For now, only on native systems.  FIXME.
73 if NATIVE
74 bin_PROGRAMS = jv-convert gij grmic grmiregistry gcj-dbtool \
75         gappletviewer gjarsigner gkeytool gjar gjavah gnative2ascii \
76         gorbd grmid gserialver gtnameserv
77
78 ## It is convenient to actually build and install the default database
79 ## when gcj-dbtool is available.
80 dbexec_DATA = $(db_name)
81 endif
82
83 bin_SCRIPTS = addr2name.awk
84
85 if BUILD_ECJ1
86 ## We build ecjx and not ecj1 because in one mode, ecjx will not work
87 ## until after 'make install', and we don't want it to be picked up in
88 ## the build tree by gcj via a -B option.
89 libexecsub_PROGRAMS = ecjx
90 endif
91
92 ## ################################################################
93
94 ##
95 ## Compilers and compilation flags.
96 ##
97
98 ## The compiler with whatever flags we want for both -c and -C
99 ## compiles.
100 GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8 -Wno-deprecated
101
102 extra_ldflags_libjava = @extra_ldflags_libjava@
103
104 GCJLINK = $(LIBTOOL) --tag=GCJ --mode=link $(GCJ) -L$(here) $(JC1FLAGS) \
105           $(LDFLAGS) -o $@
106 GCJ_FOR_ECJX = @GCJ_FOR_ECJX@
107 GCJ_FOR_ECJX_LINK = $(GCJ_FOR_ECJX) -o $@
108 LIBLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXX) -L$(here) $(JC1FLAGS) \
109           $(LDFLAGS) $(extra_ldflags_libjava) -o $@
110
111 GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE@
112
113 WARNINGS = -Wextra -Wall
114 ## Some systems don't allow `$' in identifiers by default, so we force
115 ## it with -fdollars-in-identifiers.  -Wswitch-enum detects bugs in
116 ## the verifier implementation, and maybe other places.  We need
117 ## _GNU_SOURCE defined for some Linux builds.  It doesn't hurt to
118 ## always define it.  Some systems, including Linux, need
119 ## -D_FILE_OFFSET_BITS=64 to enable > 2GB file support.
120 AM_CXXFLAGS = \
121         -fno-rtti \
122         -fnon-call-exceptions \
123         $(THREADCXXFLAGS) \
124         -fdollars-in-identifiers \
125         -Wswitch-enum \
126         -D_FILE_OFFSET_BITS=64 \
127         @LIBGCJ_CXXFLAGS@ \
128         $(WARNINGS) \
129         -D_GNU_SOURCE \
130         -DPREFIX="\"$(prefix)\"" \
131         -DTOOLEXECLIBDIR="\"$(toolexeclibdir)\"" \
132         -DJAVA_HOME="\"$(JAVA_HOME_DIR)\"" \
133         -DBOOT_CLASS_PATH="\"$(BOOT_CLASS_PATH_DIR)\"" \
134         -DJAVA_EXT_DIRS="\"$(jardir)/ext\"" \
135         -DGCJ_ENDORSED_DIRS="\"$(jardir)/gcj-endorsed\"" \
136         -DGCJ_VERSIONED_LIBDIR="\"$(dbexecdir)\"" \
137         -DPATH_SEPARATOR="\"$(CLASSPATH_SEPARATOR)\"" \
138         -DLIBGCJ_DEFAULT_DATABASE="\"$(dbexecdir)/$(db_name)\"" \
139         -DLIBGCJ_DEFAULT_DATABASE_PATH_TAIL="\"$(db_pathtail)\""
140
141 AM_GCJFLAGS = \
142         @LIBGCJ_JAVAFLAGS@ \
143         -fclasspath= -fbootclasspath=$(BOOTCLASSPATH) \
144         --encoding=UTF-8 \
145         -Wno-deprecated -fbootstrap-classes
146
147 AM_CFLAGS = @LIBGCJ_CFLAGS@
148 if USING_GCC
149 AM_CFLAGS += $(WARNINGS)
150 endif
151
152 ## Extra CFLAGS used for JNI C sources shared with GNU Classpath.
153 PEDANTIC_CFLAGS = -ansi -pedantic -Wall -Wno-long-long
154
155 JCFLAGS = -g
156 JC1FLAGS = @LIBGCJ_JAVAFLAGS@ $(GCJFLAGS)
157
158 LIBFFIINCS = @LIBFFIINCS@
159
160 AM_CPPFLAGS = -I$(top_srcdir) \
161         -Iinclude -I$(top_srcdir)/include \
162         -I$(top_srcdir)/classpath/include \
163         -Iclasspath/include \
164         -I$(top_srcdir)/classpath/native/fdlibm \
165         $(GCINCS) $(THREADINCS) $(INCLTDL) \
166         $(GCC_UNWIND_INCLUDE) $(ZINCS) $(LIBFFIINCS)
167
168 BOOTCLASSPATH = $(srcdir)/classpath/lib
169
170 ## ################################################################
171
172 ##
173 ## How to build libgcj.a and libgcj.jar
174 ##
175
176 libgij_la_SOURCES = gij.cc
177 libgij_la_DEPENDENCIES = libgcj.la libgcj.spec
178 ## See jv_convert_LDADD.
179 libgij_la_LIBADD = -L$(here)/.libs libgcj.la
180 ## The mysterious backslash in the grep pattern is consumed by make.
181 libgij_la_LDFLAGS = -rpath $(toolexeclibdir) \
182         -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
183
184 libgcj_la_SOURCES = prims.cc jni.cc jvmti.cc exception.cc stacktrace.cc \
185         link.cc defineclass.cc interpret.cc verify.cc \
186         $(nat_source_files)
187
188 ## We need to compile at least the interpreter this way.
189 interpret.lo:  AM_CXXFLAGS += -fwrapv
190
191 if USING_BOEHMGC
192 libgcj_la_SOURCES += boehm.cc
193 endif
194
195 if USING_NOGC
196 libgcj_la_SOURCES += nogc.cc
197 endif
198
199 if USING_POSIX_PLATFORM
200 libgcj_la_SOURCES += posix.cc
201 endif
202
203 if USING_WIN32_PLATFORM
204 libgcj_la_SOURCES += win32.cc
205 endif
206
207 if USING_DARWIN_CRT
208 libgcj_la_SOURCES += darwin.cc
209 endif
210
211 if USING_POSIX_THREADS
212 libgcj_la_SOURCES += posix-threads.cc
213 endif
214
215 if USING_WIN32_THREADS
216 libgcj_la_SOURCES += win32-threads.cc
217 endif
218
219 if USING_NO_THREADS
220 libgcj_la_SOURCES += no-threads.cc
221 endif
222
223 ## Objects from C++ sources in subdirs.
224 nat_files = $(nat_source_files:.cc=.lo)
225 xlib_nat_files = $(xlib_nat_source_files:.cc=.lo)
226
227 # Include THREADLIBS here to ensure that the correct version of
228 # certain linuxthread functions get linked:
229 ## The mysterious backslash in the grep pattern is consumed by make.
230 libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLDFLAGS) $(THREADLIBS) \
231         $(LIBLTDL) $(SYS_ZLIBS) \
232         -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
233         $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
234 libgcj_la_LIBADD = \
235         classpath/native/fdlibm/libfdlibm.la \
236         java/lang/Object.lo \
237         java/lang/Class.lo \
238         java/process-$(PLATFORM).lo \
239         $(all_packages_source_files:.list=.lo) \
240         $(bc_objects) \
241         $(propertyo_files) \
242         $(LIBFFI) $(ZLIBS) $(GCLIBS)
243 libgcj_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
244         java/lang/Object.lo \
245         java/lang/Class.lo \
246         java/process-$(PLATFORM).lo \
247         $(all_packages_source_files:.list=.lo) \
248         $(LIBLTDL) $(libgcj_la_LIBADD)
249 libgcj_la_LINK = $(LIBLINK)
250
251 ## A hack to make sure the various gcj-related macros, like
252 ## LTGCJCOMPILE, are defined by automake.  This is never actually
253 ## compiled.
254 EXTRA_libgcj_la_SOURCES = java/lang/Object.java
255
256 libgcj_tools_la_SOURCES = classpath/tools/tools.zip
257 libgcj_tools_la_GCJFLAGS = $(AM_GCJFLAGS) -findirect-dispatch -fno-indirect-classes  -fsource-filename=$(here)/classpath/tools/all-classes.lst
258 libgcj_tools_la_LDFLAGS = -rpath $(toolexeclibdir) \
259  -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
260  $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
261 libgcj_tools_la_DEPENDENCIES = libgcj.la libgcj.spec
262 libgcj_tools_la_LINK = $(LIBLINK)
263
264 ## libjvm.so
265 libjvm_la_SOURCES = jni-libjvm.cc
266 libjvm_la_DEPENDENCIES = libgcj.la libgcj.spec
267 ## See jv_convert_LDADD.
268 libjvm_la_LIBADD = -L$(here)/.libs libgcj.la
269 libjvm_la_LDFLAGS = -avoid-version $(LIBGCJ_LD_SYMBOLIC)
270
271 ## The .db file.  This rule is only used for native builds, so it is
272 ## safe to invoke gcj-dbtool.
273 $(db_name): gcj-dbtool$(EXEEXT)
274 ## In case it exists already.
275         @rm -f $(db_name)
276 ## We don't actually care if it fails -- if it does, just make an
277 ## empty file.  This is simpler than trying to discover when mmap is
278 ## not available.
279         ./gcj-dbtool -n $(db_name) || touch $(db_name)
280
281 lib_gnu_awt_xlib_la_SOURCES = $(xlib_nat_source_files)
282 lib_gnu_awt_xlib_la_LIBADD = gnu/awt/xlib.lo gnu/gcj/xlib.lo
283 lib_gnu_awt_xlib_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
284         libgcj.la libgcj.spec \
285         $(lib_gnu_awt_xlib_la_LIBADD)
286 ## We require libstdc++-v3 to be in the same build tree.
287 lib_gnu_awt_xlib_la_CPPFLAGS = \
288         $(AM_CPPFLAGS) \
289         -I../libstdc++-v3/include \
290         -I../libstdc++-v3/include/$(target_noncanonical) \
291         -I$(srcdir)/../libstdc++-v3/libsupc++
292 ## The mysterious backslash in the grep pattern is consumed by make.
293 lib_gnu_awt_xlib_la_LDFLAGS = ../libstdc++-v3/src/libstdc++.la \
294         @X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ \
295         -rpath $(toolexeclibdir) \
296         -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
297 lib_gnu_awt_xlib_la_LINK = $(LIBLINK)
298
299 ## Support for libgcj_bc: dummy shared library.
300 ##
301 ## This lets us have one soname in BC objects and another in C++ ABI objects.
302 libgcj_bc_la_SOURCES = libgcj_bc.c
303 libgcj_bc_la_LDFLAGS = -rpath $(toolexeclibdir) -no-static -version-info 1:0:0 \
304         $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
305 libgcj_bc_la_LIBADD = libgcj.la
306 libgcj_bc_la_DEPENDENCIES = libgcj.la
307 libgcj_bc_la_LINK = $(LIBLINK)
308 ## This is specific to Linux/{Free,Net,Open}BSD/Hurd and perhaps few others.
309 ## USE_LIBGCJ_BC shouldn't be set on other targets.
310 libgcj_bc_dummy_LINK = $(CC) -L$(here)/.libs $(CFLAGS) $(LDFLAGS) -shared \
311         -fPIC -nostdlib
312
313 ## This rule creates the libgcj_bc dummy library in the .libs directory, for use
314 ## when testing.
315 libgcj_bc.la: $(libgcj_bc_la_OBJECTS) $(libgcj_bc_la_DEPENDENCIES)
316         $(libgcj_bc_la_LINK) $(am_libgcj_bc_la_rpath) $(libgcj_bc_la_LDFLAGS) \
317         $(libgcj_bc_la_OBJECTS) $(libgcj_bc_la_LIBADD) $(LIBS) || exit; \
318         rm .libs/libgcj_bc.so; \
319         mv .libs/libgcj_bc.so.1.0.0 .libs/libgcj_bc.so; \
320         $(libgcj_bc_dummy_LINK) -xc /dev/null -Wl,-soname,libgcj_bc.so.1 \
321         -o .libs/libgcj_bc.so.1.0.0 -lgcj || exit; \
322         rm .libs/libgcj_bc.so.1; \
323         $(LN_S) libgcj_bc.so.1.0.0 .libs/libgcj_bc.so.1
324
325 ## Note that property_files is defined in sources.am.
326 propertyo_files = $(patsubst classpath/resource/%,%,$(addsuffix .lo,$(property_files)))
327
328 $(propertyo_files): %.lo: classpath/resource/%
329         $(mkinstalldirs) `dirname $@`; \
330         $(LTGCJCOMPILE) -o $@ -c $< -Wc,--resource,$(@:.lo=)
331
332 libgcj-$(gcc_version).jar: classpath/lib/compile-classes
333 ## Note that this now omits the property files.
334 ## It doesn't matter since we don't use the jar at runtime.
335         here=`pwd`; cd $(srcdir)/classpath/lib; $(JAR) -cfM \
336             $$here/libgcj-$(gcc_version).jar gnu java javax org sun
337
338 libgcj-tools-$(gcc_version).jar: classpath/tools/tools.zip
339         cp $< $@
340
341 CLEANFILES = libgcj-$(gcc_version).jar libgcj-tools-$(gcc_version).jar
342 DISTCLEANFILES = native.dirs
343
344 mostlyclean-local:
345 ## Use libtool rm to remove each libtool object
346         find . -name '*.lo' -print | xargs $(LIBTOOL) rm -f
347
348 distclean-local:
349 ## Remove every .d file that was created.
350         find . -name '*.d' -print | xargs rm -f
351
352 # Just remove the objects from C++ sources, for testing the C++ compiler.
353 clean-nat:
354         rm -f $(nat_files) $(xlib_nat_files)
355
356 SUFFIXES = .class .java .h .properties .list
357
358 ## Pass the list of object files to libtool in a temporary file to
359 ## avoid tripping platform command line length limits.
360 lib-gnu-awt-xlib.la: $(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_DEPENDENCIES)
361         @echo Creating list of files to link...
362         @: $(call write_entries_to_file,$(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_LIBADD),lib_gnu_awt_xlib.objectlist)
363         $(lib_gnu_awt_xlib_la_LINK) -objectlist lib_gnu_awt_xlib.objectlist \
364         -rpath $(toolexeclibdir) $(lib_gnu_awt_xlib_la_LDFLAGS) $(LIBS)
365
366 ## ################################################################
367
368 ## Compiling a list of java sources to a single .o.
369
370 %.lo: %.list
371         $(LTGCJCOMPILE) -c -o $@ -fsource-filename=$(here)/classpath/lib/classes -MT $@ -MD -MP -MF $(basename $@).deps @$<
372
373 java/lang/Object.lo: classpath/lib/java/lang/Object.class
374         $(LTGCJCOMPILE) -c -o $@ -fsource-filename=$(srcdir)/$(basename $@).java $<
375
376 java/lang/Class.lo: classpath/lib/java/lang/Class.class
377         $(LTGCJCOMPILE) -c -o $@  -fsource-filename=$(srcdir)/$(basename $@).java $<
378
379 ## ################################################################
380
381 ## This pulls in a number of variable and target definitions.
382 include sources.am
383
384 ## ################################################################
385
386 ##
387 ## How to build header files.
388 ##
389
390 ## We have special rules for certain headers.
391 omitted_headers = java/lang/ClassLoader.h java/lang/Thread.h \
392         java/lang/String.h java/lang/reflect/Constructor.h \
393         java/lang/reflect/Field.h java/lang/reflect/Method.h \
394         java/lang/reflect/Proxy.h gnu/gcj/runtime/ExtensionClassLoader.h
395
396 inner_nat_headers = java/io/ObjectOutputStream$$PutField.h \
397         java/io/ObjectInputStream$$GetField.h \
398         java/nio/DirectByteBufferImpl$$ReadWrite.h \
399         java/nio/channels/Pipe$$SinkChannel.h \
400         java/nio/channels/Pipe$$SourceChannel.h \
401         java/lang/reflect/Proxy$$ProxyData.h \
402         java/lang/reflect/Proxy$$ProxyType.h \
403         gnu/java/net/PlainSocketImpl$$SocketInputStream.h \
404         gnu/java/net/PlainSocketImpl$$SocketOutputStream.h \
405         gnu/java/nio/PipeImpl$$SinkChannelImpl.h \
406         gnu/java/nio/PipeImpl$$SourceChannelImpl.h
407
408 generic_header_files = $(ordinary_header_files) $(inner_nat_headers) \
409         $(xlib_nat_headers)
410
411 MYGCJH = gjavah
412
413 $(generic_header_files): gcjh.stamp
414
415 gcjh.stamp: classpath/lib/compile-classes
416 if JAVA_MAINTAINER_MODE
417         $(MYGCJH) --cni --all $(srcdir)/classpath/lib \
418             --cmdfile=$(srcdir)/headers.txt -d $(srcdir) --force
419 endif
420         echo > gcjh.stamp
421
422 nat_headers = $(ordinary_header_files) $(inner_nat_headers)
423 nat_headers_install = $(ordinary_header_files)
424
425 xlib_nat_headers = $(gnu_awt_xlib_header_files) $(gnu_gcj_xlib_header_files)
426
427 ## Headers we maintain by hand and which we want to install.
428 extra_headers = java/lang/Object.h java/lang/Class.h
429
430 $(extra_headers) $(srcdir)/java/lang/Object.h $(srcdir)/java/lang/Class.h:
431         @:
432
433 install-exec-hook: install-toolexeclibLTLIBRARIES install-libexecsubPROGRAMS
434 ## Support for libgcj_bc: dummy shared library used only at link-time.
435 if USE_LIBGCJ_BC
436 ## Install libgcj_bc dummy lib in the target directory. We also need to delete
437 ## libtool's .la file, this prevents libtool resetting the lib again 
438 ## later.
439         @echo Installing dummy lib libgcj_bc.so.1.0.0; \
440         rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \
441         mv $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0 $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \
442         $(libgcj_bc_dummy_LINK) -xc /dev/null -Wl,-soname,libgcj_bc.so.1 \
443         -o $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0 -lgcj || exit; \
444         rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1; \
445         $(LN_S) libgcj_bc.so.1.0.0 $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1; \
446         rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.la;
447 endif
448 if BUILD_ECJ1
449 if NATIVE
450         mv $(DESTDIR)$(libexecsubdir)/`echo ecjx | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` $(DESTDIR)$(libexecsubdir)/ecj1$(host_exeext)
451 else !NATIVE
452 ## Undo the prepending of the target prefix
453         mv $(DESTDIR)$(libexecsubdir)/$(target_noncanonical)-`echo ecjx | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` $(DESTDIR)$(libexecsubdir)/ecj1$(host_exeext)
454 endif !NATIVE
455 endif BUILD_ECJ1
456
457 ## Install the headers.  It is fairly ugly that we have to do this by
458 ## hand.
459 install-data-local:
460         $(PRE_INSTALL)
461 ## Install the .pc file.
462         @pc_version=`echo $(GCJVERSION) | sed -e 's/[.][^.]*$$//'`; \
463         file="libgcj-$${pc_version}.pc"; \
464         $(mkinstalldirs) $(DESTDIR)$(pkgconfigdir); \
465         echo "  $(INSTALL_DATA) libgcj.pc $(DESTDIR)$(pkgconfigdir)/$$file"; \
466         $(INSTALL_DATA) libgcj.pc $(DESTDIR)$(pkgconfigdir)/$$file
467 ## We use a GNU make trick here so that we don't go over the command
468 ## length limit of some shells.
469         @echo Creating list of headers to install...
470         @: $(call write_entries_to_file,$(nat_headers_install) $(extra_headers),tmp-ilist)
471         @cat tmp-ilist | while read f; do \
472           d="`echo $$f | sed -e 's,/[^/]*$$,,'`"; \
473           $(mkinstalldirs) $(DESTDIR)$(gxx_include_dir)/$$d; \
474           if test -f $(srcdir)/$$f; then p=$(srcdir)/$$f; else p=$$f; fi; \
475           echo " $(INSTALL_DATA) $$p $(DESTDIR)$(gxx_include_dir)/$$f"; \
476           $(INSTALL_DATA) $$p $(DESTDIR)$(gxx_include_dir)/$$f; \
477         done
478         -@rm -f tmp-ilist
479 ## Install inner class headers.
480         $(INSTALL_DATA) $(srcdir)/'java/io/ObjectOutputStream$$PutField.h' $(DESTDIR)$(gxx_include_dir)/java/io/
481         $(INSTALL_DATA) $(srcdir)/'java/io/ObjectInputStream$$GetField.h' $(DESTDIR)$(gxx_include_dir)/java/io/
482         $(INSTALL_DATA) $(srcdir)/'java/nio/channels/Pipe$$SinkChannel.h' $(DESTDIR)$(gxx_include_dir)/java/nio/channels/
483         $(INSTALL_DATA) $(srcdir)/'java/nio/channels/Pipe$$SourceChannel.h' $(DESTDIR)$(gxx_include_dir)/java/nio/channels/
484         $(INSTALL_DATA) $(srcdir)/'java/lang/reflect/Proxy$$ProxyData.h' $(DESTDIR)$(gxx_include_dir)/java/lang/reflect/
485         $(INSTALL_DATA) $(srcdir)/'java/lang/reflect/Proxy$$ProxyType.h' $(DESTDIR)$(gxx_include_dir)/java/lang/reflect/
486         $(INSTALL_DATA) $(srcdir)/'gnu/java/net/PlainSocketImpl$$SocketInputStream.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/net/
487         $(INSTALL_DATA) $(srcdir)/'gnu/java/net/PlainSocketImpl$$SocketOutputStream.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/net/
488         $(INSTALL_DATA) $(srcdir)/'gnu/java/nio/PipeImpl$$SinkChannelImpl.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/nio/
489         $(INSTALL_DATA) $(srcdir)/'gnu/java/nio/PipeImpl$$SourceChannelImpl.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/nio/
490 ## Don't install java/nio/DirectByteBufferImpl$$ReadWrite.h here. It's for internal use only.
491
492
493 ## ################################################################
494
495 ##
496 ## Additional `check' targets for maintainer convenience.
497 ##
498
499 ## This is used for maintainer-check.  FIXME: should set from
500 ## configure using AC_CHECK_TOOL.
501 NM = nm
502
503 ## Try to make sure our library doesn't stomp the namespace.
504 maintainer-check: libgcj.la
505         $(NM) .libs/libgcj.a | grep ' T ' \
506 ## Anything with `4java' is assumed to be from .java source.
507           | grep -v '4java' \
508 ## Anything with Jv is ok.
509           | grep -v 'Jv' \
510 ## `terminate' and `unexpected' are part of the runtime.
511           | grep -v 'terminate__Fv' | grep -v 'unexpected__Fv'
512
513 ## This rule can be used to see if the headers are more or less
514 ## correct.
515 header-check: libgcj-$(gcc_version).jar $(nat_headers)
516         rm -f htest.cc; \
517         for h in $(nat_headers); do \
518           echo "#include \"$$h\"" >> htest.cc; \
519         done; \
520         $(CXXCOMPILE) -fsyntax-only htest.cc
521
522 ## This rule can be used to see if all the .class files verify
523 ## correctly.
524 class-check: libgcj-$(gcc_version).jar
525         @ok=0; find . -name '*.class' -print | fgrep -v testsuite | \
526         while read f; do \
527           echo "$(GCJ_WITH_FLAGS) --syntax-only $$f"; \
528           if $(GCJ_WITH_FLAGS) --syntax-only $$f; then \
529           :; else ok=1; fi; \
530         done; exit $$ok
531
532 ## This rule checks whether write_entries_to_file works properly.
533 write-entries-to-file-check:
534         @echo Creating list of files to link...
535         @: $(call write_entries_to_file,$(libgcj_la_OBJECTS) $(libgcj_la_LIBADD),libgcj.objectlist)
536
537 ## ################################################################
538
539 ##
540 ## The `jv-convert' program and code to rebuild the converter header
541 ## files.
542 ##
543
544 ## it only makes sense to try to rebuild the JIS .h files on native
545 ## systems.
546 if NATIVE
547 if MAINTAINER_MODE
548 noinst_PROGRAMS = gen-from-JIS
549
550 gen_from_JIS_SOURCES = \
551         gnu/gcj/convert/gen-from-JIS.c \
552         gnu/gcj/convert/make-trie.c
553
554 gen_from_JIS_DEPENDENCIES = \
555         gnu/gcj/convert/JIS0201.h \
556         gnu/gcj/convert/JIS0208.h \
557         gnu/gcj/convert/JIS0212.h
558
559 $(srcdir)/gnu/gcj/convert/JIS0208_to_Unicode.cc: ./gen-from-JIS$(EXEEXT)
560          ./gen-from-JIS JIS0208 >$(srcdir)/gnu/gcj/convert/JIS0208_to_Unicode.cc
561
562 $(srcdir)/gnu/gcj/convert/JIS0212_to_Unicode.cc: ./gen-from-JIS$(EXEEXT)
563          ./gen-from-JIS JIS0212 >$(srcdir)/gnu/gcj/convert/JIS0212_to_Unicode.cc
564
565 $(srcdir)/gnu/gcj/convert/Unicode_to_JIS.cc: ./gen-from-JIS$(EXEEXT)
566          ./gen-from-JIS toJIS >$(srcdir)/gnu/gcj/convert/Unicode_to_JIS.cc
567
568 # The Unicode consortium does not permit re-distributing the file JIS0201.TXT.
569 # You can get it from
570 # ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/
571
572 $(srcdir)/gnu/gcj/convert/JIS0201.h: # gnu/gcj/convert/JIS0201.TXT
573         echo '/* This file is automatically generated from Unicode tables */' > tmp-0201; \
574         tr  -d '\r' <$(srcdir)/gnu/gcj/convert/JIS0201.TXT \
575         | sed -n -e 's|\(0x..\).*\(0x....\).*#\(.*\)$$|MAP(0x00, \1, \2)  /*\3 */|p' \
576         >> tmp-0201; \
577         mv tmp-0201 $(srcdir)/gnu/gcj/convert/JIS0201.h
578
579 # The Unicode consortium does not permit re-distributing the file JIS0208.TXT.
580 # You can get it from
581 # ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/
582
583 $(srcdir)/gnu/gcj/convert/JIS0208.h: # gnu/gcj/convert/JIS0208.TXT
584         echo '/* This file is automatically generated from Unicode tables */' > tmp-0208; \
585         tr  -d '\r' <$(srcdir)/gnu/gcj/convert/JIS0208.TXT \
586         | sed -n -e 's|\(0x....\).*0x\(..\)\(..\).*\(0x....\).*#\(.*\)$$|MAP(0x\2, 0x\3, \4)  /*\5 */|p' \
587         >> tmp-0208; \
588         mv tmp-0208 $(srcdir)/gnu/gcj/convert/JIS0208.h
589
590 # The Unicode consortium does not permit re-distributing the file JIS0212.TXT.
591 # You can get it from
592 # ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/
593
594 $(srcdir)/gnu/gcj/convert/JIS0212.h: # gnu/gcj/convert/JIS0212.TXT
595         echo '/* This file is automatically generated from Unicode tables */' > tmp-0212; \
596         tr  -d '\r' <$(srcdir)/gnu/gcj/convert/JIS0212.TXT \
597         | sed -n -e 's|0x\(..\)\(..\).*\(0x....\).*#\(.*\)$$|MAP(0x\1, 0x\2, \3)  /*\4 */|p' \
598         >> tmp-0212; \
599         mv tmp-0212 $(srcdir)/gnu/gcj/convert/JIS0212.h
600
601 endif
602 endif 
603
604
605 jv_convert_SOURCES =
606 ## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'.  We
607 ## need this because we are explicitly using libtool to link using the
608 ## `.la' file.
609 jv_convert_LDFLAGS = --main=gnu.gcj.convert.Convert \
610         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
611 jv_convert_LINK = $(GCJLINK)
612 ## We don't explicitly link in the libraries we need; libgcj.la brings
613 ## in all dependencies.  We need the -L so that gcj can find libgcj
614 ## with `-lgcj', but it must come first, otherwise the -L flags
615 ## brought in from libgcj.la would cause the install directories to be
616 ## searched before the build-tree ones, and we'd get errors because of
617 ## different libraries with the same SONAME from picky linkers such as
618 ## Solaris'.  FIXME: should be _libs on some systems.
619 jv_convert_LDADD = -L$(here)/.libs libgcj.la
620 ## Depend on the spec file to make sure it is up to date before
621 ## linking this program.
622 jv_convert_DEPENDENCIES = libgcj.la libgcj.spec
623
624 gcj_dbtool_SOURCES = \
625 gnu/gcj/tools/gcj_dbtool/natMain.cc
626
627 ## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'.  We
628 ## need this because we are explicitly using libtool to link using the
629 ## `.la' file.
630 gcj_dbtool_LDFLAGS = --main=gnu.gcj.tools.gcj_dbtool.Main \
631         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
632 gcj_dbtool_LINK = $(GCJLINK)
633 ## We don't explicitly link in the libraries we need; libgcj.la brings
634 ## in all dependencies.  We need the -L so that gcj can find libgcj
635 ## with `-lgcj', but it must come first, otherwise the -L flags
636 ## brought in from libgcj.la would cause the install directories to be
637 ## searched before the build-tree ones, and we'd get errors because of
638 ## different libraries with the same SONAME from picky linkers such as
639 ## Solaris'.  FIXME: should be _libs on some systems.
640 gcj_dbtool_LDADD = gnu/gcj/tools/gcj_dbtool.lo -L$(here)/.libs libgcj.la
641 ## Depend on the spec file to make sure it is up to date before
642 ## linking this program.
643 gcj_dbtool_DEPENDENCIES = gnu/gcj/tools/gcj_dbtool.lo libgcj.la libgcj.spec
644
645 gij_SOURCES = 
646 ## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'.  We
647 ## need this because we are explicitly using libtool to link using the
648 ## `.la' file.
649 gij_LDFLAGS = -rpath $(libdir)/gcj-$(gcc_version) -rpath $(toolexeclibdir) \
650         -shared-libgcc $(THREADLDFLAGS)
651 gij_LINK = $(GCJLINK)
652 ## See jv_convert_LDADD.
653 gij_LDADD = -L$(here)/.libs libgij.la
654 ## Depend on the spec file to make sure it is up to date before
655 ## linking this program.
656 gij_DEPENDENCIES = libgij.la
657
658 ## Build an ecjx from a .jar.
659 ecjx_SOURCES =
660 ## We use the BC ABI here so that we don't need to compile ecj.jar.
661 ## Hopefully the user has compiled it into his system .db.
662 ## However, even if not it will run reasonably quickly.
663
664 ECJX_BASE_FLAGS = -findirect-dispatch \
665         --main=org.eclipse.jdt.internal.compiler.batch.GCCMain
666
667 if NATIVE
668
669 ecjx_LINK = $(GCJLINK)
670
671 if ENABLE_SHARED
672 ## Use ecj.jar at runtime.
673 ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) -Djava.class.path=$(ECJ_JAR)
674 else !ENABLE_SHARED
675 ## Use ecj.jar at compile time.
676 ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) $(ECJ_BUILD_JAR) -fbootclasspath=$(BOOTCLASSPATH)
677 endif !ENABLE_SHARED
678
679 ecjx_LDADD = -L$(here)/.libs libgcj.la
680 ecjx_DEPENDENCIES = libgcj.la libgcj.spec
681 if USE_LIBGCJ_BC
682 ecjx_DEPENDENCIES += libgcj_bc.la
683 endif
684
685 else !NATIVE
686
687 ecjx_LINK = $(GCJ_FOR_ECJX_LINK)
688 ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) $(ECJ_BUILD_JAR)
689 ecjx_LDADD = 
690 ecjx_DEPENDENCIES = 
691
692 endif !NATIVE
693
694 ## This is a dummy definition.
695 gappletviewer_SOURCES =
696 gappletviewer_LDFLAGS = --main=gnu.classpath.tools.appletviewer.Main \
697         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
698 gappletviewer_LINK = $(GCJLINK)
699 ## See jv_convert_LDADD.
700 gappletviewer_LDADD = -L$(here)/.libs libgcj-tools.la
701 gappletviewer_DEPENDENCIES = libgcj-tools.la
702
703 ## This is a dummy definition.
704 gjarsigner_SOURCES =
705 gjarsigner_LDFLAGS = --main=gnu.classpath.tools.jarsigner.Main \
706         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
707 gjarsigner_LINK = $(GCJLINK)
708 ## See jv_convert_LDADD.
709 gjarsigner_LDADD = -L$(here)/.libs libgcj-tools.la
710 gjarsigner_DEPENDENCIES = libgcj-tools.la
711
712 ## This is a dummy definition.
713 gkeytool_SOURCES =
714 gkeytool_LDFLAGS = --main=gnu.classpath.tools.keytool.Main \
715         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
716 gkeytool_LINK = $(GCJLINK)
717 ## See jv_convert_LDADD.
718 gkeytool_LDADD = -L$(here)/.libs libgcj-tools.la
719 gkeytool_DEPENDENCIES = libgcj-tools.la
720
721 ## This is a dummy definition.
722 gjar_SOURCES =
723 gjar_LDFLAGS = --main=gnu.classpath.tools.jar.Main \
724         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
725 gjar_LINK = $(GCJLINK)
726 ## See jv_convert_LDADD.
727 gjar_LDADD = -L$(here)/.libs libgcj-tools.la
728 gjar_DEPENDENCIES = libgcj-tools.la
729
730 ## This is a dummy definition.
731 gjavah_SOURCES =
732 gjavah_LDFLAGS = --main=gnu.classpath.tools.javah.Main \
733         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
734 gjavah_LINK = $(GCJLINK)
735 ## See jv_convert_LDADD.
736 gjavah_LDADD = -L$(here)/.libs libgcj-tools.la
737 gjavah_DEPENDENCIES = libgcj-tools.la
738
739 ## This is a dummy definition.
740 gnative2ascii_SOURCES =
741 gnative2ascii_LDFLAGS = --main=gnu.classpath.tools.native2ascii.Native2ASCII \
742         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
743 gnative2ascii_LINK = $(GCJLINK)
744 ## See jv_convert_LDADD.
745 gnative2ascii_LDADD = -L$(here)/.libs libgcj-tools.la
746 gnative2ascii_DEPENDENCIES = libgcj-tools.la
747
748 ## This is a dummy definition.
749 gorbd_SOURCES =
750 gorbd_LDFLAGS = --main=gnu.classpath.tools.orbd.Main \
751         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
752 gorbd_LINK = $(GCJLINK)
753 ## See jv_convert_LDADD.
754 gorbd_LDADD = -L$(here)/.libs libgcj-tools.la
755 gorbd_DEPENDENCIES = libgcj-tools.la
756
757 ## This is a dummy definition.
758 grmid_SOURCES =
759 grmid_LDFLAGS = --main=gnu.classpath.tools.rmid.Main \
760         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
761 grmid_LINK = $(GCJLINK)
762 ## See jv_convert_LDADD.
763 grmid_LDADD = -L$(here)/.libs libgcj-tools.la
764 grmid_DEPENDENCIES = libgcj-tools.la
765
766 ## This is a dummy definition.
767 gserialver_SOURCES =
768 gserialver_LDFLAGS = --main=gnu.classpath.tools.serialver.SerialVer \
769         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
770 gserialver_LINK = $(GCJLINK)
771 ## See jv_convert_LDADD.
772 gserialver_LDADD = -L$(here)/.libs libgcj-tools.la
773 gserialver_DEPENDENCIES = libgcj-tools.la
774
775 ## This is a dummy definition.
776 gtnameserv_SOURCES =
777 gtnameserv_LDFLAGS = --main=gnu.classpath.tools.tnameserv.Main \
778         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
779 gtnameserv_LINK = $(GCJLINK)
780 ## See jv_convert_LDADD.
781 gtnameserv_LDADD = -L$(here)/.libs libgcj-tools.la
782 gtnameserv_DEPENDENCIES = libgcj-tools.la
783
784 ## This is a dummy definition.
785 grmic_SOURCES =
786 grmic_LDFLAGS = --main=gnu.classpath.tools.rmic.Main \
787         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
788 grmic_LINK = $(GCJLINK)
789 ## See jv_convert_LDADD.
790 grmic_LDADD = -L$(here)/.libs libgcj-tools.la
791 grmic_DEPENDENCIES = libgcj-tools.la
792
793 ## This is a dummy definition.
794 grmiregistry_SOURCES =
795 grmiregistry_LDFLAGS = --main=gnu.classpath.tools.rmiregistry.Main \
796         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
797 grmiregistry_LINK = $(GCJLINK)
798 ## See jv_convert_LDADD.
799 grmiregistry_LDADD = -L$(here)/.libs libgcj-tools.la
800 grmiregistry_DEPENDENCIES = libgcj-tools.la
801
802 ## ################################################################
803
804 ## This lists all the C++ source files in subdirectories.
805 nat_source_files = \
806 gnu/classpath/jdwp/natVMFrame.cc \
807 gnu/classpath/jdwp/natVMMethod.cc \
808 gnu/classpath/jdwp/natVMVirtualMachine.cc \
809 gnu/classpath/natConfiguration.cc \
810 gnu/classpath/natSystemProperties.cc \
811 gnu/classpath/natVMStackWalker.cc \
812 gnu/gcj/natCore.cc \
813 gnu/gcj/convert/JIS0208_to_Unicode.cc \
814 gnu/gcj/convert/JIS0212_to_Unicode.cc \
815 gnu/gcj/convert/Unicode_to_JIS.cc \
816 gnu/gcj/convert/natIconv.cc \
817 gnu/gcj/convert/natInput_EUCJIS.cc \
818 gnu/gcj/convert/natInput_SJIS.cc \
819 gnu/gcj/convert/natOutput_EUCJIS.cc \
820 gnu/gcj/convert/natOutput_SJIS.cc \
821 gnu/gcj/io/natSimpleSHSStream.cc \
822 gnu/gcj/io/shs.cc \
823 gnu/gcj/jvmti/natBreakpoint.cc \
824 gnu/gcj/runtime/natFinalizerThread.cc \
825 gnu/gcj/runtime/natSharedLibLoader.cc \
826 gnu/gcj/runtime/natSystemClassLoader.cc \
827 gnu/gcj/runtime/natStringBuffer.cc \
828 gnu/gcj/util/natDebug.cc \
829 gnu/java/lang/natMainThread.cc \
830 gnu/java/lang/management/natVMClassLoadingMXBeanImpl.cc \
831 gnu/java/lang/management/natVMCompilationMXBeanImpl.cc \
832 gnu/java/lang/management/natVMGarbageCollectorMXBeanImpl.cc \
833 gnu/java/lang/management/natVMMemoryMXBeanImpl.cc \
834 gnu/java/lang/management/natVMMemoryManagerMXBeanImpl.cc \
835 gnu/java/lang/management/natVMMemoryPoolMXBeanImpl.cc \
836 gnu/java/lang/management/natVMRuntimeMXBeanImpl.cc \
837 gnu/java/lang/management/natVMThreadMXBeanImpl.cc \
838 gnu/java/net/natPlainDatagramSocketImpl.cc \
839 gnu/java/net/natPlainSocketImpl.cc \
840 gnu/java/net/protocol/core/natCoreInputStream.cc \
841 gnu/java/nio/natVMPipe.cc \
842 gnu/java/nio/natVMSelector.cc \
843 gnu/java/nio/natNIOServerSocket.cc \
844 gnu/java/nio/natVMChannel.cc \
845 gnu/java/nio/channels/natFileChannelImpl.cc \
846 java/io/natFile.cc \
847 java/io/natVMObjectInputStream.cc \
848 java/io/natVMObjectStreamClass.cc \
849 java/lang/management/natVMManagementFactory.cc \
850 java/lang/natCharacter.cc \
851 java/lang/natClass.cc \
852 java/lang/natClassLoader.cc \
853 java/lang/natConcreteProcess.cc \
854 java/lang/natVMDouble.cc \
855 java/lang/natVMFloat.cc \
856 java/lang/natMath.cc \
857 java/lang/natObject.cc \
858 java/lang/natRuntime.cc \
859 java/lang/natString.cc \
860 java/lang/natStringBuffer.cc \
861 java/lang/natStringBuilder.cc \
862 java/lang/natSystem.cc \
863 java/lang/natThread.cc \
864 java/lang/natThreadLocal.cc \
865 java/lang/natVMClassLoader.cc \
866 java/lang/natVMThrowable.cc \
867 java/lang/ref/natReference.cc \
868 java/lang/reflect/natArray.cc \
869 java/lang/reflect/natConstructor.cc \
870 java/lang/reflect/natField.cc \
871 java/lang/reflect/natMethod.cc \
872 java/lang/reflect/natVMProxy.cc \
873 java/net/natVMInetAddress.cc \
874 java/net/natVMNetworkInterface.cc \
875 java/net/natVMURLConnection.cc \
876 java/nio/channels/natVMChannels.cc \
877 java/nio/natVMDirectByteBufferImpl.cc \
878 java/security/natVMAccessController.cc \
879 java/security/natVMAccessControlState.cc \
880 java/text/natCollator.cc \
881 java/util/natVMTimeZone.cc \
882 java/util/concurrent/atomic/natAtomicLong.cc \
883 java/util/logging/natLogger.cc \
884 java/util/zip/natDeflater.cc \
885 java/util/zip/natInflater.cc \
886 sun/misc/natUnsafe.cc
887
888 xlib_nat_source_files = \
889 gnu/gcj/xlib/natClip.cc \
890 gnu/gcj/xlib/natColormap.cc \
891 gnu/gcj/xlib/natDisplay.cc \
892 gnu/gcj/xlib/natDrawable.cc \
893 gnu/gcj/xlib/natFont.cc \
894 gnu/gcj/xlib/natGC.cc \
895 gnu/gcj/xlib/natPixmap.cc \
896 gnu/gcj/xlib/natScreen.cc \
897 gnu/gcj/xlib/natVisual.cc \
898 gnu/gcj/xlib/natWMSizeHints.cc \
899 gnu/gcj/xlib/natWindow.cc \
900 gnu/gcj/xlib/natWindowAttributes.cc \
901 gnu/gcj/xlib/natXAnyEvent.cc \
902 gnu/gcj/xlib/natXButtonEvent.cc \
903 gnu/gcj/xlib/natXColor.cc \
904 gnu/gcj/xlib/natXConfigureEvent.cc \
905 gnu/gcj/xlib/natXException.cc \
906 gnu/gcj/xlib/natXExposeEvent.cc \
907 gnu/gcj/xlib/natXImage.cc \
908 gnu/gcj/xlib/natXUnmapEvent.cc
909
910 ## ################################################################
911
912 ##
913 ## Creating and installing sources.zip
914 ##
915
916 ## Create a zip holding all the sources.  This can be meaningfully
917 ## used in Eclipse.
918 src.zip:
919         -rm -f src.zip
920         here=`pwd`; \
921         ( \
922           ( cd $(srcdir)/classpath; \
923           find java gnu javax org sun -name '*.java' -print | \
924           while read file; do \
925 ## Ugly code to avoid "echo -C".  Must separate each entry by a newline
926 ## Gross but easy.
927             echo "x-C" | sed -e 's/^.//'; \
928             echo $(srcdir)/classpath; \
929             echo $$file; \
930           done ); \
931           ( cd $(srcdir)/classpath/external/sax; \
932           find org -name '*.java' -print | \
933           while read file; do \
934             echo "x-C" | sed -e 's/^.//'; \
935             echo $(srcdir)/classpath/external/sax; \
936             echo $$file; \
937           done ); \
938           ( cd $(srcdir)/classpath/external/relaxngDatatype; \
939           find org -name '*.java' -print | \
940           while read file; do \
941             echo "x-C" | sed -e 's/^.//'; \
942             echo $(srcdir)/classpath/external/relaxngDatatype; \
943             echo $$file; \
944           done ); \
945           ( cd $(srcdir)/classpath/external/w3c_dom; \
946           find org -name '*.java' -print | \
947           while read file; do \
948             echo "x-C" | sed -e 's/^.//'; \
949             echo $(srcdir)/classpath/external/w3c_dom; \
950             echo $$file; \
951           done ); \
952 ## Now the build tree.
953           ( cd classpath; \
954             find gnu java -name '*.java' -print | \
955             while read file; do \
956             echo "x-C" | sed -e 's/^.//'; \
957             echo `pwd`; \
958             echo $$file; \
959           done ); \
960         ) | \
961 ## Many of the above circumlocutions were because ZIP used to be a
962 ## relative path to fastjar.  It didn't seem worthwhile to change the
963 ## code when we moved to an external jar.
964         $(JAR) -cfM@ $$here/src.zip
965 ## Override GNU Classpath sources with libgcj replacements.
966         here=`pwd`; \
967         ( \
968           ( cd $(srcdir); \
969           find gnu java -name '*.java' -print | \
970           while read file; do \
971             echo "x-C" | sed -e 's/^.//'; \
972             echo $(srcdir); \
973             echo $$file; \
974           done ); \
975         ) | \
976         $(JAR) -ufM@ $$here/src.zip
977
978 ## We use a variable for this in case the user wants to override it.
979 sourcesdir = $(jardir)
980
981 install-src.zip: src.zip
982         $(INSTALL_DATA) src.zip $(DESTDIR)$(sourcesdir)/src-$(gcc_version).zip
983
984
985 ## ################################################################
986
987 ##
988 ## Dependency tracking madness.
989 ##
990
991 ## This is an evil hack to work around an automake limitation.  We
992 ## need to ensure that all CNI headers are built, not just the ones
993 ## used internally by libgcj. We can't make the .o files depend on
994 ## nat_headers, because in that case we'll force a complete rebuild of
995 ## the C++ code whenever any .java file is touched.  So instead we
996 ## have a dummy rule which is only used once, namely the first time a
997 ## build is done.  On subsequent builds, the dependency tracking for
998 ## the .cc compilations will have picked up the .h files, and these
999 ## will be built directly as needed.
1000
1001 headers.stamp:
1002 ## Note that we don't use a real dependency here, since we don't want
1003 ## to rebuild all the headers here when the header list changes.  If
1004 ## we did rebuild here, then any addition of a .java file would cause
1005 ## a large number of recompilations.
1006         $(MAKE) create-headers
1007         @echo > headers.stamp
1008
1009 headers_to_make = $(nat_headers)
1010 if XLIB_AWT
1011 headers_to_make += $(xlib_nat_headers)
1012 endif
1013
1014 create-headers: $(headers_to_make)
1015
1016 .PHONY: create-headers
1017
1018 $(libgcj_la_OBJECTS) $(gcj_dbtool_OBJECTS) $(xlib_nat_files): headers.stamp
1019 $(libgij_la_OBJECTS): headers.stamp
1020 $(libjvm_la_OBJECTS): headers.stamp
1021
1022 ## ################################################################
1023
1024 ##
1025 ## This section is for make and multilib madness.
1026 ##
1027
1028 # Work around what appears to be a GNU make bug handling MAKEFLAGS
1029 # values defined in terms of make variables, as is the case for CC and
1030 # friends when we are called from the top level Makefile.
1031 AM_MAKEFLAGS = \
1032         "AR_FLAGS=$(AR_FLAGS)" \
1033         "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
1034         "CFLAGS=$(CFLAGS)" \
1035         "CXXFLAGS=$(CXXFLAGS)" \
1036         "CPPFLAGS=$(CPPFLAGS)" \
1037         "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
1038         "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
1039         "INSTALL=$(INSTALL)" \
1040         "INSTALL_DATA=$(INSTALL_DATA)" \
1041         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
1042         "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
1043         "GCJFLAGS=$(GCJFLAGS)" \
1044         "LDFLAGS=$(LDFLAGS)" \
1045         "LIBCFLAGS=$(LIBCFLAGS)" \
1046         "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
1047         "MAKE=$(MAKE)" \
1048         "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
1049         "PICFLAG=$(PICFLAG)" \
1050         "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
1051         "SHELL=$(SHELL)" \
1052         "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
1053         "exec_prefix=$(exec_prefix)" \
1054         "infodir=$(infodir)" \
1055         "libdir=$(libdir)" \
1056         "prefix=$(prefix)" \
1057         "gxx_include_dir=$(gxx_include_dir)" \
1058         "AR=$(AR)" \
1059         "AS=$(AS)" \
1060         "LD=$(LD)" \
1061         "LIBCFLAGS=$(LIBCFLAGS)" \
1062         "NM=$(NM)" \
1063         "PICFLAG=$(PICFLAG)" \
1064         "RANLIB=$(RANLIB)" \
1065         "DESTDIR=$(DESTDIR)" \
1066         "JAR=$(JAR)"
1067
1068 # Subdir rules rely on $(FLAGS_TO_PASS)
1069 FLAGS_TO_PASS = $(AM_MAKEFLAGS)
1070
1071 CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host
1072
1073 MAKEOVERRIDES=
1074
1075 # No install-html support yet.
1076 .PHONY: install-html
1077 install-html:
1078
1079 # Multilib support variables.
1080 MULTISRCTOP =
1081 MULTIBUILDTOP =
1082 MULTIDIRS =
1083 MULTISUBDIR =
1084 MULTIDO = true
1085 MULTICLEAN = true
1086
1087 # Multilib support.
1088 .PHONY: all-multi mostlyclean-multi clean-multi distclean-multi \
1089         maintainer-clean-multi
1090
1091 all-recursive: all-multi
1092 install-recursive: install-multi
1093 mostlyclean-recursive: mostlyclean-multi
1094 clean-recursive: clean-multi
1095 distclean-recursive: distclean-multi
1096 maintainer-clean-recursive: maintainer-clean-multi
1097
1098 all-multi:
1099         : $(MAKE) ; exec $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do
1100 install-multi:
1101         $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do
1102 mostlyclean-multi:
1103         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean
1104 clean-multi:
1105         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean
1106 distclean-multi:
1107         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean
1108 maintainer-clean-multi:
1109         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean