Imported GNU Classpath 0.19 + gcj-import-20051115.
[official-gcc.git] / libjava / classpath / lib / Makefile.am
blob9d44ef0c5319b55cce7a2773e6810ac52ce04763
1 JAVA_DEPEND = java.dep
3 ## silently try to include these, if it fails gnu make
4 ## will remake these 'makefiles' with the rules given in
5 ## this file and restart the make process again
6 sinclude $(JAVA_DEPEND)
8 propertydirs :=  $(shell cd $(top_srcdir)/resource && $(FIND) gnu java org META-INF -type d ! -name CVS -print)
9 propertyfiles :=  $(shell cd $(top_srcdir)/resource && $(FIND) gnu java org -name \*\.properties -print)
10 metafiles :=  $(shell cd $(top_srcdir)/resource && $(FIND) META-INF -name CVS -prune -o -type f -print)
11 iconfiles :=  $(shell cd $(top_srcdir) && $(FIND) gnu/javax/swing/plaf/gtk/icons -name *.png -type f -print)
13 compile_classpath = $(vm_classes):$(top_srcdir):$(top_srcdir)/external/w3c_dom:$(top_srcdir)/external/sax:.:$(USER_CLASSLIB)
15 # handling source to bytecode compiler programs like gcj, jikes  and kjc
16 if FOUND_GCJ
17 ## This should never be used when gcj is the compiler.
18 ## See the compile-classes target.
19 JAVAC = exit 1
20 else
21 if FOUND_JIKES
22 JAVAC = $(JIKES) +Pno-shadow +Pno-switchcheck +F $(JIKESENCODING) -bootclasspath '' -extdirs '' -sourcepath '' --classpath $(compile_classpath) -d . @classes
23 else
24 if FOUND_KJC
25 ## FIXME: from what I can tell, kjc does not support a -encoding option.
26 JAVAC = $(KJC) -classpath .:$(USER_CLASSLIB) -d . @classes
27 else
28 if FOUND_GCJX
29 JAVAC = $(GCJX) -encoding UTF-8 -classpath .:$(USER_CLASSLIB) -d . @classes
30 else
31 if FOUND_ECJ
32 JAVAC = $(ECJ) -source 1.4 -encoding UTF-8 -warn:-deprecation,serial,typeHiding,unchecked,unused,varargsCast -proceedOnError -bootclasspath '' -classpath $(compile_classpath) -d . @classes
33 endif # FOUND_ECJ
34 endif # FOUND_GCJX
35 endif # FOUND_KJC
36 endif # FOUND_GCJ
37 endif # FOUND_JIKES
39 JAVAH = $(USER_JAVAH) -jni -classpath .:$(USER_CLASSLIB)
41 if INSTALL_GLIBJ_ZIP
43 glibj_DATA = glibj.zip
45 endif # INSTALL_GLIBJ_ZIP
47 if BUILD_CLASS_FILES
48 noinst_DATA = genclasses compile-classes resources
49 endif # BUILD_CLASS_FILES
51 if INSTALL_CLASS_FILES
53 install-data-local: genclasses compile-classes
54         -$(top_srcdir)/mkinstalldirs $(DESTDIR)$(pkgdatadir)
55         cp -R gnu $(DESTDIR)$(pkgdatadir)
56         cp -R java $(DESTDIR)$(pkgdatadir)
57         cp -R javax $(DESTDIR)$(pkgdatadir)
58         cp -R org $(DESTDIR)$(pkgdatadir)
59         cp -R META-INF $(DESTDIR)$(pkgdatadir)
61 # FIXME - should mimic doc/api/Makefile.am instead...
62 uninstall-local:
63         rm -rf $(DESTDIR)$(pkgdatadir)/gnu
64         rm -rf $(DESTDIR)$(pkgdatadir)/java
65         rm -rf $(DESTDIR)$(pkgdatadir)/javax
66         rm -rf $(DESTDIR)$(pkgdatadir)/org
67         rm -rf $(DESTDIR)$(pkgdatadir)/META-INF
69 endif # INSTALL_CLASS_FILES
71 .PHONY: genclasses
73 glibj.zip: classes compile-classes resources
74         if test "$(ZIP)" != ""; then $(ZIP) -r -D glibj.zip gnu java javax org META-INF > /dev/null; fi
76 resources: copy-vmresources.sh
77         if ! [ -e gnu ]; then mkdir gnu; fi
78         if ! [ -e gnu/java ]; then mkdir gnu/java; fi
79         if ! [ -e gnu/java/locale ]; then mkdir gnu/java/locale; fi
80         if ! [ -e gnu/javax/swing/plaf/gtk/icons ]; then mkdir -p gnu/javax/swing/plaf/gtk/icons; fi
81         @list='$(propertydirs)'; for p in $$list; do \
82           if ! [ -e $$p ]; then mkdir $$p; fi; \
83         done
84         @list='$(propertyfiles)'; for p in $$list; do \
85           cp $(top_srcdir)/resource/$$p $$p; \
86         done
87         @list='$(metafiles)'; for p in $$list; do \
88           cp $(top_srcdir)/resource/$$p $$p; \
89         done
90         @$(SHELL) ./copy-vmresources.sh
91         @list='$(iconfiles)'; for p in $$list; do \
92           cp $(top_srcdir)/$$p $$p; \
93         done
94         touch resources
96 classes: genclasses
98 $(top_builddir)/java/util/LocaleData.java: $(top_srcdir)/scripts/generate-locale-list.sh 
99         mkdir -p $(top_builddir)/java/util
100         $(top_srcdir)/scripts/generate-locale-list.sh > $(top_builddir)/java/util/LocaleData.java
102 genclasses: gen-classlist.sh standard.omit $(top_builddir)/java/util/LocaleData.java gen-xpath-parser
103         top_builddir=$(top_builddir) top_srcdir=$(top_srcdir) $(SHELL) ./gen-classlist.sh standard
105 # Only rebuild parsers when explicitly asked to.
106 if REGEN_PARSERS
108 gen-xpath-parser: $(top_srcdir)/gnu/xml/xpath/XPathParser.java
110 $(top_srcdir)/gnu/xml/xpath/XPathParser.java: $(top_srcdir)/gnu/xml/xpath/XPathParser.y
111         ( cd $(top_srcdir)/gnu/xml/xpath; \
112           $(JAY) XPathParser.y < $(JAY_SKELETON) > XPathParser.java )
113 else
115 gen-xpath-parser:
116         true
118 endif # REGEN_PARSER
120 $(JAVA_DEPEND): genclasses
122 if FOUND_GCJ
123 ## When building with gcj, we do a recursive make.  We split this rule
124 ## out specially, rather than simply defining JAVAC, so that GNU make
125 ## will see the recursive make invocation and still allow parallel
126 ## builds.
127 compile-classes: classes $(JAVA_SRCS) Makefile
128         $(MAKE) -f $(srcdir)/Makefile.gcj \
129           GCJ='$(GCJ)' \
130           compile_classpath='$(top_builddir):$(compile_classpath)' \
131           top_srcdir=$(top_srcdir)
132 else
133 compile-classes: classes $(JAVA_SRCS) Makefile
134         $(JAVAC)
135         touch compile-classes
136 endif
138 EXTRA_DIST = standard.omit mkcollections.pl.in Makefile.gcj split-for-gcj.sh
139 CLEANFILES = compile-classes resources classes \
140         glibj.zip classes.1 \
141         $(top_builddir)/java/util/LocaleData.java \
142         $(JAVA_DEPEND)
144 clean-local:
145         -rm -rf gnu
146         -rm -rf java
147         -rm -rf javax
148         -rm -rf org
149         -rm -rf com
150         -rm -rf META-INF
151         -rm -rf lists
152         -rm -f Makefile.deps
154 dist-hook:
155         mkdir -p $(distdir)
156         cp -dfR $(top_srcdir)/gnu $(top_srcdir)/java $(top_srcdir)/javax $(top_srcdir)/org $(top_srcdir)/vm $(top_srcdir)/resource $(top_distdir)
157 # Delete not wanted files.
158         $(FIND) $(top_distdir)/gnu $(top_distdir)/java $(top_distdir)/javax $(top_distdir)/org $(top_distdir)/vm $(top_distdir)/resource -name CVS -print | xargs rm -fr
159         $(FIND) $(top_distdir)/gnu $(top_distdir)/java $(top_distdir)/javax $(top_distdir)/org $(top_distdir)/vm $(top_distdir)/resource -name .cvsignore -print | xargs rm -f
160         $(FIND) $(top_distdir)/gnu $(top_distdir)/java $(top_distdir)/javax $(top_distdir)/org $(top_distdir)/vm -name class-dependencies.conf -print | xargs rm -f
161         rm -f $(top_distdir)/gnu/classpath/Configuration.java
162         rm -f $(top_distdir)/java/util/LocaleData.java