]> sourceware.org Git - automake.git/commitdiff
initial java support
authorTom Tromey <tromey@redhat.com>
Thu, 19 Mar 1998 00:30:06 +0000 (00:30 +0000)
committerTom Tromey <tromey@redhat.com>
Thu, 19 Mar 1998 00:30:06 +0000 (00:30 +0000)
17 files changed:
ChangeLog
Makefile.am
Makefile.in
NEWS
TODO
automake.in
automake.texi
java-clean.am [new file with mode: 0644]
java.am [new file with mode: 0644]
lib/am/Makefile.am
lib/am/java.am [new file with mode: 0644]
stamp-vti
tests/ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/java.test [new file with mode: 0755]
version.texi

index a7bf1dfce89cfbc8a8dfc943e17f7e047118020e..168313ae97a556679dc16af870f1869630932bf0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Wed Mar 18 14:48:44 1998  Tom Tromey  <tromey@cygnus.com>
+
+       * Makefile.am (pkgdata_DATA): Added java.am, java-clean.am.
+       * java-clean.am: New file.
+       * java.am: New file.
+       * automake.in (generate_makefile): Call handle_java.
+       (handle_java): New sub.
+       (am_install_var): Only push primary variable on @all if not doing
+       Java.
+
 Sun Mar  8 15:43:09 1998  Tom Tromey  <tromey@cygnus.com>
 
        * automake.in (handle_configure): When recognizing AC_OUTPUT ":"
index b54f88f9c7d6fc7e9a9eabbfaebedd45c0321c1a..e9ac5bfe8ec297390930f5a67146954bada7e499 100644 (file)
@@ -15,7 +15,7 @@ libtool.am ltlib.am ltlibrary.am mans-vars.am program.am progs.am \
 remake-hdr.am remake.am scripts.am subdirs.am tags.am tags-clean.am \
 texi-vers.am texinfos.am libs-clean.am ltlib-clean.am progs-clean.am \
 data-clean.am COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1        \
-lisp.am lisp-clean.am mans.am
+lisp.am lisp-clean.am mans.am java.am java-clean.am
 
 ## These must all be executable when installed.
 pkgdata_SCRIPTS = config.guess config.sub install-sh mdate-sh missing \
index 233c0172b5e4459785cf1dc29d523eae22075091..f85dd9a593c3b596d8e35f383805bb80bb993be8 100644 (file)
@@ -76,7 +76,7 @@ libtool.am ltlib.am ltlibrary.am mans-vars.am program.am progs.am \
 remake-hdr.am remake.am scripts.am subdirs.am tags.am tags-clean.am \
 texi-vers.am texinfos.am libs-clean.am ltlib-clean.am progs-clean.am \
 data-clean.am COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1        \
-lisp.am lisp-clean.am mans.am
+lisp.am lisp-clean.am mans.am java.am java-clean.am
 
 pkgdata_SCRIPTS = config.guess config.sub install-sh mdate-sh missing \
 mkinstalldirs elisp-comp ylwrap acinstall
diff --git a/NEWS b/NEWS
index 570258650373357c51c2ef7325b9bfcea112715c..c0514d4dd23d6cfc3ceefe58fd7e5822a08cd387 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,7 @@ New in 1.2f:
 * Passed YFLAGS, not YACCFLAGS, to yacc 
 * AM_PROG_CC_STDC does not have to come before AC_PROG_CPP
 * Dependencies computed as a side effect of compilation
+* Preliminary support for Java
 \f
 New in 1.2:
 * Bug fixes
diff --git a/TODO b/TODO
index 13c04682c4b9a4482bc4a712ec33ead2e2611b79..b3136cbfe960da574a0602e7d1cae89d82f2fcda 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,3 +1,11 @@
+* something like this fails:
+
+       foo = ... \
+
+       lib_LTLIBRARIES = foo.la
+
+  this should give an error.
+
 * dependency tracking doesn't work well when a file is removed
   the new code to track header dependencies exacerbates this
   what is the fix?
index 5acc480085923adb0fbe41a550124736dcb889b3..3041f55232bcb8a0ffc6c02140e07cc30d6c147c 100755 (executable)
@@ -576,6 +576,7 @@ sub generate_makefile
 
     &handle_texinfo;
     &handle_emacs_lisp;
+    &handle_java;
     &handle_man_pages;
     &handle_data;
     &handle_headers;
@@ -3882,6 +3883,47 @@ sub handle_emacs_lisp
     }
 }
 
+# Handle Java.
+sub handle_java
+{
+    local (@sourcelist) = &am_install_var ('-clean', 'java', 'JAVA',
+                                          'java', 'noinst', 'check');
+    return if ! @sourcelist;
+
+    &define_variable ('JAVAC', 'javac');
+    &define_variable ('JAVACFLAGS', '');
+    &define_variable ('CLASSPATH_ENV',
+                     'CLASSPATH=../..:$(srcdir)/../..:$$CLASSPATH');
+    &define_variable ('JAVAROOT', '$(top_builddir)');
+
+    local (%valid) = &am_primary_prefixes ('JAVA', 'java', 'noinst', 'check');
+
+    local ($dir, $curs);
+    foreach $curs (keys %valid)
+    {
+       if (! &variable_defined ($curs . '_JAVA') || $curs eq 'noinst'
+           || $curs eq 'EXTRA')
+       {
+           next;
+       }
+
+       if (defined $dir)
+       {
+           print STDERR "got $curs\n";
+           &am_line_error ($curs . '_JAVA',
+                           "multiple _JAVA primaries in use");
+       }
+       $dir = $curs;
+    }
+
+    $output_rules .= ('class' . $dir . '.stamp: $(' . $dir . '_JAVA)' . "\n"
+                     . "\t" . '$(CLASSPATH_ENV) $(JAVAC) $(JAVACFLAGS) '
+                     . '-d $(JAVAROOT) $?' . "\n"
+                     . "\t" . 'echo timestamp > class' . $dir . '.stamp'
+                     . "\n");
+    push (@all, 'class' . $dir . '.stamp');
+}
+
 # Handle some of the minor options.
 sub handle_minor_options
 {
@@ -5936,7 +5978,7 @@ sub am_install_var
 
     # Push here because PRIMARY might be configure time determined.
     push (@all, '$(' . $primary . ')')
-       if @used;
+       if @used && $primary ne 'JAVA';
 
     return (@result);
 }
index f5f0d12e1c373a1455cbdeb5fa2b32e077d324ca..94d4de6a3f50d0438e3062a852df867ba7702485 100644 (file)
@@ -172,6 +172,7 @@ Other GNU Tools
 * gettext::                     Gettext
 * Guile::                       Guile
 * Libtool::                     Libtool
+* Java::                        Java
 
 Building documentation
 
@@ -1878,6 +1879,7 @@ use in GNU programs, it tries hard to interoperate with other GNU tools.
 * gettext::                     Gettext
 * Guile::                       Guile
 * Libtool::                     Libtool
+* Java::                        Java
 @end menu
 
 @node Emacs Lisp, gettext, Other GNU Tools, Other GNU Tools
@@ -1941,13 +1943,29 @@ macro is understood to mean:
 As the Guile module code matures, no doubt the Automake support will
 grow as well.
 
-@node Libtool,  , Guile, Other GNU Tools
+@node Libtool, Java, Guile, Other GNU Tools
 @section Libtool
 
 Automake provides support for GNU Libtool (@pxref{Top, , The Libtool
 Manual, libtool, The Libtool Manual}) with the @samp{LTLIBRARIES}
 primary.  @xref{A Shared Library}.
 
+@node Java, , Libtool, Other GNU Tools
+
+Automake provides some minimal support for Java compilation with the
+@samp{JAVA} primary.
+
+Any @samp{.java} files listed in a @samp{_JAVA} variable will be
+compiled with @code{JAVAC} at build time.  By default, @samp{.class}
+files are not included in the distribution.
+
+Currently Automake enforces the restriction that only one @samp{_JAVA}
+primary can be used in a given @file{Makefile.am}.  The reason for this
+restriction is that, in general, it isn't possible to know which
+@samp{.class} files were generated from which @samp{.java} files -- so
+it would be impossible to know which files to install where.
+
+
 @node Documentation, Install, Other GNU Tools, Top
 @chapter Building documentation
 
diff --git a/java-clean.am b/java-clean.am
new file mode 100644 (file)
index 0000000..af20493
--- /dev/null
@@ -0,0 +1,25 @@
+## automake - create Makefile.in from Makefile.am
+## Copyright (C) 1998 Free Software Foundation, Inc.
+
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2, or (at your option)
+## any later version.
+
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+## 02111-1307, USA.
+mostlyclean-@DIR@JAVA:
+
+clean-@DIR@JAVA:
+       -rm *.class class@DIR@.stamp
+
+distclean-@DIR@JAVA:
+
+maintainer-clean-@DIR@JAVA:
diff --git a/java.am b/java.am
new file mode 100644 (file)
index 0000000..8011072
--- /dev/null
+++ b/java.am
@@ -0,0 +1,33 @@
+## automake - create Makefile.in from Makefile.am
+## Copyright (C) 1998 Free Software Foundation, Inc.
+
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2, or (at your option)
+## any later version.
+
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+## 02111-1307, USA.
+install-@DIR@JAVA: class@DIR@.stamp
+       @$(NORMAL_INSTALL)
+       $(mkinstalldirs) $(@DIR@dir)
+## A single .java file can be compiled into multiple .class files.  So
+## we just install all the .class files that got built into this
+## directory.  This is not optimal, but will have to do for now.
+       for p in *.class; do \
+         echo " $(INSTALL_DATA) $$p $(@DIR@dir)/$$p"; \
+         $(INSTALL_DATA) $$p $(@DIR@dir)/$$p; \
+       done
+
+uninstall-@DIR@JAVA:
+       @$(NORMAL_UNINSTALL)
+       for p in *.class; do \
+         rm -f $(@DIR@dir)/$$p; \
+       done
index b54f88f9c7d6fc7e9a9eabbfaebedd45c0321c1a..e9ac5bfe8ec297390930f5a67146954bada7e499 100644 (file)
@@ -15,7 +15,7 @@ libtool.am ltlib.am ltlibrary.am mans-vars.am program.am progs.am \
 remake-hdr.am remake.am scripts.am subdirs.am tags.am tags-clean.am \
 texi-vers.am texinfos.am libs-clean.am ltlib-clean.am progs-clean.am \
 data-clean.am COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1        \
-lisp.am lisp-clean.am mans.am
+lisp.am lisp-clean.am mans.am java.am java-clean.am
 
 ## These must all be executable when installed.
 pkgdata_SCRIPTS = config.guess config.sub install-sh mdate-sh missing \
diff --git a/lib/am/java.am b/lib/am/java.am
new file mode 100644 (file)
index 0000000..8011072
--- /dev/null
@@ -0,0 +1,33 @@
+## automake - create Makefile.in from Makefile.am
+## Copyright (C) 1998 Free Software Foundation, Inc.
+
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2, or (at your option)
+## any later version.
+
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+## 02111-1307, USA.
+install-@DIR@JAVA: class@DIR@.stamp
+       @$(NORMAL_INSTALL)
+       $(mkinstalldirs) $(@DIR@dir)
+## A single .java file can be compiled into multiple .class files.  So
+## we just install all the .class files that got built into this
+## directory.  This is not optimal, but will have to do for now.
+       for p in *.class; do \
+         echo " $(INSTALL_DATA) $$p $(@DIR@dir)/$$p"; \
+         $(INSTALL_DATA) $$p $(@DIR@dir)/$$p; \
+       done
+
+uninstall-@DIR@JAVA:
+       @$(NORMAL_UNINSTALL)
+       for p in *.class; do \
+         rm -f $(@DIR@dir)/$$p; \
+       done
index 3d74caed511cf25cde9137d5f57ef08b4c9156a4..44fa93612a6f9ae012eb6f1afbcb545e82a91a2d 100644 (file)
--- a/stamp-vti
+++ b/stamp-vti
@@ -1,3 +1,3 @@
-@set UPDATED 12 February 1998
+@set UPDATED 18 March 1998
 @set EDITION 1.2f
 @set VERSION 1.2f
index 1acee44527ce9c5c4f04935725f9083508a2d1e1..17ec2b3bcffb7e80266225c5dc680d9e33192e0c 100644 (file)
@@ -1,3 +1,7 @@
+Wed Mar 18 17:15:22 1998  Tom Tromey  <tromey@cygnus.com>
+
+       * java.test: New file.
+
 Sun Mar  8 15:35:14 1998  Tom Tromey  <tromey@cygnus.com>
 
        * colon4.test: New file.
index 3f2dcf230cdd8ebc47dadd94cceac9f8c90994a7..10c02cdaacfedf5eadc9bc6cf1dfb542cbd8ee1d 100644 (file)
@@ -28,7 +28,8 @@ stamph.test ldadd.test version2.test conf2.test cond.test cond2.test \
 xsource.test libobj6.test depend3.test output5.test ammissing.test \
 install.test libobj7.test objc.test cond3.test cxxcpp.test \
 aclocal.test alpha.test whoami.test unused.test condman.test \
-texinfo5.test aclocali.test texinfo6.test condman2.test colon4.test
+texinfo5.test aclocali.test texinfo6.test condman2.test colon4.test \
+java.am
 
 EXTRA_DIST = defs $(TESTS)
 
index 8831e98f793c844780b7c7841458db53e192023a..cb1f0496fdc37a86898802816e231eb7943dee6e 100644 (file)
@@ -89,7 +89,8 @@ stamph.test ldadd.test version2.test conf2.test cond.test cond2.test \
 xsource.test libobj6.test depend3.test output5.test ammissing.test \
 install.test libobj7.test objc.test cond3.test cxxcpp.test \
 aclocal.test alpha.test whoami.test unused.test condman.test \
-texinfo5.test aclocali.test texinfo6.test condman2.test colon4.test
+texinfo5.test aclocali.test texinfo6.test condman2.test colon4.test \
+java.am
 
 EXTRA_DIST = defs $(TESTS)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
diff --git a/tests/java.test b/tests/java.test
new file mode 100755 (executable)
index 0000000..ed3c2df
--- /dev/null
@@ -0,0 +1,13 @@
+#! /bin/sh
+
+# Minimal test of Java functionality.
+
+. $srcdir/defs || exit 1
+
+cat > Makefile.am << 'END'
+javadir = $(datadir)/java
+java_JAVA = a.java b.java c.java
+END
+
+$AUTOMAKE || exit 1
+grep '^all:.*classjava\.stamp' Makefile.in
index 3d74caed511cf25cde9137d5f57ef08b4c9156a4..44fa93612a6f9ae012eb6f1afbcb545e82a91a2d 100644 (file)
@@ -1,3 +1,3 @@
-@set UPDATED 12 February 1998
+@set UPDATED 18 March 1998
 @set EDITION 1.2f
 @set VERSION 1.2f
This page took 0.057615 seconds and 5 git commands to generate.