Imported GNU Classpath 0.90
[official-gcc.git] / libjava / classpath / lib / Makefile.am
blobf4e45402cffd805e05e8ec6380423ae7d087b1cc
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:$(top_srcdir)/external/relaxngDatatype:.:$(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) $(JIKESWARNINGS) +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) -g -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,unused -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 CREATE_COLLECTIONS
42 COLLECTIONS = collections.jar
44 collections.jar: mkcollections.pl
45         ./mkcollections.pl $(top_srcdir)
46 if FOUND_GCJ
47         $(GCJ) -C `$(FIND) $(COLLECTIONS_PREFIX) -name '*' -type f -print`
48 else
49         $(JAVAC) `$(FIND) $(COLLECTIONS_PREFIX) -name '*' -type f -print`
50 endif
51         if test "$(FASTJAR)" != ""; then \
52           $(FASTJAR) cf $@ $(COLLECTIONS_PREFIX); \
53         else \
54           echo "fastjar not found" > collections.jar; \
55         fi
56 endif # CREATE_COLLECTIONS
58 if INSTALL_GLIBJ_ZIP
60 ## GCJ LOCAL: Comment this out so we don't make an empty
61 ## '$(glibjdir)' in the install tree.
62 ## glibj_DATA = glibj.zip
64 endif # INSTALL_GLIBJ_ZIP
66 if BUILD_CLASS_FILES
67 noinst_DATA = genclasses compile-classes resources
68 endif # BUILD_CLASS_FILES
70 if INSTALL_CLASS_FILES
72 install-data-local: genclasses compile-classes
73         -$(top_srcdir)/mkinstalldirs $(DESTDIR)$(pkgdatadir)
74         cp -R gnu $(DESTDIR)$(pkgdatadir)
75         cp -R java $(DESTDIR)$(pkgdatadir)
76         cp -R javax $(DESTDIR)$(pkgdatadir)
77         cp -R org $(DESTDIR)$(pkgdatadir)
78         cp -R META-INF $(DESTDIR)$(pkgdatadir)
80 # FIXME - should mimic doc/api/Makefile.am instead...
81 uninstall-local:
82         rm -rf $(DESTDIR)$(pkgdatadir)/gnu
83         rm -rf $(DESTDIR)$(pkgdatadir)/java
84         rm -rf $(DESTDIR)$(pkgdatadir)/javax
85         rm -rf $(DESTDIR)$(pkgdatadir)/org
86         rm -rf $(DESTDIR)$(pkgdatadir)/META-INF
88 endif # INSTALL_CLASS_FILES
90 .PHONY: genclasses
92 glibj.zip: classes compile-classes resources
93         if test "$(ZIP)" != ""; then $(ZIP) -r -D glibj.zip gnu java javax org META-INF > /dev/null; fi
94         if test "$(FASTJAR)" != ""; then $(FASTJAR) cf glibj.zip gnu java javax org META-INF; fi
96 resources: copy-vmresources.sh
97         if ! [ -e gnu ]; then mkdir gnu; fi
98         if ! [ -e gnu/java ]; then mkdir gnu/java; fi
99         if ! [ -e gnu/java/locale ]; then mkdir gnu/java/locale; fi
100         if ! [ -e gnu/javax/swing/plaf/gtk/icons ]; then mkdir -p gnu/javax/swing/plaf/gtk/icons; fi
101         list='$(propertydirs)'; for p in $$list; do \
102           if ! [ -e $$p ]; then mkdir $$p; fi; \
103         done
104         list='$(propertyfiles)'; for p in $$list; do \
105           cp -f $(top_srcdir)/resource/$$p $$p; \
106         done
107         list='$(metafiles)'; for p in $$list; do \
108           cp -f $(top_srcdir)/resource/$$p $$p; \
109         done
110         $(SHELL) ./copy-vmresources.sh
111         list='$(iconfiles)'; for p in $$list; do \
112           cp -f $(top_srcdir)/$$p $$p; \
113         done
114         touch resources
116 classes: genclasses
118 $(top_builddir)/java/util/LocaleData.java: $(top_srcdir)/scripts/generate-locale-list.sh 
119         mkdir -p $(top_builddir)/java/util
120         $(top_srcdir)/scripts/generate-locale-list.sh > $(top_builddir)/java/util/LocaleData.java
122 genclasses: gen-classlist.sh standard.omit $(top_builddir)/java/util/LocaleData.java gen-xpath-parser
123         top_builddir=$(top_builddir) top_srcdir=$(top_srcdir) $(SHELL) ./gen-classlist.sh standard
125 # Only rebuild parsers when explicitly asked to.
126 if REGEN_PARSERS
128 gen-xpath-parser: $(top_srcdir)/gnu/xml/xpath/XPathParser.java
130 $(top_srcdir)/gnu/xml/xpath/XPathParser.java: $(top_srcdir)/gnu/xml/xpath/XPathParser.y
131         ( cd $(top_srcdir)/gnu/xml/xpath; \
132           $(JAY) XPathParser.y < $(JAY_SKELETON) > XPathParser.java )
133 else
135 gen-xpath-parser:
136         true
138 endif # REGEN_PARSER
140 $(JAVA_DEPEND): genclasses
142 if FOUND_GCJ
143 ## When building with gcj, we do a recursive make.  We split this rule
144 ## out specially, rather than simply defining JAVAC, so that GNU make
145 ## will see the recursive make invocation and still allow parallel
146 ## builds.
147 compile-classes: classes $(JAVA_SRCS) Makefile
148         $(MAKE) -f $(srcdir)/Makefile.gcj \
149           GCJ='$(GCJ)' \
150           compile_classpath='$(top_builddir):$(compile_classpath)' \
151           top_srcdir=$(top_srcdir)
152 else
153 compile-classes: classes $(JAVA_SRCS) Makefile
154         $(JAVAC)
155         touch compile-classes
156 endif
158 EXTRA_DIST = standard.omit mkcollections.pl.in Makefile.gcj split-for-gcj.sh
159 CLEANFILES = compile-classes resources classes \
160         glibj.zip classes.1 \
161         $(top_builddir)/java/util/LocaleData.java \
162         $(JAVA_DEPEND)
164 clean-local:
165         -rm -rf gnu
166         -rm -rf java
167         -rm -rf javax
168         -rm -rf org
169         -rm -rf com
170         -rm -rf META-INF
171         -rm -rf lists
172         -rm -f Makefile.deps
174 dist-hook:
175         mkdir -p $(distdir)
176         cp -pdfR $(top_srcdir)/gnu $(top_srcdir)/java $(top_srcdir)/javax $(top_srcdir)/org $(top_srcdir)/vm $(top_srcdir)/resource $(distdir)/..
177 # Delete not wanted files.
178         $(FIND) $(distdir)/../gnu $(distdir)/../java $(distdir)/../javax $(distdir)/../org $(distdir)/../vm $(distdir)/../resource -name CVS -print | xargs rm -fr
179         $(FIND) $(distdir)/../gnu $(distdir)/../java $(distdir)/../javax $(distdir)/../org $(distdir)/../vm $(distdir)/../resource -name .cvsignore -print | xargs rm -f
180         $(FIND) $(distdir)/../gnu $(distdir)/../java $(distdir)/../javax $(distdir)/../org $(distdir)/../vm -name class-dependencies.conf -print | xargs rm -f
181         rm -f $(distdir)/../gnu/classpath/Configuration.java
182         rm -f $(distdir)/../java/util/LocaleData.java