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