• 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
38AR = ar
39
40EXTRA_DIST += $(hello_SOURCES)
41CLEANFILES =
42DISTCLEANFILES = javacomp.sh javaexec.sh
43
44
45# Rules for compiling Java programs as jar libraries.
46# This is the preferred mode during development, because you can easily test
47# the program without installing it, simply by doing "java -jar hello.jar".
48
49all-local: hello.jar hello.sh
50
51hello.jar: $(hello_CLASSES)
52	{ echo "Manifest-Version: 1.0"; echo "Main-Class: $(hello_MAINCLASS)"; echo 'Class-Path: @LIBINTL_JAR@'; } > Manifest.mf
53	$(JAR) cfm $@ Manifest.mf Hello*.class
54	rm -f Manifest.mf
55	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; }
56
57Hello.class: $(srcdir)/Hello.java
58	CLASSPATH=.@CLASSPATH_SEPARATOR@$(hello_JAVALIBS) $(JAVACOMP) -d . $(srcdir)/Hello.java
59
60hello.sh:
61	{ echo '#!/bin/sh'; \
62	  echo "CLASSPATH='$(jardir)/hello.jar@CLASSPATH_SEPARATOR@$(hello_JAVALIBS)'\$${CLASSPATH+\"@CLASSPATH_SEPARATOR@\$$CLASSPATH\"}"; \
63	  echo "export CLASSPATH"; \
64	  echo "exec /bin/sh '$(pkgdatadir)/javaexec.sh' $(hello_MAINCLASS) \"\$$@\""; \
65	} > $@
66
67install-exec-local: all-local
68	$(MKDIR_P) $(DESTDIR)$(bindir)
69	$(INSTALL_SCRIPT) hello.sh $(DESTDIR)$(bindir)/hello
70
71install-data-local: all-local
72	$(MKDIR_P) $(DESTDIR)$(jardir)
73	$(INSTALL_DATA) hello.jar $(DESTDIR)$(jardir)/hello.jar
74	$(MKDIR_P) $(DESTDIR)$(pkgdatadir)
75	$(INSTALL_DATA) javaexec.sh $(DESTDIR)$(pkgdatadir)/javaexec.sh
76
77installdirs-local:
78	$(MKDIR_P) $(DESTDIR)$(jardir)
79	$(MKDIR_P) $(DESTDIR)$(pkgdatadir)
80
81uninstall-local:
82	rm -f $(DESTDIR)$(bindir)/hello
83	rm -f $(DESTDIR)$(jardir)/hello.jar
84	rm -f $(DESTDIR)$(pkgdatadir)/javaexec.sh
85
86CLEANFILES += hello.jar Hello*.class Manifest.mf hello.sh
87