www.delorie.com/gnu/docs/automake/automake_78.html   search  
Buy GNU books!


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

11.4 Java

Automake provides some minimal support for Java compilation with the `JAVA' primary.

Any `.java' files listed in a `_JAVA' variable will be compiled with JAVAC at build time. By default, `.class' files are not included in the distribution.

Currently Automake enforces the restriction that only one `_JAVA' primary can be used in a given `Makefile.am'. The reason for this restriction is that, in general, it isn't possible to know which `.class' files were generated from which `.java' files -- so it would be impossible to know which files to install where. For instance, a `.java' file can define multiple classes; the resulting `.class' file names cannot be predicted without parsing the `.java' file.

There are a few variables which are used when compiling Java sources:

The name of the Java compiler. This defaults to `javac'.

The flags to pass to the compiler. This is considered to be a user variable (see section 2.5 Variables reserved for the user).

More flags to pass to the Java compiler. This, and not JAVACFLAGS, should be used when it is necessary to put Java compiler flags into `Makefile.am'.

The value of this variable is passed to the `-d' option to javac. It defaults to `$(top_builddir)'.

This variable is an sh expression which is used to set the CLASSPATH environment variable on the javac command line. (In the future we will probably handle class path setting differently.)

  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003