sane-project-backends/po/Makefile.in

158 wiersze
4.3 KiB
Makefile

# po/Makefile.in
# See po/README for documentation.
SHELL = /bin/sh
all: check-mo
# Create one line per backend with all files containing translatable text:
artec_eplus48u.*.po: ../backend/artec_eplus48u.c
epson.*.po: ../backend/epson.c ../backend/epson.h
gt68xx.*.po: ../backend/gt68xx.c
matsushita.*.po: ../backend/matsushita.c ../backend/matsushita.h
mustek.*.po: ../backend/mustek.c
mustek_usb.*.po: ../backend/mustek_usb.c
plustek.*.po: ../backend/plustek.c ../backend/plustek.h
pnm.*.po: ../backend/pnm.c
teco1.*.po: ../backend/teco1.c ../backend/teco1.h
umax.*.po: ../backend/umax.c
umax_pp.*.po: ../backend/umax_pp.c
sceptre.*.po: ../backend/sceptre.c ../backend/sceptre.h
snapscan.*.po: ../backend/snapscan.c
# end of configuration
prefix = @prefix@
exec_prefix = @exec_prefix@
datadir = @datadir@
localedir = $(datadir)/locale
gnulocaledir = $(prefix)/share/locale
top_srcdir = @top_srcdir@
srcdir = @srcdir@
PACKAGE = @PACKAGE@
VERSION = @VERSION@
distdir = $(top_srcdir)/$(PACKAGE)-$(VERSION)
INSTALL_TRANSLATIONS = @INSTALL_TRANSLATIONS@
ifeq ($(INSTALL_TRANSLATIONS),install-translations)
UNINSTALL_TRANSLATIONS = uninstall-translations
UPDATE_MO = update-mo
endif
MKDIR = $(top_srcdir)/mkinstalldirs
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
MSGFMT = @MSGFMT@
XGETTEXT = @XGETTEXT@
MSGMERGE = @MSGMERGE@
MSGCAT = @MSGCAT@
TMP_FILE_DIR = .tmp
ALL_POS = $(wildcard *.po)
ALL_BACKENDS = $(sort $(basename $(basename $(ALL_POS))))
ALL_POTS = $(addsuffix .pot,$(ALL_BACKENDS))
ALL_MOS = $(filter-out saneopts.%.mo,$(addsuffix .mo,$(basename $(ALL_POS))))
ALL_LINGUAS = $(sort $(subst .,,$(suffix $(basename $(ALL_POS)))))
DISTCLEAN_FILES = @DISTCLEAN_FILES@
DISTFILES = Makefile.in README epson.de.po epson.ru.po gt68xx.de.po \
mustek.de.po mustek.ru.po mustek_usb.de.po mustek_usb.ru.po \
matsushita.fr.po matsushita.ru.po \
plustek.de.po plustek.ru.po plustek.es.po \
pnm.de.po pnm.ru.po \
saneopts.de.po saneopts.ru.po saneopts.fr.po saneopts.es.po \
sceptre.fr.po sceptre.ru.po teco1.fr.po teco1.ru.po \
umax.de.po umax.fr.po umax.ru.po umax_pp.fr.po umax_pp.ru.po umax_pp.de.po \
snapscan.de.po snapscan.ru.po artec_eplus48u.de.po
.PHONY: all clean depend dist distclean install install-translations \
uninstall update-mo update-po generate-%
.SUFFIXES: .po .mo
saneopts.*.po: ../include/sane/saneopts.h
# backend.lang.po -> backend.lang.mo; include saneopts.??.po
%.mo:
@lang=$(subst .,,$(suffix $(basename $(subst install-,,$@)))) ; \
echo generating $@ from $*.po and saneopts.$${lang}.po ; \
if test $(MSGCAT) = no ; then \
$(MSGFMT) -o $@ $*.po saneopts.$${lang}.po ; \
else \
$(MSGCAT) --use-first $*.po saneopts.$${lang}.po \
| $(MSGFMT) -o $@ - ; \
fi
# Sourcefiles -> backend.lang.po (updating po)
$(foreach lang,$(ALL_LINGUAS),%.$(lang).po):
@echo -n "updating $@ from $^ "
@rm -rf $(TMP_FILE_DIR)
@mkdir $(TMP_FILE_DIR) && \
for file in $^ ; do \
sed < $${file} -e 's/#define//g' \
> $(TMP_FILE_DIR)/`basename $${file}` ; \
done
@$(XGETTEXT) -d$* -kSANE_I18N $(TMP_FILE_DIR)/*.*
@mv $*.po $*.pot
@cp $@ $@.old
@$(MSGMERGE) $@.old $*.pot -o $@
@rm -f $@.old
# Generate new po file
%-gen:
@if test ! -e $* ; then \
touch $* -d "1980-01-01" ; \
echo created new file: $* ; \
$(MAKE) $* ; \
fi
update-po: $(ALL_POS)
update-mo: $(ALL_MOS)
check-mo: $(UPDATE_MO)
$(addprefix install-,$(ALL_MOS)):
@mo_file=$(subst install-,,$@) ; \
backend=$(basename $(basename $(subst install-,,$@))) ; \
lang=$(subst .,,$(suffix $(basename $(subst install-,,$@)))) ; \
dir=$(gnulocaledir)/$${lang}/LC_MESSAGES ; \
echo installing $${mo_file} to $${dir}/sane-$${backend}.mo... ; \
$(MKDIR) $(DESTDIR)$${dir} && \
$(INSTALL_DATA) $${mo_file} $(DESTDIR)$${dir}/sane-$${backend}.mo ;
install-translations: $(addprefix install-,$(ALL_MOS))
install: $(INSTALL_TRANSLATIONS)
uninstall-translations:
@for lang in $(ALL_LINGUAS) ; do \
dir=$(gnulocaledir)/$${lang}/LC_MESSAGES ; \
echo removing $${dir}/sane-*.mo ; \
rm -f $${dir}/sane-*.mo ; \
done
uninstall: $(UNINSTALL_TRANSLATIONS)
clean:
rm -f *.mo
rm -f *.old
distclean: clean
rm -f $(DISTCLEAN_FILES)
rm -f Makefile
rm -f *.pot
rm -rf $(TMP_FILE_DIR)
depend:
dist: $(DISTFILES)
for file in $(DISTFILES); do \
ln $$file $(distdir)/po 2> /dev/null \
|| cp -p $$file $(distdir)/po ; \
done