OSDN Git Service

* configure.ac: Add sys/rw_lock.h to AC_CHECK_HEADERS.
[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 ##
33 ## What gets installed, and where.
34 ##
35
36 toolexeclib_LTLIBRARIES = libgcj.la libgij.la
37 toolexecmainlib_DATA = libgcj.spec
38
39 if XLIB_AWT
40 toolexeclib_LTLIBRARIES += lib-gnu-awt-xlib.la
41 endif
42
43 if GTK_AWT
44 toolexeclib_LTLIBRARIES += lib-gnu-java-awt-peer-gtk.la libgcjawt.la
45 endif
46
47 if QT_AWT
48 toolexeclib_LTLIBRARIES += lib-gnu-java-awt-peer-qt.la
49 endif
50
51 pkgconfigdir = $(libdir)/pkgconfig
52 pkgconfig_DATA = libgcj.pc
53
54 jardir = $(datadir)/java
55 jar_DATA = libgcj-$(gcc_version).jar
56
57 if JAVA_HOME_SET
58 JAVA_HOME_DIR = $(JAVA_HOME)
59 BOOT_CLASS_PATH_DIR = $(JAVA_HOME)/lib/rt.jar
60 else
61 JAVA_HOME_DIR = $(prefix)
62 BOOT_CLASS_PATH_DIR = $(jardir)/$(jar_DATA)
63 endif
64
65 ## FIXME: Using libdir violates GNU coding standards.
66 secdir = $(libdir)/security
67 ## Where to install default logging property file.
68 propdir = $(libdir)
69
70 ## Name of the default .db.
71 db_name = classmap.db
72 ## Compiler specific component of the .db file
73 db_pathtail = gcj-$(gcc_version)/$(db_name)
74
75 ## For now, only on native systems.  FIXME.
76 if NATIVE
77 bin_PROGRAMS = jv-convert gij grmic grmiregistry gcj-dbtool
78
79 ## It is convenient to actually build and install the default database
80 ## when gcj-dbtool is available.
81 dbexec_DATA = $(db_name)
82 endif
83
84 bin_SCRIPTS = addr2name.awk
85
86 ## ################################################################
87
88 ##
89 ## Compilers and compilation flags.
90 ##
91
92 GCJH = @GCJH@
93
94 ## The compiler with whatever flags we want for both -c and -C
95 ## compiles.
96 GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8 -Wno-deprecated
97
98 extra_ldflags_libjava = @extra_ldflags_libjava@
99
100 GCJLINK = $(LIBTOOL) --tag=GCJ --mode=link $(GCJ) -L$(here) $(JC1FLAGS) \
101           $(LDFLAGS) -o $@
102 LIBLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXX) -L$(here) $(JC1FLAGS) \
103           $(LDFLAGS) $(extra_ldflags_libjava) -o $@
104
105 GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE@
106
107 WARNINGS = -Wextra -Wall
108 ## Some systems don't allow `$' in identifiers by default, so we force
109 ## it with -fdollars-in-identifiers.  -Wswitch-enum detects bugs in
110 ## the verifier implementation, and maybe other places.  We need
111 ## _GNU_SOURCE defined for some Linux builds.  It doesn't hurt to
112 ## always define it.  Some systems, including Linux, need
113 ## -D_FILE_OFFSET_BITS=64 to enable > 2GB file support.
114 AM_CXXFLAGS = \
115         -fno-rtti \
116         -fnon-call-exceptions \
117         $(THREADCXXFLAGS) \
118         -fdollars-in-identifiers \
119         -Wswitch-enum \
120         -D_FILE_OFFSET_BITS=64 \
121         @LIBGCJ_CXXFLAGS@ \
122         @X_CFLAGS@ \
123         $(WARNINGS) \
124         -D_GNU_SOURCE \
125         -DPREFIX="\"$(prefix)\"" \
126         -DLIBDIR="\"$(libdir)\"" \
127         -DJAVA_HOME="\"$(JAVA_HOME_DIR)\"" \
128         -DBOOT_CLASS_PATH="\"$(BOOT_CLASS_PATH_DIR)\"" \
129         -DJAVA_EXT_DIRS="\"$(jardir)/ext\"" \
130         -DGCJ_ENDORSED_DIRS="\"$(jardir)/gcj-endorsed\"" \
131         -DLIBGCJ_DEFAULT_DATABASE="\"$(dbexecdir)/$(db_name)\"" \
132         -DLIBGCJ_DEFAULT_DATABASE_PATH_TAIL="\"$(db_pathtail)\"" \
133         -DTOOLEXECLIBDIR="\"$(toolexeclibdir)\""
134
135 AM_GCJFLAGS = \
136         @LIBGCJ_JAVAFLAGS@ \
137         -fclasspath= -fbootclasspath=$(BOOTCLASSPATH) \
138         --encoding=UTF-8 \
139         -Wno-deprecated -fbootstrap-classes
140
141 AM_CFLAGS = @LIBGCJ_CFLAGS@
142 if USING_GCC
143 AM_CFLAGS += $(WARNINGS)
144 endif
145
146 ## Extra CFLAGS used for JNI C sources shared with GNU Classpath.
147 PEDANTIC_CFLAGS = -ansi -pedantic -Wall -Wno-long-long
148
149 JCFLAGS = -g
150 JC1FLAGS = @LIBGCJ_JAVAFLAGS@ $(GCJFLAGS)
151
152 LIBFFIINCS = @LIBFFIINCS@
153
154 AM_CPPFLAGS = -I$(top_srcdir) \
155         -Iinclude -I$(top_srcdir)/include \
156         -I$(top_srcdir)/classpath/include \
157         -Iclasspath/include \
158         -I$(top_srcdir)/classpath/native/fdlibm \
159         $(GCINCS) $(THREADINCS) $(INCLTDL) \
160         $(GCC_UNWIND_INCLUDE) $(ZINCS) $(LIBFFIINCS)
161
162 BOOTCLASSPATH = $(here)/classpath/lib
163
164 ## ################################################################
165
166 all_property_files = $(property_files) \
167     java/util/logging/logging.properties
168
169 ##
170 ## How to build libgcj.a and libgcj.jar
171 ##
172
173 libgij_la_SOURCES = gij.cc
174 libgij_la_DEPENDENCIES = libgcj.la libgcj.spec
175 ## See jv_convert_LDADD.
176 libgij_la_LIBADD = -L$(here)/.libs libgcj.la
177 ## The mysterious backslash in the grep pattern is consumed by make.
178 libgij_la_LDFLAGS = -rpath $(toolexeclibdir) \
179         -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
180
181 libgcj_la_SOURCES = prims.cc jni.cc exception.cc stacktrace.cc \
182         link.cc defineclass.cc interpret.cc verify.cc \
183         java/lang/Class.java java/lang/Object.java \
184         $(nat_source_files)
185
186 if USING_BOEHMGC
187 libgcj_la_SOURCES += boehm.cc
188 endif
189
190 if USING_NOGC
191 libgcj_la_SOURCES += nogc.cc
192 endif
193
194 if USING_POSIX_PLATFORM
195 libgcj_la_SOURCES += posix.cc
196 endif
197
198 if USING_WIN32_PLATFORM
199 libgcj_la_SOURCES += win32.cc
200 endif
201
202 if USING_DARWIN_CRT
203 libgcj_la_SOURCES += darwin.cc
204 endif
205
206 if USING_POSIX_THREADS
207 libgcj_la_SOURCES += posix-threads.cc
208 endif
209
210 if USING_WIN32_THREADS
211 libgcj_la_SOURCES += win32-threads.cc
212 endif
213
214 if USING_NO_THREADS
215 libgcj_la_SOURCES += no-threads.cc
216 endif
217
218 ## Objects from C++ sources in subdirs.
219 nat_files = $(nat_source_files:.cc=.lo)
220 xlib_nat_files = $(xlib_nat_source_files:.cc=.lo)
221
222 # Include THREADLIBS here to ensure that the correct version of
223 # certain linuxthread functions get linked:
224 ## The mysterious backslash in the grep pattern is consumed by make.
225 libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLDFLAGS) $(THREADLIBS) \
226         $(LIBLTDL) $(SYS_ZLIBS) \
227         -version-info `grep -v '^\#' $(srcdir)/libtool-version`
228 libgcj_la_LIBADD = \
229         classpath/native/fdlibm/libfdlibm.la \
230         $(all_packages_source_files:.list=.lo) \
231         $(bc_objects) \
232         $(propertyo_files) \
233         $(LIBFFI) $(ZLIBS) $(GCLIBS)
234 libgcj_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
235         $(all_packages_source_files:.list=.lo) \
236         $(LIBLTDL) $(libgcj_la_LIBADD)
237 libgcj_la_LINK = $(LIBLINK)
238
239
240 ## The .db file.  This rule is only used for native builds, so it is
241 ## safe to invoke gcj-dbtool.
242 $(db_name): gcj-dbtool$(EXEEXT)
243 ## In case it exists already.
244         @rm -f $(db_name)
245 ## We don't actually care if it fails -- if it does, just make an
246 ## empty file.  This is simpler than trying to discover when mmap is
247 ## not available.
248         ./gcj-dbtool -n $(db_name) || touch $(db_name)
249
250 ## For the peer library, DEPENDENCIES need to come before OBJECTS so
251 ## that JNI headers are built before JNI C files.
252 $(lib_gnu_java_awt_peer_gtk_la_OBJECTS): $(lib_gnu_java_awt_peer_gtk_la_DEPENDENCIES)
253
254 lib_gnu_java_awt_peer_gtk_la_SOURCES =
255 lib_gnu_java_awt_peer_gtk_la_LIBADD = \
256         gnu-java-awt-peer-gtk.lo \
257         classpath/native/jni/gtk-peer/libgtkpeer.la \
258         $(GTK_LIBS) $(GLIB_LIBS) $(LIBART_LIBS) $(CAIRO_LIBS) $(PANGOFT2_LIBS)
259 lib_gnu_java_awt_peer_gtk_la_DEPENDENCIES = gnu-java-awt-peer-gtk.lo \
260         classpath/native/jni/gtk-peer/libgtkpeer.la \
261         libgcj-$(gcc_version).jar libgcj.la libgcj.spec
262 ## The mysterious backslash in the grep pattern is consumed by make.
263 lib_gnu_java_awt_peer_gtk_la_LDFLAGS = \
264         -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC) $(X_LIBS) -lXtst
265 lib_gnu_java_awt_peer_gtk_la_LINK = $(LIBLINK)
266
267 libgcjawt_la_SOURCES = classpath/native/jawt/jawt.c
268 libgcjawt_la_CFLAGS = -I$(srcdir)/classpath/native/jni/classpath \
269         $(PEDANTIC_CFLAGS) $(X_CFLAGS)
270 ## See jv_convert_LDADD.
271 libgcjawt_la_LIBADD = -L$(here)/.libs lib-gnu-java-awt-peer-gtk.la
272 libgcjawt_la_LDFLAGS = \
273         -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
274         $(LIBGCJ_LD_SYMBOLIC)
275 libgcjawt_la_LINK = $(LIBLINK)
276
277 lib_gnu_java_awt_peer_qt_la_SOURCES =
278 lib_gnu_java_awt_peer_qt_la_LIBADD = \
279         gnu-java-awt-peer-qt.lo \
280         classpath/native/jni/qt-peer/libqtpeer.la
281 lib_gnu_java_awt_peer_qt_la_DEPENDENCIES = gnu-java-awt-peer-qt.lo \
282         classpath/native/jni/qt-peer/libqtpeer.la \
283         libgcj-$(gcc_version).jar libgcj.la libgcj.spec
284 ## The mysterious backslash in the grep pattern is consumed by make.
285 lib_gnu_java_awt_peer_qt_la_LDFLAGS = \
286         -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC) $(X_LIBS) -lXtst
287 lib_gnu_java_awt_peer_qt_la_LINK = $(LIBLINK)
288
289 lib_gnu_awt_xlib_la_SOURCES = $(xlib_nat_source_files)
290 lib_gnu_awt_xlib_la_LIBADD = gnu/awt/xlib.lo gnu/gcj/xlib.lo
291 lib_gnu_awt_xlib_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
292         libgcj.la libgcj.spec \
293         $(lib_gnu_awt_xlib_la_LIBADD)
294 ## We require libstdc++-v3 to be in the same build tree.
295 lib_gnu_awt_xlib_la_CPPFLAGS = \
296         $(AM_CPPFLAGS) \
297         -I../libstdc++-v3/include \
298         -I../libstdc++-v3/include/$(target_noncanonical) \
299         -I$(srcdir)/../libstdc++-v3/libsupc++
300 ## The mysterious backslash in the grep pattern is consumed by make.
301 lib_gnu_awt_xlib_la_LDFLAGS = ../libstdc++-v3/src/libstdc++.la \
302         @X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ \
303         -rpath $(toolexeclibdir) \
304         -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
305 lib_gnu_awt_xlib_la_LINK = $(LIBLINK)
306
307 ## Note that property_files is defined in sources.am.
308 propertyo_files = $(patsubst classpath/resource/%,%,$(addsuffix .lo,$(property_files)))
309
310 $(propertyo_files): %.lo: classpath/resource/%
311         $(mkinstalldirs) `dirname $@`; \
312         $(LTGCJCOMPILE) -o $@ -c $< -Wc,--resource,$(@:.lo=)
313
314 libgcj-$(gcc_version).jar: classpath/lib/compile-classes
315         cd classpath/lib; $(JAR) -cfM \
316             ../../libgcj-$(gcc_version).jar gnu java javax org
317
318 CLEANFILES = libgcj-$(gcc_version).jar
319 DISTCLEANFILES = native.dirs
320
321 mostlyclean-local:
322 ## Use libtool rm to remove each libtool object
323         find . -name '*.lo' -print | xargs $(LIBTOOL) rm -f
324
325 distclean-local:
326 ## Remove every .d file that was created.
327         find . -name '*.d' -print | xargs rm -f
328
329 # Just remove the objects from C++ sources, for testing the C++ compiler.
330 clean-nat:
331         rm -f $(nat_files) $(xlib_nat_files)
332
333 SUFFIXES = .class .java .h .properties .list
334
335 ## Pass the list of object files to libtool in a temporary file to
336 ## avoid tripping platform command line length limits.
337 lib-gnu-awt-xlib.la: $(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_DEPENDENCIES)
338         @echo Creating list of files to link...
339         @: $(call write_entries_to_file,$(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_LIBADD),lib_gnu_awt_xlib.objectlist)
340         $(lib_gnu_awt_xlib_la_LINK) -objectlist lib_gnu_awt_xlib.objectlist \
341         -rpath $(toolexeclibdir) $(lib_gnu_awt_xlib_la_LDFLAGS) $(LIBS)
342
343 ## ################################################################
344
345 ## Compiling a list of java sources to a single .o.
346
347 %.lo: %.list
348         $(LTGCJCOMPILE) -c -o $@ -MT $@ -MD -MP -MF $(basename $@).deps @$<
349
350 ## ################################################################
351
352 ## This pulls in a number of variable and target definitions.
353 include sources.am
354
355 ## ################################################################
356
357 ##
358 ## How to build header files.
359 ##
360
361 ## We have special rules for certain headers.
362 omitted_headers = java/lang/ClassLoader.h java/lang/Thread.h \
363         java/lang/String.h java/lang/reflect/Constructor.h \
364         java/lang/reflect/Field.h java/lang/reflect/Method.h \
365         java/lang/reflect/Proxy.h gnu/gcj/runtime/ExtensionClassLoader.h
366
367 generic_header_files = $(filter-out $(omitted_headers),$(ordinary_header_files) $(xlib_nat_headers)) \
368         gnu/gcj/tools/gcj_dbtool/Main.h
369
370 $(generic_header_files): %.h: classpath/lib/%.class
371         name=`echo $< | sed -e 's/\.class$$//' -e 's,classpath/lib/,,'`; \
372         $(mkinstalldirs) `dirname $$name`; \
373         $(GCJH) -d . -classpath '' -bootclasspath classpath/lib $$name
374
375 inner_nat_headers = java/io/ObjectOutputStream$$PutField.h \
376         java/io/ObjectInputStream$$GetField.h \
377         java/nio/DirectByteBufferImpl$$ReadWrite.h \
378         java/nio/channels/Pipe$$SinkChannel.h \
379         java/nio/channels/Pipe$$SourceChannel.h \
380         java/lang/reflect/Proxy$$ProxyData.h \
381         java/lang/reflect/Proxy$$ProxyType.h \
382         gnu/java/net/PlainSocketImpl$$SocketInputStream.h \
383         gnu/java/net/PlainSocketImpl$$SocketOutputStream.h \
384         gnu/java/nio/PipeImpl$$SinkChannelImpl.h \
385         gnu/java/nio/PipeImpl$$SourceChannelImpl.h \
386         $(PLATFORM_INNER_NAT_HDRS)
387
388 nat_headers = $(ordinary_header_files) $(inner_nat_headers) \
389         gnu/gcj/tools/gcj_dbtool/Main.h
390 nat_headers_install = $(ordinary_header_files)
391
392 xlib_nat_headers = $(gnu_awt_xlib_header_files) $(gnu_gcj_xlib_header_files)
393
394 java/lang/ClassLoader.h: classpath/lib/java/lang/ClassLoader.class
395         $(GCJH) -classpath '' -bootclasspath classpath/lib \
396                 -prepend 'jclass _Jv_FindClass (_Jv_Utf8Const *name, java::lang::ClassLoader *loader);' \
397                 -prepend 'void _Jv_RunMain (jclass klass, const char *name, int argc, const char **argv, bool is_jar);' \
398                 -friend 'jclass (::_Jv_FindClass) (_Jv_Utf8Const *name, java::lang::ClassLoader *loader);' \
399                 -friend 'void ::_Jv_RunMain (jclass klass, const char *name, int argc, const char **argv, bool is_jar);' \
400                 java/lang/ClassLoader
401
402 java/lang/Thread.h: classpath/lib/java/lang/Thread.class
403         $(GCJH) -classpath '' -bootclasspath classpath/lib \
404                 -prepend 'class _Jv_JNIEnv;' \
405                 -prepend '#define _JV_NOT_OWNER 1' \
406                 -prepend '#define _JV_INTERRUPTED 2' \
407                 -prepend '_Jv_JNIEnv * _Jv_GetCurrentJNIEnv ();' \
408                 -prepend 'void _Jv_SetCurrentJNIEnv (_Jv_JNIEnv *env);' \
409                 -prepend 'void _Jv_ThreadRun (java::lang::Thread* thread);' \
410                 -prepend 'jint _Jv_AttachCurrentThread(java::lang::Thread* thread);' \
411                 -prepend 'java::lang::Thread* _Jv_AttachCurrentThread (jstring name, java::lang::ThreadGroup* group);' \
412                 -prepend 'java::lang::Thread* _Jv_AttachCurrentThreadAsDaemon (jstring name, java::lang::ThreadGroup* group);' \
413                 -prepend 'jint _Jv_DetachCurrentThread ();' \
414                 -friend '_Jv_JNIEnv * ::_Jv_GetCurrentJNIEnv ();' \
415                 -friend 'void ::_Jv_SetCurrentJNIEnv (_Jv_JNIEnv *env);' \
416                 -friend 'void ::_Jv_ThreadRun (java::lang::Thread* thread);' \
417                 -friend 'jint (::_Jv_AttachCurrentThread) (java::lang::Thread* thread);' \
418                 -friend 'java::lang::Thread* ::_Jv_AttachCurrentThread (jstring name, java::lang::ThreadGroup* group);' \
419                 -friend 'java::lang::Thread* ::_Jv_AttachCurrentThreadAsDaemon (jstring name, java::lang::ThreadGroup* group);' \
420                 -friend 'jint (::_Jv_DetachCurrentThread) ();' \
421                 java/lang/Thread
422
423 java/lang/String.h: classpath/lib/java/lang/String.class
424         $(GCJH) -classpath '' -bootclasspath classpath/lib \
425             -prepend 'jchar* _Jv_GetStringChars (jstring str);' \
426             -prepend 'jstring* _Jv_StringFindSlot (jchar*, jint, jint);' \
427             -prepend 'jstring* _Jv_StringGetSlot (jstring);' \
428             -prepend 'jstring _Jv_NewStringUtf8Const (_Jv_Utf8Const* str);' \
429             -prepend 'jstring _Jv_NewStringLatin1 (const char*, jsize);' \
430             -prepend 'jstring _Jv_AllocString (jsize);' \
431             -friend 'jchar* ::_Jv_GetStringChars (jstring str);' \
432             -friend 'jstring* ::_Jv_StringFindSlot (jchar*, jint, jint);' \
433             -friend 'jstring* ::_Jv_StringGetSlot (jstring);' \
434             -friend 'jstring (::_Jv_NewStringUtf8Const) (_Jv_Utf8Const* str);' \
435             -friend 'jstring (::_Jv_NewStringLatin1) (const char*, jsize);' \
436             -friend 'jstring (::_Jv_AllocString) (jsize);' \
437             java/lang/String
438
439 java/lang/reflect/Constructor.h: classpath/lib/java/lang/reflect/Constructor.class
440         $(GCJH) -classpath '' -bootclasspath classpath/lib \
441             -prepend 'jmethodID _Jv_FromReflectedConstructor (java::lang::reflect::Constructor *);' \
442             -prepend 'jobject _Jv_JNI_ToReflectedMethod (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \
443             -friend 'jmethodID (::_Jv_FromReflectedConstructor) (java::lang::reflect::Constructor *);' \
444             -friend 'jobject (::_Jv_JNI_ToReflectedMethod) (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \
445             -friend 'class java::lang::Class;' \
446             java/lang/reflect/Constructor
447
448 java/lang/reflect/Field.h: classpath/lib/java/lang/reflect/Field.class
449         $(GCJH) -classpath '' -bootclasspath classpath/lib \
450             -prepend 'jfieldID _Jv_FromReflectedField (java::lang::reflect::Field *);' \
451             -prepend 'jobject _Jv_JNI_ToReflectedField (_Jv_JNIEnv*, jclass, jfieldID, jboolean);' \
452             -friend 'jfieldID (::_Jv_FromReflectedField) (java::lang::reflect::Field *);' \
453             -friend 'jobject (::_Jv_JNI_ToReflectedField) (_Jv_JNIEnv*, jclass, jfieldID, jboolean);' \
454             -friend 'class java::lang::Class;' \
455             java/lang/reflect/Field
456
457 java/lang/reflect/Method.h: classpath/lib/java/lang/reflect/Method.class
458         $(GCJH) -classpath '' -bootclasspath classpath/lib \
459             -prepend 'jmethodID _Jv_FromReflectedMethod (java::lang::reflect::Method *);' \
460             -prepend 'jobject _Jv_JNI_ToReflectedMethod (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \
461             -friend 'jmethodID (::_Jv_FromReflectedMethod) (java::lang::reflect::Method *);' \
462             -friend 'jobject (::_Jv_JNI_ToReflectedMethod) (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \
463             -friend 'class java::lang::Class;' \
464             -friend 'class java::io::ObjectInputStream;' \
465             java/lang/reflect/Method
466
467 java/lang/reflect/Proxy.h: classpath/lib/java/lang/reflect/Proxy.class
468         $(GCJH) -classpath '' -bootclasspath classpath/lib \
469             java/lang/reflect/Proxy
470
471 java/lang/reflect/Proxy$$ProxyData.h: classpath/lib/java/lang/reflect/Proxy.class
472         $(GCJH) -classpath '' -bootclasspath classpath/lib \
473         'java/lang/reflect/Proxy$$ProxyData'
474
475 java/lang/reflect/Proxy$$ProxyType.h: classpath/lib/java/lang/reflect/Proxy.class
476         $(GCJH) -classpath '' -bootclasspath classpath/lib \
477         'java/lang/reflect/Proxy$$ProxyType'
478
479 gnu/gcj/runtime/ExtensionClassLoader.h: classpath/lib/gnu/gcj/runtime/ExtensionClassLoader.class
480         $(GCJH) -classpath '' -bootclasspath classpath/lib \
481             -friend 'class ::java::lang::ClassLoader;' \
482             gnu/gcj/runtime/ExtensionClassLoader
483
484 java/io/ObjectInputStream$$GetField.h: classpath/lib/java/io/ObjectInputStream.class
485         $(GCJH) -classpath '' -bootclasspath classpath/lib \
486         'java/io/ObjectInputStream$$GetField'
487
488 java/io/ObjectOutputStream$$PutField.h: classpath/lib/java/io/ObjectOutputStream.class
489         $(GCJH) -classpath '' -bootclasspath classpath/lib \
490         'java/io/ObjectOutputStream$$PutField'
491
492 java/nio/DirectByteBufferImpl$$ReadWrite.h: classpath/lib/java/nio/DirectByteBufferImpl.class
493         $(GCJH) -classpath '' -bootclasspath classpath/lib \
494         'java/nio/DirectByteBufferImpl$$ReadWrite'
495
496 java/nio/channels/Pipe$$SinkChannel.h: classpath/lib/java/nio/channels/Pipe.class
497         $(GCJH) -classpath '' -bootclasspath classpath/lib \
498         'java/nio/channels/Pipe$$SinkChannel'
499
500 java/nio/channels/Pipe$$SourceChannel.h: classpath/lib/java/nio/channels/Pipe.class
501         $(GCJH) -classpath '' -bootclasspath classpath/lib \
502         'java/nio/channels/Pipe$$SourceChannel'
503
504 gnu/java/net/PlainSocketImpl$$SocketInputStream.h: classpath/lib/gnu/java/net/PlainSocketImpl.class
505         $(GCJH) -classpath '' -bootclasspath classpath/lib \
506         'gnu/java/net/PlainSocketImpl$$SocketInputStream'
507
508 gnu/java/net/PlainSocketImpl$$SocketOutputStream.h: classpath/lib/gnu/java/net/PlainSocketImpl.class
509         $(GCJH) -classpath '' -bootclasspath classpath/lib \
510         'gnu/java/net/PlainSocketImpl$$SocketOutputStream'
511
512 gnu/java/nio/PipeImpl$$SinkChannelImpl.h: classpath/lib/gnu/java/nio/PipeImpl.class
513         $(GCJH) -classpath '' -bootclasspath classpath/lib \
514         'gnu/java/nio/PipeImpl$$SinkChannelImpl'
515
516 gnu/java/nio/PipeImpl$$SourceChannelImpl.h: classpath/lib/gnu/java/nio/PipeImpl.class
517         $(GCJH) -classpath '' -bootclasspath classpath/lib \
518         'gnu/java/nio/PipeImpl$$SourceChannelImpl'
519
520 ## Only used by PosixProcess.java
521 java/lang/ConcreteProcess$$ProcessManager.h: classpath/lib/java/lang/ConcreteProcess.class
522         $(GCJH) -classpath '' -bootclasspath classpath/lib \
523         'java/lang/ConcreteProcess$$ProcessManager'
524
525 ## Headers we maintain by hand and which we want to install.
526 extra_headers = java/lang/Object.h java/lang/Class.h
527
528 $(extra_headers) $(srcdir)/java/lang/Object.h $(srcdir)/java/lang/Class.h:
529         @:
530
531 ## Install the headers.  It is fairly ugly that we have to do this by
532 ## hand.
533 install-data-local:
534         $(PRE_INSTALL)
535 ## We use a GNU make trick here so that we don't go over the command
536 ## length limit of some shells.
537         @echo Creating list of headers to install...
538         @: $(call write_entries_to_file,$(nat_headers_install) $(extra_headers),tmp-ilist)
539         @cat tmp-ilist | while read f; do \
540           d="`echo $$f | sed -e 's,/[^/]*$$,,'`"; \
541           $(mkinstalldirs) $(DESTDIR)$(gxx_include_dir)/$$d; \
542           if test -f $(srcdir)/$$f; then p=$(srcdir)/$$f; else p=$$f; fi; \
543           echo " $(INSTALL_DATA) $$p $(DESTDIR)$(gxx_include_dir)/$$f"; \
544           $(INSTALL_DATA) $$p $(DESTDIR)$(gxx_include_dir)/$$f; \
545         done
546         -@rm -f tmp-ilist
547 ## FIXME: the obvious approach using lib_DATA doesn't work with
548 ## automake 1.4.
549         $(mkinstalldirs) $(DESTDIR)$(secdir)
550         @for f in libgcj.security; do \
551           echo " $(INSTALL_DATA) $(srcdir)/java/security/$$f $(DESTDIR)$(secdir)/$$f"; \
552           $(INSTALL_DATA) $(srcdir)/java/security/$$f $(DESTDIR)$(secdir)/$$f; \
553         done
554         $(INSTALL_DATA) $(srcdir)/java/util/logging/logging.properties $(DESTDIR)$(propdir)/logging.properties
555 ## Install inner class headers.
556         $(INSTALL_DATA) 'java/io/ObjectOutputStream$$PutField.h' $(DESTDIR)$(gxx_include_dir)/java/io/
557         $(INSTALL_DATA) 'java/io/ObjectInputStream$$GetField.h' $(DESTDIR)$(gxx_include_dir)/java/io/
558         $(INSTALL_DATA) 'java/nio/channels/Pipe$$SinkChannel.h' $(DESTDIR)$(gxx_include_dir)/java/nio/channels/
559         $(INSTALL_DATA) 'java/nio/channels/Pipe$$SourceChannel.h' $(DESTDIR)$(gxx_include_dir)/java/nio/channels/
560         $(INSTALL_DATA) 'java/lang/reflect/Proxy$$ProxyData.h' $(DESTDIR)$(gxx_include_dir)/java/lang/reflect/
561         $(INSTALL_DATA) 'java/lang/reflect/Proxy$$ProxyType.h' $(DESTDIR)$(gxx_include_dir)/java/lang/reflect/
562         $(INSTALL_DATA) 'gnu/java/net/PlainSocketImpl$$SocketInputStream.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/net/
563         $(INSTALL_DATA) 'gnu/java/net/PlainSocketImpl$$SocketOutputStream.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/net/
564         $(INSTALL_DATA) 'gnu/java/nio/PipeImpl$$SinkChannelImpl.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/nio/
565         $(INSTALL_DATA) 'gnu/java/nio/PipeImpl$$SourceChannelImpl.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/nio/
566 ## Don't install java/nio/DirectByteBufferImpl$$ReadWrite.h here. It's for internal use only.
567
568
569 ## ################################################################
570
571 ##
572 ## Additional `check' targets for maintainer convenience.
573 ##
574
575 ## This is used for maintainer-check.  FIXME: should set from
576 ## configure using AC_CHECK_TOOL.
577 NM = nm
578
579 ## Try to make sure our library doesn't stomp the namespace.
580 maintainer-check: libgcj.la
581         $(NM) .libs/libgcj.a | grep ' T ' \
582 ## Anything with `4java' is assumed to be from .java source.
583           | grep -v '4java' \
584 ## Anything with Jv is ok.
585           | grep -v 'Jv' \
586 ## `terminate' and `unexpected' are part of the runtime.
587           | grep -v 'terminate__Fv' | grep -v 'unexpected__Fv'
588
589 ## This rule can be used to see if the headers are more or less
590 ## correct.
591 header-check: libgcj-$(gcc_version).jar $(nat_headers)
592         rm -f htest.cc; \
593         for h in $(nat_headers); do \
594           echo "#include \"$$h\"" >> htest.cc; \
595         done; \
596         $(CXXCOMPILE) -fsyntax-only htest.cc
597
598 ## This rule can be used to see if all the .class files verify
599 ## correctly.
600 class-check: libgcj-$(gcc_version).jar
601         @ok=0; find . -name '*.class' -print | fgrep -v testsuite | \
602         while read f; do \
603           echo "$(GCJ_WITH_FLAGS) --syntax-only $$f"; \
604           if $(GCJ_WITH_FLAGS) --syntax-only $$f; then \
605           :; else ok=1; fi; \
606         done; exit $$ok
607
608 ## This rule checks whether write_entries_to_file works properly.
609 write-entries-to-file-check:
610         @echo Creating list of files to link...
611         @: $(call write_entries_to_file,$(libgcj_la_OBJECTS) $(libgcj_la_LIBADD),libgcj.objectlist)
612
613 ## ################################################################
614
615 ##
616 ## The `jv-convert' program and code to rebuild the converter header
617 ## files.
618 ##
619
620 ## it only makes sense to try to rebuild the JIS .h files on native
621 ## systems.
622 if NATIVE
623 if MAINTAINER_MODE
624 noinst_PROGRAMS = gen-from-JIS
625
626 gen_from_JIS_SOURCES = \
627         gnu/gcj/convert/gen-from-JIS.c \
628         gnu/gcj/convert/make-trie.c
629
630 gen_from_JIS_DEPENDENCIES = \
631         gnu/gcj/convert/JIS0201.h \
632         gnu/gcj/convert/JIS0208.h \
633         gnu/gcj/convert/JIS0212.h
634
635 $(srcdir)/gnu/gcj/convert/JIS0208_to_Unicode.cc: ./gen-from-JIS$(EXEEXT)
636          ./gen-from-JIS JIS0208 >$(srcdir)/gnu/gcj/convert/JIS0208_to_Unicode.cc
637
638 $(srcdir)/gnu/gcj/convert/JIS0212_to_Unicode.cc: ./gen-from-JIS$(EXEEXT)
639          ./gen-from-JIS JIS0212 >$(srcdir)/gnu/gcj/convert/JIS0212_to_Unicode.cc
640
641 $(srcdir)/gnu/gcj/convert/Unicode_to_JIS.cc: ./gen-from-JIS$(EXEEXT)
642          ./gen-from-JIS toJIS >$(srcdir)/gnu/gcj/convert/Unicode_to_JIS.cc
643
644 # The Unicode consortium does not permit re-distributing the file JIS0201.TXT.
645 # You can get it from
646 # ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/
647
648 $(srcdir)/gnu/gcj/convert/JIS0201.h: # gnu/gcj/convert/JIS0201.TXT
649         echo '/* This file is automatically generated from Unicode tables */' > tmp-0201; \
650         tr  -d '\r' <$(srcdir)/gnu/gcj/convert/JIS0201.TXT \
651         | sed -n -e 's|\(0x..\).*\(0x....\).*#\(.*\)$$|MAP(0x00, \1, \2)  /*\3 */|p' \
652         >> tmp-0201; \
653         mv tmp-0201 $(srcdir)/gnu/gcj/convert/JIS0201.h
654
655 # The Unicode consortium does not permit re-distributing the file JIS0208.TXT.
656 # You can get it from
657 # ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/
658
659 $(srcdir)/gnu/gcj/convert/JIS0208.h: # gnu/gcj/convert/JIS0208.TXT
660         echo '/* This file is automatically generated from Unicode tables */' > tmp-0208; \
661         tr  -d '\r' <$(srcdir)/gnu/gcj/convert/JIS0208.TXT \
662         | sed -n -e 's|\(0x....\).*0x\(..\)\(..\).*\(0x....\).*#\(.*\)$$|MAP(0x\2, 0x\3, \4)  /*\5 */|p' \
663         >> tmp-0208; \
664         mv tmp-0208 $(srcdir)/gnu/gcj/convert/JIS0208.h
665
666 # The Unicode consortium does not permit re-distributing the file JIS0212.TXT.
667 # You can get it from
668 # ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/
669
670 $(srcdir)/gnu/gcj/convert/JIS0212.h: # gnu/gcj/convert/JIS0212.TXT
671         echo '/* This file is automatically generated from Unicode tables */' > tmp-0212; \
672         tr  -d '\r' <$(srcdir)/gnu/gcj/convert/JIS0212.TXT \
673         | sed -n -e 's|0x\(..\)\(..\).*\(0x....\).*#\(.*\)$$|MAP(0x\1, 0x\2, \3)  /*\4 */|p' \
674         >> tmp-0212; \
675         mv tmp-0212 $(srcdir)/gnu/gcj/convert/JIS0212.h
676
677 endif
678 endif 
679
680
681 jv_convert_SOURCES =
682 ## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'.  We
683 ## need this because we are explicitly using libtool to link using the
684 ## `.la' file.
685 jv_convert_LDFLAGS = --main=gnu.gcj.convert.Convert \
686         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
687 jv_convert_LINK = $(GCJLINK)
688 ## We don't explicitly link in the libraries we need; libgcj.la brings
689 ## in all dependencies.  We need the -L so that gcj can find libgcj
690 ## with `-lgcj', but it must come first, otherwise the -L flags
691 ## brought in from libgcj.la would cause the install directories to be
692 ## searched before the build-tree ones, and we'd get errors because of
693 ## different libraries with the same SONAME from picky linkers such as
694 ## Solaris'.  FIXME: should be _libs on some systems.
695 jv_convert_LDADD = -L$(here)/.libs libgcj.la
696 ## Depend on the spec file to make sure it is up to date before
697 ## linking this program.
698 jv_convert_DEPENDENCIES = libgcj.la libgcj.spec
699
700 gcj_dbtool_SOURCES = \
701 gnu/gcj/tools/gcj_dbtool/Main.java \
702 gnu/gcj/tools/gcj_dbtool/natMain.cc
703
704 ## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'.  We
705 ## need this because we are explicitly using libtool to link using the
706 ## `.la' file.
707 gcj_dbtool_LDFLAGS = --main=gnu.gcj.tools.gcj_dbtool.Main \
708         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
709 gcj_dbtool_LINK = $(GCJLINK)
710 ## We don't explicitly link in the libraries we need; libgcj.la brings
711 ## in all dependencies.  We need the -L so that gcj can find libgcj
712 ## with `-lgcj', but it must come first, otherwise the -L flags
713 ## brought in from libgcj.la would cause the install directories to be
714 ## searched before the build-tree ones, and we'd get errors because of
715 ## different libraries with the same SONAME from picky linkers such as
716 ## Solaris'.  FIXME: should be _libs on some systems.
717 gcj_dbtool_LDADD = -L$(here)/.libs libgcj.la
718 ## Depend on the spec file to make sure it is up to date before
719 ## linking this program.
720 gcj_dbtool_DEPENDENCIES = libgcj.la libgcj.spec
721
722 gij_SOURCES = 
723 ## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'.  We
724 ## need this because we are explicitly using libtool to link using the
725 ## `.la' file.
726 gij_LDFLAGS = -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
727 gij_LINK = $(GCJLINK)
728 ## See jv_convert_LDADD.
729 gij_LDADD = -L$(here)/.libs libgij.la
730 ## Depend on the spec file to make sure it is up to date before
731 ## linking this program.
732 gij_DEPENDENCIES = libgij.la
733
734 ## This is a dummy definition.
735 grmic_SOURCES =
736 grmic_LDFLAGS = --main=gnu.java.rmi.rmic.RMIC \
737         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
738 grmic_LINK = $(GCJLINK)
739 ## See jv_convert_LDADD.
740 grmic_LDADD = -L$(here)/.libs libgcj.la
741 ## Depend on the spec file to make sure it is up to date before
742 ## linking this program.
743 grmic_DEPENDENCIES = libgcj.la libgcj.spec
744
745 ## This is a dummy definition.
746 grmiregistry_SOURCES =
747 grmiregistry_LDFLAGS = --main=gnu.java.rmi.registry.RegistryImpl \
748         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
749 grmiregistry_LINK = $(GCJLINK)
750 ## See jv_convert_LDADD.
751 grmiregistry_LDADD = -L$(here)/.libs libgcj.la
752 ## Depend on the spec file to make sure it is up to date before
753 ## linking this program.
754 grmiregistry_DEPENDENCIES = libgcj.la libgcj.spec
755
756 ## ################################################################
757
758 ## This lists all the C++ source files in subdirectories.
759 nat_source_files = \
760 gnu/classpath/natSystemProperties.cc \
761 gnu/gcj/natCore.cc \
762 gnu/gcj/convert/JIS0208_to_Unicode.cc \
763 gnu/gcj/convert/JIS0212_to_Unicode.cc \
764 gnu/gcj/convert/Unicode_to_JIS.cc \
765 gnu/gcj/convert/natIconv.cc \
766 gnu/gcj/convert/natInput_EUCJIS.cc \
767 gnu/gcj/convert/natInput_SJIS.cc \
768 gnu/gcj/convert/natOutput_EUCJIS.cc \
769 gnu/gcj/convert/natOutput_SJIS.cc \
770 gnu/gcj/io/natSimpleSHSStream.cc \
771 gnu/gcj/io/shs.cc \
772 gnu/gcj/runtime/natFinalizerThread.cc \
773 gnu/gcj/runtime/natSharedLibLoader.cc \
774 gnu/gcj/runtime/natSystemClassLoader.cc \
775 gnu/gcj/runtime/natStringBuffer.cc \
776 gnu/gcj/util/natDebug.cc \
777 gnu/java/lang/natMainThread.cc \
778 gnu/java/net/natPlainDatagramSocketImpl.cc \
779 gnu/java/net/natPlainSocketImpl.cc \
780 gnu/java/net/protocol/core/natCoreInputStream.cc \
781 gnu/java/nio/natPipeImpl.cc \
782 gnu/java/nio/natSelectorImpl.cc \
783 gnu/java/nio/natNIOServerSocket.cc \
784 gnu/java/nio/channels/natFileChannelImpl.cc \
785 java/io/natFile.cc \
786 java/io/natObjectInputStream.cc \
787 java/io/natVMObjectStreamClass.cc \
788 java/lang/natCharacter.cc \
789 java/lang/natClass.cc \
790 java/lang/natClassLoader.cc \
791 java/lang/natConcreteProcess.cc \
792 java/lang/natDouble.cc \
793 java/lang/natFloat.cc \
794 java/lang/natMath.cc \
795 java/lang/natObject.cc \
796 java/lang/natRuntime.cc \
797 java/lang/natString.cc \
798 java/lang/natStringBuffer.cc \
799 java/lang/natStringBuilder.cc \
800 java/lang/natSystem.cc \
801 java/lang/natThread.cc \
802 java/lang/natVMClassLoader.cc \
803 java/lang/natVMSecurityManager.cc \
804 java/lang/natVMThrowable.cc \
805 java/lang/ref/natReference.cc \
806 java/lang/reflect/natArray.cc \
807 java/lang/reflect/natConstructor.cc \
808 java/lang/reflect/natField.cc \
809 java/lang/reflect/natMethod.cc \
810 java/net/natVMNetworkInterface.cc \
811 java/net/natInetAddress.cc \
812 java/nio/channels/natVMChannels.cc \
813 java/nio/natDirectByteBufferImpl.cc \
814 java/text/natCollator.cc \
815 java/util/natResourceBundle.cc \
816 java/util/natVMTimeZone.cc \
817 java/util/logging/natLogger.cc \
818 java/util/zip/natDeflater.cc \
819 java/util/zip/natInflater.cc
820
821 xlib_nat_source_files = \
822 gnu/gcj/xlib/natClip.cc \
823 gnu/gcj/xlib/natColormap.cc \
824 gnu/gcj/xlib/natDisplay.cc \
825 gnu/gcj/xlib/natDrawable.cc \
826 gnu/gcj/xlib/natFont.cc \
827 gnu/gcj/xlib/natGC.cc \
828 gnu/gcj/xlib/natPixmap.cc \
829 gnu/gcj/xlib/natScreen.cc \
830 gnu/gcj/xlib/natVisual.cc \
831 gnu/gcj/xlib/natWMSizeHints.cc \
832 gnu/gcj/xlib/natWindow.cc \
833 gnu/gcj/xlib/natWindowAttributes.cc \
834 gnu/gcj/xlib/natXAnyEvent.cc \
835 gnu/gcj/xlib/natXButtonEvent.cc \
836 gnu/gcj/xlib/natXColor.cc \
837 gnu/gcj/xlib/natXConfigureEvent.cc \
838 gnu/gcj/xlib/natXException.cc \
839 gnu/gcj/xlib/natXExposeEvent.cc \
840 gnu/gcj/xlib/natXImage.cc \
841 gnu/gcj/xlib/natXUnmapEvent.cc
842
843 ## ################################################################
844
845 ##
846 ## Creating and installing sources.zip
847 ##
848
849 ## Create a zip holding all the sources.  This can be meaningfully
850 ## used in Eclipse.
851 src.zip:
852         -rm -f src.zip
853         here=`pwd`; \
854         ( \
855           ( cd $(srcdir)/classpath; \
856           find java gnu javax org -name '*.java' -print | \
857           while read file; do \
858 ## Ugly code to avoid "echo -C".  Must separate each entry by a newline
859 ## Gross but easy.
860             echo "x-C" | sed -e 's/^.//'; \
861             echo $(srcdir)/classpath; \
862             echo $$file; \
863           done ); \
864 ## Now the build tree.
865           ( cd classpath; \
866             find gnu java -name '*.java' -print | \
867             while read file; do \
868             echo "x-C" | sed -e 's/^.//'; \
869             echo `pwd`; \
870             echo $$file; \
871           done ); \
872         ) | \
873 ## Many of the above circumlocutions were because ZIP used to be a
874 ## relative path to fastjar.  It didn't seem worthwhile to change the
875 ## code when we moved to an external jar.
876         $(JAR) -cfM@ $$here/src.zip
877 ## Override GNU Classpath sources with libgcj replacements.
878         here=`pwd`; \
879         ( \
880           ( cd $(srcdir); \
881           find gnu java -name '*.java' -print | \
882           while read file; do \
883             echo "x-C" | sed -e 's/^.//'; \
884             echo $(srcdir); \
885             echo $$file; \
886           done ); \
887         ) | \
888         $(JAR) -ufM@ $$here/src.zip
889
890 ## We use a variable for this in case the user wants to override it.
891 sourcesdir = $(jardir)
892
893 install-src.zip: src.zip
894         $(INSTALL_DATA) src.zip $(DESTDIR)$(sourcesdir)/src-$(gcc_version).zip
895
896
897 ## ################################################################
898
899 ##
900 ## Dependency tracking madness.
901 ##
902
903 ## This is an evil hack to work around an automake limitation.  We
904 ## need to ensure that all CNI headers are built, not just the ones
905 ## used internally by libgcj. We can't make the .o files depend on
906 ## nat_headers, because in that case we'll force a complete rebuild of
907 ## the C++ code whenever any .java file is touched.  So instead we
908 ## have a dummy rule which is only used once, namely the first time a
909 ## build is done.  On subsequent builds, the dependency tracking for
910 ## the .cc compilations will have picked up the .h files, and these
911 ## will be built directly as needed.
912
913 headers.stamp:
914 ## Note that we don't use a real dependency here, since we don't want
915 ## to rebuild all the headers here when the header list changes.  If
916 ## we did rebuild here, then any addition of a .java file would cause
917 ## a large number of recompilations.
918         $(MAKE) create-headers
919         @echo > headers.stamp
920
921 headers_to_make = $(nat_headers)
922 if XLIB_AWT
923 headers_to_make += $(xlib_nat_headers)
924 endif
925
926 create-headers: $(headers_to_make)
927
928 .PHONY: create-headers
929
930 $(libgcj_la_OBJECTS) $(gcj_dbtool_OBJECTS) $(xlib_nat_files): headers.stamp
931 $(libgij_la_OBJECTS): headers.stamp
932
933 ## ################################################################
934
935 ##
936 ## This section is for make and multilib madness.
937 ##
938
939 # Work around what appears to be a GNU make bug handling MAKEFLAGS
940 # values defined in terms of make variables, as is the case for CC and
941 # friends when we are called from the top level Makefile.
942 AM_MAKEFLAGS = \
943         "AR_FLAGS=$(AR_FLAGS)" \
944         "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
945         "CFLAGS=$(CFLAGS)" \
946         "CXXFLAGS=$(CXXFLAGS)" \
947         "CPPFLAGS=$(CPPFLAGS)" \
948         "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
949         "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
950         "INSTALL=$(INSTALL)" \
951         "INSTALL_DATA=$(INSTALL_DATA)" \
952         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
953         "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
954         "GCJFLAGS=$(GCJFLAGS)" \
955         "LDFLAGS=$(LDFLAGS)" \
956         "LIBCFLAGS=$(LIBCFLAGS)" \
957         "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
958         "MAKE=$(MAKE)" \
959         "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
960         "PICFLAG=$(PICFLAG)" \
961         "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
962         "SHELL=$(SHELL)" \
963         "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
964         "exec_prefix=$(exec_prefix)" \
965         "infodir=$(infodir)" \
966         "libdir=$(libdir)" \
967         "prefix=$(prefix)" \
968         "gxx_include_dir=$(gxx_include_dir)" \
969         "AR=$(AR)" \
970         "AS=$(AS)" \
971         "LD=$(LD)" \
972         "LIBCFLAGS=$(LIBCFLAGS)" \
973         "NM=$(NM)" \
974         "PICFLAG=$(PICFLAG)" \
975         "RANLIB=$(RANLIB)" \
976         "DESTDIR=$(DESTDIR)"
977
978 # Subdir rules rely on $(FLAGS_TO_PASS)
979 FLAGS_TO_PASS = $(AM_MAKEFLAGS)
980
981 CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host
982
983 MAKEOVERRIDES=
984
985 # No install-html support yet.
986 .PHONY: install-html
987 install-html:
988
989 # Multilib support variables.
990 MULTISRCTOP =
991 MULTIBUILDTOP =
992 MULTIDIRS =
993 MULTISUBDIR =
994 MULTIDO = true
995 MULTICLEAN = true
996
997 # Multilib support.
998 .PHONY: all-multi mostlyclean-multi clean-multi distclean-multi \
999         maintainer-clean-multi
1000
1001 all-recursive: all-multi
1002 install-recursive: install-multi
1003 mostlyclean-recursive: mostlyclean-multi
1004 clean-recursive: clean-multi
1005 distclean-recursive: distclean-multi
1006 maintainer-clean-recursive: maintainer-clean-multi
1007
1008 all-multi:
1009         : $(MAKE) ; exec $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do
1010 install-multi:
1011         $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do
1012 mostlyclean-multi:
1013         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean
1014 clean-multi:
1015         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean
1016 distclean-multi:
1017         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean
1018 maintainer-clean-multi:
1019         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean