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# The resources of the 'hello' program, excluding message catalogs, but 27# including the fallback message catalog. 28hello_RESOURCES = hello-java-qtjambi.properties 29 30# Resources that are generated from PO files. 31MAINTAINERCLEANFILES = hello-java-qtjambi*.properties 32 33# Additional files to be distributed. 34EXTRA_DIST = autogen.sh autoclean.sh 35 36 37# ----------------- General rules for compiling Java programs ----------------- 38 39jardir = $(datadir)/$(PACKAGE) 40pkgdatadir = $(datadir)/$(PACKAGE) 41pkglibdir = $(libdir)/$(PACKAGE) 42 43GCJ = @GCJ@ 44GCJFLAGS = @GCJFLAGS@ 45JAR = @JAR@ 46JAVACOMP = $(SHELL) javacomp.sh 47AR = ar 48RANLIB = @RANLIB@ 49 50EXTRA_DIST += $(hello_SOURCES) 51CLEANFILES = 52DISTCLEANFILES = javacomp.sh javaexec.sh 53 54 55if USEJEXE 56 57 58# Rules for compiling Java programs as native code. 59 60all-local: $(hello_MAINCLASS)$(EXEEXT) hello-resources.jar hello.sh 61 62# Does not work yet with GCC 3.3. 63#$(hello_MAINCLASS)$(EXEEXT): $(srcdir)/Hello.java 64# CLASSPATH=.@CLASSPATH_SEPARATOR@$(hello_JAVALIBS)@CLASSPATH_SEPARATOR@$$CLASSPATH $(GCJ) $(GCJFLAGS) $(srcdir)/Hello.java $(hello_JAVALIBS) --main=$(hello_MAINCLASS) -o $@ 65 66$(hello_MAINCLASS)$(EXEEXT): Hello.$(OBJEXT) libintl.a 67 $(GCJ) $(GCJFLAGS) Hello.$(OBJEXT) libintl.a --main=$(hello_MAINCLASS) -o $@ 68 69Hello.$(OBJEXT): $(srcdir)/Hello.java 70 CLASSPATH=.@CLASSPATH_SEPARATOR@$(hello_JAVALIBS)@CLASSPATH_SEPARATOR@$$CLASSPATH $(GCJ) $(GCJFLAGS) -c $(srcdir)/Hello.java -o $@ 71 72libintl.a: 73 rm -rf tmpdir 74 mkdir tmpdir 75 cd tmpdir && $(JAR) xf @LIBINTL_JAR@ && \ 76 for f in `find . -name '*.class' -print`; do \ 77 $(GCJ) $(GCJFLAGS) -c $$f -o `echo $$f | sed -e 's,^\./,,' -e 's,\.class$$,,' -e 's,/,.,g'`.$(OBJEXT) || exit 1; \ 78 done && \ 79 rm -f ../libintl.a && \ 80 ar cru ../libintl.a `find . -name '*.$(OBJEXT)' -print` 81 rm -rf tmpdir 82 $(RANLIB) $@ 83 84hello-resources.jar: 85 catalogs=`MAKEFLAGS= $(MAKE) -s -C po echo-catalogs`; \ 86 $(JAR) cf $@ $(hello_RESOURCES) $$catalogs 87 88hello.sh: 89 { echo '#!/bin/sh'; \ 90 echo "CLASSPATH='$(jardir)/hello-resources.jar'\$${CLASSPATH+\"@CLASSPATH_SEPARATOR@\$$CLASSPATH\"}"; \ 91 echo "export CLASSPATH"; \ 92 echo "exec '$(pkglibdir)/$(hello_MAINCLASS)$(EXEEXT)' \"\$$@\""; \ 93 } > $@ 94 95install-exec-local: all-local 96 $(mkdir_p) $(DESTDIR)$(bindir) 97 $(INSTALL_SCRIPT) hello.sh $(DESTDIR)$(bindir)/hello 98 $(mkdir_p) $(DESTDIR)$(pkglibdir) 99 $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $(hello_MAINCLASS)$(EXEEXT) $(DESTDIR)$(pkglibdir)/$(hello_MAINCLASS)$(EXEEXT) 100 101install-data-local: all-local 102 $(mkdir_p) $(DESTDIR)$(jardir) 103 $(INSTALL_DATA) hello-resources.jar $(DESTDIR)$(jardir)/hello-resources.jar 104 105installdirs-local: 106 $(mkdir_p) $(DESTDIR)$(bindir) 107 $(mkdir_p) $(DESTDIR)$(pkglibdir) 108 $(mkdir_p) $(DESTDIR)$(jardir) 109 110uninstall-local: 111 rm -f $(DESTDIR)$(bindir)/hello 112 rm -f $(DESTDIR)$(pkglibdir)/$(hello_MAINCLASS)$(EXEEXT) 113 rm -f $(DESTDIR)$(jardir)/hello-resources.jar 114 115CLEANFILES += $(hello_MAINCLASS)$(EXEEXT) *.$(OBJEXT) *.a tmpdir hello-resources.jar hello.sh 116 117 118else 119 120 121# Rules for compiling Java programs as jar libraries. 122# This is the preferred mode during development, because you can easily test 123# the program without installing it, simply by doing "java -jar hello.jar". 124 125all-local: hello.jar hello.sh 126 127hello.jar: $(hello_CLASSES) 128 { echo "Manifest-Version: 1.0"; echo "Main-Class: $(hello_MAINCLASS)"; echo 'Class-Path: @LIBINTL_JAR@'; } > Manifest.mf 129 catalogs=`MAKEFLAGS= $(MAKE) -s -C po echo-catalogs`; \ 130 $(JAR) cfm $@ Manifest.mf Hello*.class $(hello_RESOURCES) $$catalogs 131 rm -f Manifest.mf 132 133Hello.class: $(srcdir)/Hello.java 134 CLASSPATH=.@CLASSPATH_SEPARATOR@$(hello_JAVALIBS)@CLASSPATH_SEPARATOR@$$CLASSPATH $(JAVACOMP) -d . $(srcdir)/Hello.java 135 136hello.sh: 137 { echo '#!/bin/sh'; \ 138 echo "CLASSPATH='$(jardir)/hello.jar@CLASSPATH_SEPARATOR@$(hello_JAVALIBS)'\$${CLASSPATH+\"@CLASSPATH_SEPARATOR@\$$CLASSPATH\"}"; \ 139 echo "export CLASSPATH"; \ 140 echo "exec /bin/sh '$(pkgdatadir)/javaexec.sh' $(hello_MAINCLASS) \"\$$@\""; \ 141 } > $@ 142 143install-exec-local: all-local 144 $(mkdir_p) $(DESTDIR)$(bindir) 145 $(INSTALL_SCRIPT) hello.sh $(DESTDIR)$(bindir)/hello 146 147install-data-local: all-local 148 $(mkdir_p) $(DESTDIR)$(jardir) 149 $(INSTALL_DATA) hello.jar $(DESTDIR)$(jardir)/hello.jar 150 $(mkdir_p) $(DESTDIR)$(pkgdatadir) 151 $(INSTALL_DATA) javaexec.sh $(DESTDIR)$(pkgdatadir)/javaexec.sh 152 153installdirs-local: 154 $(mkdir_p) $(DESTDIR)$(jardir) 155 $(mkdir_p) $(DESTDIR)$(pkgdatadir) 156 157uninstall-local: 158 rm -f $(DESTDIR)$(bindir)/hello 159 rm -f $(DESTDIR)$(jardir)/hello.jar 160 rm -f $(DESTDIR)$(pkgdatadir)/javaexec.sh 161 162CLEANFILES += hello.jar Hello*.class Manifest.mf hello.sh 163 164 165endif 166