| 1 |
# part of this makefile are copyied from dpkg |
| 2 |
AUTOMAKE_OPTIONS = foreign |
| 3 |
|
| 4 |
man_MANS = sensible-editor.1 sensible-browser.1 sensible-pager.1 select-editor.1 sensible-terminal.1 |
| 5 |
EXTRA_DIST = sensible-editor.man sensible-browser.man sensible-pager.man select-editor.man sensible-terminal.man |
| 6 |
|
| 7 |
# Extract the list of languages from the po4a config file. |
| 8 |
LINGUAS_DIST = `sed -ne 's/^.*\[po4a_langs\] \(.*\)$$/\1/p' $(srcdir)/po4a/po4a.cfg` |
| 9 |
|
| 10 |
# If the user has not defined it let's use the default. |
| 11 |
LINGUAS ?= $(LINGUAS_DIST) |
| 12 |
|
| 13 |
|
| 14 |
update-po: |
| 15 |
$(PO4A_V) $(PO4A) $(PO4A_OPTS) --force $(srcdir)/po4a/po4a.cfg |
| 16 |
|
| 17 |
PO4A_V = $(PO4A_V_@AM_V@) |
| 18 |
PO4A_V_ = $(PO4A_V_@AM_DEFAULT_V@) |
| 19 |
PO4A_V_0 = @echo " PO4A $@"; |
| 20 |
|
| 21 |
PO4A_OPTS = --previous --srcdir $(srcdir) --destdir $(builddir) --no-backups \ |
| 22 |
--porefs noline --msgmerge-opt=--add-location=file \ |
| 23 |
--package-name $(PACKAGE_NAME) #--package-version $(PACKAGE_VERSION) #\ |
| 24 |
#--copyright-holder "$(PACKAGE_COPYRIGHT_HOLDER)"# \ |
| 25 |
#--msgid-bugs-address $(PACKAGE_BUGREPORT) |
| 26 |
|
| 27 |
all-local: gen-man |
| 28 |
|
| 29 |
clean-local: clean-local-yes |
| 30 |
|
| 31 |
clean-local-no: |
| 32 |
clean-local-yes: |
| 33 |
rm -rf $(LINGUAS_DIST) |
| 34 |
$(AM_V_at) rm -f man.stamp |
| 35 |
|
| 36 |
CLEANFILES = $(man_MANS) messages.mo man.stamp po4a/sensible-utils.pot |
| 37 |
|
| 38 |
# We use the man-once target to guarantee there is never an empty call in |
| 39 |
# gen-man, that starts recursing infinitely. |
| 40 |
.PHONY: gen-man man-once |
| 41 |
|
| 42 |
gen-man: man.stamp |
| 43 |
for lang in $(LINGUAS); do \ |
| 44 |
files=""; \ |
| 45 |
for man in $(man_MANS); do \ |
| 46 |
trans="$${man%%.[0-9]}.man"; \ |
| 47 |
if [ -f $(builddir)/$$lang/$$trans ]; then \ |
| 48 |
files="$$files $(builddir)/$$lang/$$man"; \ |
| 49 |
elif [ -f $(srcdir)/$$lang/$$trans ]; then \ |
| 50 |
files="$$files $(srcdir)/$$lang/$$man"; \ |
| 51 |
fi; \ |
| 52 |
done; \ |
| 53 |
$(MAKE) mandir="$(mandir)/$$lang" man_MANS="" man-once $$files; \ |
| 54 |
done |
| 55 |
|
| 56 |
# FIXME: Use a stamp file until po4a supports them internally. |
| 57 |
man.stamp: |
| 58 |
$(PO4A_V) $(PO4A) $(PO4A_OPTS) $(srcdir)/po4a/po4a.cfg |
| 59 |
$(AM_V_at) touch $@ |
| 60 |
|
| 61 |
SUFFIXES = .man |
| 62 |
|
| 63 |
MANGEN_V = $(MANGEN_V_@AM_V@) |
| 64 |
MANGEN_V_ = $(MANGEN_V_@AM_DEFAULT_V@) |
| 65 |
MANGEN_V_0 = @echo " MANGEN $@"; |
| 66 |
|
| 67 |
MANGEN = $(MANGEN_V) sed \ |
| 68 |
-f $(srcdir)/utf8toman.sed \ |
| 69 |
-e 's/%PACKAGE%/$(PACKAGE)/g' \ |
| 70 |
-e 's/%VERSION%/$(PACKAGE_VERSION)/g' \ |
| 71 |
-e 's/%RELEASE_DATE%/$(PACKAGE_RELEASE_DATE)/g' \ |
| 72 |
-e 's:%CONFDIR%:$(sysconfdir):g' \ |
| 73 |
-e 's:%LOGDIR%:$(logdir):g' \ |
| 74 |
-e 's:%ADMINDIR%:$(admindir):g' \ |
| 75 |
-e 's:%PKGDOCDIR%:$(docdir):g' \ |
| 76 |
-e 's:%PKGCONFDIR%:$(pkgconfdir):g' \ |
| 77 |
-e 's:%PKGLIBDIR%:$(pkglibexecdir):g' \ |
| 78 |
-e 's:%PKGDATADIR%:$(pkgdatadir):g' |
| 79 |
$(nil) |
| 80 |
|
| 81 |
.man.1: |
| 82 |
$(MANGEN) $< >$@ |
| 83 |
.man.5: |
| 84 |
$(MANGEN) $< >$@ |
| 85 |
.man.8: |
| 86 |
$(MANGEN) $< >$@ |
| 87 |
|
| 88 |
install-data-local: install-data-local-yes |
| 89 |
|
| 90 |
install-data-local-no: |
| 91 |
install-data-local-yes: |
| 92 |
for lang in $(LINGUAS); do \ |
| 93 |
files=""; \ |
| 94 |
for man in $(man_MANS); do \ |
| 95 |
trans="$${man%%.[0-9]}.man"; \ |
| 96 |
if [ -f $(builddir)/$$lang/$$trans ]; then \ |
| 97 |
files="$$files $(builddir)/$$lang/$$man"; \ |
| 98 |
elif [ -f $(srcdir)/$$lang/$$trans ]; then \ |
| 99 |
files="$$files $(srcdir)/$$lang/$$man"; \ |
| 100 |
fi; \ |
| 101 |
done; \ |
| 102 |
$(MAKE) install-man mandir="$(mandir)/$$lang" man_MANS="$$files"; \ |
| 103 |
done |
| 104 |
|
| 105 |
uninstall-local: uninstall-local-yes |
| 106 |
|
| 107 |
uninstall-local-no: |
| 108 |
uninstall-local-yes: |
| 109 |
for lang in $(LINGUAS); do \ |
| 110 |
files=""; \ |
| 111 |
for man in $(man_MANS); do \ |
| 112 |
trans="$${man%%.[0-9]}.man"; \ |
| 113 |
if [ -f $(builddir)/$$lang/$$trans ]; then \ |
| 114 |
files="$$files $(builddir)/$$lang/$$man"; \ |
| 115 |
elif [ -f $(srcdir)/$$lang/$$trans ]; then \ |
| 116 |
files="$$files $(srcdir)/$$lang/$$man"; \ |
| 117 |
fi; \ |
| 118 |
done; \ |
| 119 |
$(MAKE) uninstall-man mandir="$(mandir)/$$lang" man_MANS="$$files"; \ |
| 120 |
done |
| 121 |
|
| 122 |
#dist-hook: man.stamp |
| 123 |
# cp $(srcdir)/man.stamp $(distdir)/ |
| 124 |
# for lang in $(LINGUAS_DIST); do \ |
| 125 |
# cp $(srcdir)/po/$$lang.po $(distdir)/po; \ |
| 126 |
# cp $(srcdir)/po/$$lang.add $(distdir)/po; \ |
| 127 |
# $(MKDIR_P) $(distdir)/$$lang; \ |
| 128 |
# cp -R $(srcdir)/$$lang $(distdir)/; \ |
| 129 |
# done |