summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2013-10-23 16:10:11 (EDT)
committer P. J. McDermott <pjm@nac.net>2013-10-23 16:10:11 (EDT)
commitd4f229dbd423e5aad067bccd5bc119e1487949be (patch)
treef5c089c6bda99cedaae7e1a50a460dc5714d78f3
parent1c8f9d90e9d8ae64526ec450863f2484d8ff5bdc (diff)
Makefile.am: Add locale stuff.
-rw-r--r--Makefile.am26
-rw-r--r--locale/local.mk1
2 files changed, 24 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am
index c7428bb..ddffe4d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -18,20 +18,24 @@
include $(top_srcdir)/src/local.mk
include $(top_srcdir)/lib/local.mk
include $(top_srcdir)/lib/cmd/local.mk
+include $(top_srcdir)/locale/local.mk
bin_SCRIPTS = $(bin_sources:.sh=)
pkgdata_SCRIPTS = $(pkgdata_sources:.sh=.sm)
pkgdatacmd_SCRIPTS = $(pkgdatacmd_sources:.sh=.sm)
+locale_MESSAGES = $(locale_sources:.sh=.ms)
CLEANFILES = \
$(bin_SCRIPTS) \
$(pkgdata_SCRIPTS) \
- $(pkgdatacmd_SCRIPTS)
+ $(pkgdatacmd_SCRIPTS) \
+ $(locale_MESSAGES)
pkgdatacmddir = $(pkgdatadir)/cmd
EXTRA_DIST = \
autogen.sh \
$(bin_sources) \
$(pkgdata_sources) \
- $(pkgdatacmd_sources)
+ $(pkgdatacmd_sources) \
+ $(locale_sources)
SUFFIXES = .sh .sm
@@ -49,7 +53,19 @@ do_subst = sed \
-e "s|[@]textdomain[@]|$(textdomain)|g"
in-place:
- $(MAKE) $(AM_MAKEFLAGS) pkgdatadir=lib all-am
+ $(MAKE) $(AM_MAKEFLAGS) pkgdatadir=lib localedir=locale all-am
+
+all-local: $(locale_MESSAGES)
+
+install-data-local: $(locale_MESSAGES)
+ @$(NORMAL_INSTALL)
+ for f in $(locale_MESSAGES); do \
+ ff="$${f#*/}"; \
+ dir="$(DESTDIR)$(localedir)/$${f%.ms}/LC_MESSAGES"; \
+ $(MKDIR_P) "$${dir}" || exit 1; \
+ $(INSTALL_DATA) "$${f}" "$${dir}/$(textdomain).ms" || \
+ exit $$?; \
+ done
really-clean: distclean
rm -Rf $(srcdir)/aclocal.m4 $(srcdir)/autom4te.cache/ \
@@ -73,3 +89,7 @@ dist-hook:
.sh.sm:
$(MKDIR_P) "$$(dirname $@)"
$(do_subst) $< >$@
+
+.sh.ms:
+ $(MKDIR_P) "$$(dirname $@)"
+ cp $< $@
diff --git a/locale/local.mk b/locale/local.mk
new file mode 100644
index 0000000..feac140
--- /dev/null
+++ b/locale/local.mk
@@ -0,0 +1 @@
+locale_sources =