automake: Java

1 
1 10.4 Java bytecode compilation (deprecated)
1 ===========================================
1 
1 Automake provides some minimal support for Java bytecode compilation
1 with the ‘JAVA’ primary (in addition to the support for compiling Java
1 to native machine code; ⇒Java Support with gcj).  Note however
1 that _the interface and most features described here are deprecated_.
1 Future Automake releases will strive to provide a better and cleaner
1 interface, which however _won’t be backward-compatible_; the present
1 interface will probably be removed altogether some time after the
1 introduction of the new interface (if that ever materializes).  In any
1 case, the current ‘JAVA’ primary features are frozen and will no longer
1 be developed, not even to take bug fixes.
1 
1    Any ‘.java’ files listed in a ‘_JAVA’ variable will be compiled with
1 ‘JAVAC’ at build time.  By default, ‘.java’ files are not included in
1 the distribution, you should use the ‘dist_’ prefix to distribute them.
1 
1    Here is a typical setup for distributing ‘.java’ files and installing
1 the ‘.class’ files resulting from their compilation.
1 
1      javadir = $(datadir)/java
1      dist_java_JAVA = a.java b.java ...
1 
1    Currently Automake enforces the restriction that only one ‘_JAVA’
1 primary can be used in a given ‘Makefile.am’.  The reason for this
1 restriction is that, in general, it isn’t possible to know which
1 ‘.class’ files were generated from which ‘.java’ files, so it would be
1 impossible to know which files to install where.  For instance, a
1 ‘.java’ file can define multiple classes; the resulting ‘.class’ file
1 names cannot be predicted without parsing the ‘.java’ file.
1 
1    There are a few variables that are used when compiling Java sources:
1 
1 ‘JAVAC’
1      The name of the Java compiler.  This defaults to ‘javac’.
1 
1 ‘JAVACFLAGS’
1      The flags to pass to the compiler.  This is considered to be a user
1      variable (⇒User Variables).
1 
1 ‘AM_JAVACFLAGS’
1      More flags to pass to the Java compiler.  This, and not
1      ‘JAVACFLAGS’, should be used when it is necessary to put Java
1      compiler flags into ‘Makefile.am’.
1 
1 ‘JAVAROOT’
1      The value of this variable is passed to the ‘-d’ option to ‘javac’.
1      It defaults to ‘$(top_builddir)’.
1 
1 ‘CLASSPATH_ENV’
1      This variable is a shell expression that is used to set the
1      ‘CLASSPATH’ environment variable on the ‘javac’ command line.  (In
1      the future we will probably handle class path setting differently.)
1