• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Example for use of GNU gettext.
2# This file is in the public domain.
3#
4# Makefile configuration - processed by automake.
5
6# General automake options.
7AUTOMAKE_OPTIONS = foreign
8ACLOCAL_AMFLAGS = -I m4
9
10# The list of subdirectories containing Makefiles.
11SUBDIRS = m4 po
12
13# The list of programs that are built.
14bin_JAVAPROGRAMS = hello
15
16# The source files of the 'hello' program.
17hello_SOURCES = Hello.java
18hello_CLASSES = Hello.class
19
20# The entry point of the 'hello' program.
21hello_MAINCLASS = Hello
22
23# The link dependencies of the 'hello' program.
24hello_JAVALIBS = @LIBINTL_JAR@
25
26# Additional files to be distributed.
27EXTRA_DIST = autogen.sh autoclean.sh
28
29
30# ----------------- General rules for compiling Java programs -----------------
31
32jardir = $(datadir)/$(PACKAGE)
33pkgdatadir = $(datadir)/$(PACKAGE)
34pkglibdir = $(libdir)/$(PACKAGE)
35
36JAR = @JAR@
37JAVACOMP = $(SHELL) javacomp.sh
38
39EXTRA_DIST += $(hello_SOURCES)
40CLEANFILES =
41DISTCLEANFILES = javacomp.sh javaexec.sh
42
43
44# Rules for compiling Java programs as jar libraries.
45# This is the preferred mode during development, because you can easily test
46# the program without installing it, simply by doing "java -jar hello.jar".
47
48all-local: hello.jar hello.sh
49
50hello.jar: $(hello_CLASSES)
51	{ echo "Manifest-Version: 1.0"; echo "Main-Class: $(hello_MAINCLASS)"; echo 'Class-Path: @LIBINTL_JAR@'; } > Manifest.mf
52	$(JAR) cfm $@ Manifest.mf Hello*.class
53	rm -f Manifest.mf
54	abs_jar=`pwd`/$@; (cd po && $(MAKE)) && catalogs=`GNUMAKEFLAGS=--no-print-directory $(MAKE) -s -C po echo-catalogs`; test -n "$$catalogs" && (cd $(srcdir)/po && $(JAR) uf "$$abs_jar" $$catalogs) || { rm -f $@ jartmp*; exit 1; }
55
56Hello.class: $(srcdir)/Hello.java
57	CLASSPATH=.@CLASSPATH_SEPARATOR@$(hello_JAVALIBS)@CLASSPATH_SEPARATOR@$$CLASSPATH $(JAVACOMP) -d . $(srcdir)/Hello.java
58
59hello.sh:
60	{ echo '#!/bin/sh'; \
61	  echo "CLASSPATH='$(jardir)/hello.jar@CLASSPATH_SEPARATOR@$(hello_JAVALIBS)'\$${CLASSPATH+\"@CLASSPATH_SEPARATOR@\$$CLASSPATH\"}"; \
62	  echo "export CLASSPATH"; \
63	  echo "exec /bin/sh '$(pkgdatadir)/javaexec.sh' $(hello_MAINCLASS) \"\$$@\""; \
64	} > $@
65
66install-exec-local: all-local
67	$(MKDIR_P) $(DESTDIR)$(bindir)
68	$(INSTALL_SCRIPT) hello.sh $(DESTDIR)$(bindir)/hello
69
70install-data-local: all-local
71	$(MKDIR_P) $(DESTDIR)$(jardir)
72	$(INSTALL_DATA) hello.jar $(DESTDIR)$(jardir)/hello.jar
73	$(MKDIR_P) $(DESTDIR)$(pkgdatadir)
74	$(INSTALL_DATA) javaexec.sh $(DESTDIR)$(pkgdatadir)/javaexec.sh
75
76installdirs-local:
77	$(MKDIR_P) $(DESTDIR)$(jardir)
78	$(MKDIR_P) $(DESTDIR)$(pkgdatadir)
79
80uninstall-local:
81	rm -f $(DESTDIR)$(bindir)/hello
82	rm -f $(DESTDIR)$(jardir)/hello.jar
83	rm -f $(DESTDIR)$(pkgdatadir)/javaexec.sh
84
85CLEANFILES += hello.jar Hello*.class Manifest.mf hello.sh
86