* mans.am (install-man%SECTION%): Minor cleanup.
[automake.git] / java.am
blobcbc7435b950fb3899a93f7ed7d7ff92c15b0eea0
1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright 1998, 1999, 2001 Free Software Foundation, Inc.
4 ## This program is free software; you can redistribute it and/or modify
5 ## it under the terms of the GNU General Public License as published by
6 ## the Free Software Foundation; either version 2, or (at your option)
7 ## any later version.
9 ## This program is distributed in the hope that it will be useful,
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 ## GNU General Public License for more details.
14 ## You should have received a copy of the GNU General Public License
15 ## along with this program; if not, write to the Free Software
16 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17 ## 02111-1307, USA.
20 ## --------- ##
21 ## Bulding.  ##
22 ## --------- ##
24 JAVAC = javac
25 JAVACFLAGS =
26 CLASSPATH_ENV = CLASSPATH=$(JAVAROOT):$(srcdir)/$(JAVAROOT):$$CLASSPATH
27 JAVAROOT = $(top_builddir)
29 class%DIR%.stamp: $(%DIR%_JAVA)
30         $(CLASSPATH_ENV) $(JAVAC) -d $(JAVAROOT) $(JAVACFLAGS) $?
31         echo timestamp > class%DIR%.stamp
34 ## ------------ ##
35 ## Installing.  ##
36 ## ------------ ##
38 if %?INSTALL%
39 _am_installdirs += $(DESTDIR)$(%NDIR%dir)
40 ?EXEC?.PHONY install-exec-am: install-%DIR%JAVA
41 ?!EXEC?.PHONY install-data-am: install-%DIR%JAVA
42 install-%DIR%JAVA: class%DIR%.stamp
43         @$(NORMAL_INSTALL)
44         $(mkinstalldirs) $(DESTDIR)$(%NDIR%dir)
45 ## A single .java file can be compiled into multiple .class files.  So
46 ## we just install all the .class files that got built into this
47 ## directory.  This is not optimal, but will have to do for now.
48         for p in *.class; do \
49           echo " $(INSTALL_DATA) $$p $(DESTDIR)$(%NDIR%dir)/$$p"; \
50           $(INSTALL_DATA) $$p $(DESTDIR)$(%NDIR%dir)/$$p; \
51         done
52 endif %?INSTALL%
55 ## -------------- ##
56 ## Uninstalling.  ##
57 ## -------------- ##
59 if %?INSTALL%
60 .PHONY uninstall-am: uninstall-%DIR%JAVA
61 uninstall-%DIR%JAVA:
62         @$(NORMAL_UNINSTALL)
63         @for p in *.class; do \
64           echo " rm -f $(DESTDIR)$(%NDIR%dir)/$$p"; \
65           rm -f $(DESTDIR)$(%NDIR%dir)/$$p; \
66         done
67 endif %?INSTALL%
70 ## ---------- ##
71 ## Cleaning.  ##
72 ## ---------- ##
74 .PHONY clean-am: clean-%DIR%JAVA
75 clean-%DIR%JAVA:
76         -rm -f *.class class%DIR%.stamp
79 ## -------------- ##
80 ## Distributing.  ##
81 ## -------------- ##
83 if %?DIST%
84 DIST_COMMON += $(%DIR%_JAVA)
85 endif %?DIST%