OSDN Git Service

Initial revision
[pf3gnuchains/gcc-fork.git] / libjava / classpath / lib / Makefile.am
1 JAVA_DEPEND = java.dep
2
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)
7
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 -path \*/CVS -prune -o -type f -print)
11 iconfiles :=  $(shell cd $(top_srcdir) && $(FIND) gnu/javax/swing/plaf/gtk/icons -name *.png -type f -print)
12
13 compile_classpath = $(vm_classes):$(top_srcdir):$(top_srcdir)/external/w3c_dom:$(top_srcdir)/external/sax:.:$(USER_CLASSLIB)
14
15 # handling source to bytecode compiler programs like gcj, jikes  and kjc
16 if FOUND_GCJ
17 # Since we don't feed all classes at once gcj needs to know where to find
18 # the generated classes (in top_builddir).
19 JAVAC = $(srcdir)/split-for-gcj.sh && $(MAKE) -f $(srcdir)/Makefile.gcj \
20     GCJ='$(GCJ)' compile_classpath='$(top_builddir):$(compile_classpath)'
21 else
22 if FOUND_JIKES
23 JAVAC = $(JIKES) +Pno-shadow +Pno-switchcheck +F $(JIKESENCODING) -bootclasspath '' -extdirs '' -sourcepath '' --classpath $(compile_classpath) -d . @classes
24 else
25 if FOUND_KJC
26 ## FIXME: from what I can tell, kjc does not support a -encoding option.
27 JAVAC = $(KJC) -classpath .:$(USER_CLASSLIB) -d . @classes
28 else
29 if FOUND_GCJX
30 JAVAC = $(GCJX) -encoding UTF-8 -classpath .:$(USER_CLASSLIB) -d . @classes
31 else
32 if FOUND_ECJ
33 JAVAC = $(ECJ) -encoding UTF-8 -warn:-deprecation,serial -proceedOnError -bootclasspath '' -classpath $(compile_classpath) -d . @classes
34 endif # FOUND_ECJ
35 endif # FOUND_GCJX
36 endif # FOUND_KJC
37 endif # FOUND_GCJ
38 endif # FOUND_JIKES
39
40 JAVAH = $(USER_JAVAH) -jni -classpath .:$(USER_CLASSLIB)
41
42 if INSTALL_GLIBJ_ZIP
43
44 pkgdata_DATA = glibj.zip
45
46 endif # INSTALL_GLIBJ_ZIP
47
48 if BUILD_CLASS_FILES
49 noinst_DATA = genclasses compile-classes resources
50 endif # BUILD_CLASS_FILES
51
52 if INSTALL_CLASS_FILES
53
54 install-data-local: genclasses compile-classes
55         -$(top_srcdir)/mkinstalldirs $(DESTDIR)$(pkgdatadir)
56         cp -R gnu $(DESTDIR)$(pkgdatadir)
57         cp -R java $(DESTDIR)$(pkgdatadir)
58         cp -R javax $(DESTDIR)$(pkgdatadir)
59         cp -R org $(DESTDIR)$(pkgdatadir)
60         cp -R META-INF $(DESTDIR)$(pkgdatadir)
61
62 # FIXME - should mimic doc/api/Makefile.am instead...
63 uninstall-local:
64         rm -rf $(DESTDIR)$(pkgdatadir)/gnu
65         rm -rf $(DESTDIR)$(pkgdatadir)/java
66         rm -rf $(DESTDIR)$(pkgdatadir)/javax
67         rm -rf $(DESTDIR)$(pkgdatadir)/org
68         rm -rf $(DESTDIR)$(pkgdatadir)/META-INF
69
70 endif # INSTALL_CLASS_FILES
71
72 .PHONY: genclasses
73
74 glibj.zip: classes compile-classes resources
75         if test "$(ZIP)" != ""; then $(ZIP) -r -D glibj.zip gnu java javax org META-INF > /dev/null; fi
76
77 resources:
78         if ! [ -e gnu ]; then mkdir gnu; fi
79         if ! [ -e gnu/java ]; then mkdir gnu/java; fi
80         if ! [ -e gnu/java/locale ]; then mkdir gnu/java/locale; fi
81         if ! [ -e gnu/javax/swing/plaf/gtk/icons ]; then mkdir -p gnu/javax/swing/plaf/gtk/icons; fi
82         @list='$(propertydirs)'; for p in $$list; do \
83           if ! [ -e $$p ]; then mkdir $$p; fi; \
84         done
85         @list='$(propertyfiles)'; for p in $$list; do \
86           cp $(top_srcdir)/resource/$$p $$p; \
87         done
88         @list='$(metafiles)'; for p in $$list; do \
89           cp $(top_srcdir)/resource/$$p $$p; \
90         done
91         @list='$(iconfiles)'; for p in $$list; do \
92           cp $(top_srcdir)/$$p $$p; \
93         done
94         touch resources
95
96 classes: genclasses
97
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
101
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
104
105 # Only rebuild parsers when explicitly asked to.
106 if REGEN_PARSERS
107
108 gen-xpath-parser: $(top_srcdir)/gnu/xml/xpath/XPathParser.java
109
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
114
115 gen-xpath-parser:
116         true
117
118 endif # REGEN_PARSER
119
120 $(JAVA_DEPEND): genclasses
121
122 compile-classes: classes $(JAVA_SRCS) Makefile
123         $(JAVAC)
124         touch compile-classes
125
126 EXTRA_DIST = standard.omit mkcollections.pl.in Makefile.gcj split-for-gcj.sh
127 CLEANFILES = compile-classes resources classes \
128         classes.standard classes.awt classes.standardx classes.xml \
129         glibj.zip classes.1 \
130         $(top_builddir)/java/util/LocaleData.java \
131         $(JAVA_DEPEND)
132
133 clean-local:
134         -rm -rf gnu
135         -rm -rf java
136         -rm -rf javax
137         -rm -rf org
138         -rm -rf META-INF
139         -rm -rf lists
140         -rm -f Makefile.deps
141
142 dist-hook:
143         mkdir -p $(distdir)
144         cp -dfR $(top_srcdir)/gnu $(top_srcdir)/java $(top_srcdir)/javax $(top_srcdir)/org $(top_srcdir)/vm $(top_srcdir)/resource $(top_distdir)
145 # Delete not wanted files.
146         $(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
147         $(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
148         $(FIND) $(top_distdir)/gnu $(top_distdir)/java $(top_distdir)/javax $(top_distdir)/org $(top_distdir)/vm -name class-dependencies.conf -print | xargs rm -f
149         rm -f $(top_distdir)/gnu/classpath/Configuration.java
150         rm -f $(top_distdir)/java/util/LocaleData.java
151 # Omit files listed in standard.omit.
152         ( cd $(top_distdir)/lib ; cat $(top_builddir)/lib/standard.omit | sed -e 's/\$$//' | sed -e 's/\/\.\*//' | xargs rm -fr )