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_CSHARPPROGRAMS = hello
15
16# The source files of the 'hello' program.
17hello_SOURCES = hello.cs
18
19# The link dependencies of the 'hello' program.
20hello_CSHARPLIBS = @GNU_GETTEXT_LDADD@ @GNU_GETTEXT_LIBS@ -l System
21
22# Resources that are generated from PO files.
23MAINTAINERCLEANFILES = */*.resources.dll
24
25# Additional files to be distributed.
26EXTRA_DIST = autogen.sh autoclean.sh
27
28
29# ----------------- General rules for compiling C# programs -----------------
30
31pkgdatadir = $(datadir)/$(PACKAGE)
32pkglibdir = $(libdir)/$(PACKAGE)
33
34CSHARPCOMP = $(SHELL) csharpcomp.sh
35CSHARPCOMPFLAGS = -O -g
36
37EXTRA_DIST += $(hello_SOURCES)
38CLEANFILES = hello.net.exe.mdb
39DISTCLEANFILES = csharpcomp.sh csharpexec.sh
40
41
42# Rules for compiling C# programs.
43
44all-local: hello.net.exe hello.sh
45
46hello.net.exe: $(hello_SOURCES)
47	$(CSHARPCOMP) $(CSHARPCOMPFLAGS) -o $@ $(hello_CSHARPLIBS) $(srcdir)/hello.cs
48
49hello.sh:
50	{ echo '#!/bin/sh'; \
51	  echo "exec /bin/sh '$(pkgdatadir)/csharpexec.sh' @GNU_GETTEXT_LDADD@ '$(pkglibdir)/hello.net.exe' \"\$$@\""; \
52	} > $@
53
54install-exec-local: all-local
55	$(MKDIR_P) $(DESTDIR)$(bindir)
56	$(INSTALL_SCRIPT) hello.sh $(DESTDIR)$(bindir)/hello
57	$(MKDIR_P) $(DESTDIR)$(pkglibdir)
58	$(INSTALL_DATA) hello.net.exe $(DESTDIR)$(pkglibdir)/hello.net.exe
59
60install-data-local: all-local
61	$(MKDIR_P) $(DESTDIR)$(pkgdatadir)
62	$(INSTALL_DATA) csharpexec.sh $(DESTDIR)$(pkgdatadir)/csharpexec.sh
63
64installdirs-local:
65	$(MKDIR_P) $(DESTDIR)$(bindir)
66	$(MKDIR_P) $(DESTDIR)$(pkglibdir)
67	$(MKDIR_P) $(DESTDIR)$(pkgdatadir)
68
69uninstall-local:
70	rm -f $(DESTDIR)$(bindir)/hello
71	rm -f $(DESTDIR)$(pkglibdir)/hello.net.exe
72	rm -f $(DESTDIR)$(pkgdatadir)/csharpexec.sh
73
74CLEANFILES += hello.net.exe hello.sh
75