sane-project-backends/po/Makefile.in

127 wiersze
3.1 KiB
Makefile
Czysty Zwykły widok Historia

# po/Makefile.in
INSTALL_TRANSLATIONS = @INSTALL_TRANSLATIONS@
all: $(if $(INSTALL_TRANSLATIONS),update-mo)
# See po/README for documentation.
# Create one line per backend with all files containing translatable text:
epson.*.po: ../backend/epson.c ../backend/epson.h
mustek.*.po: ../backend/mustek.c
mustek_usb.*.po: ../backend/mustek_usb.c
pnm.*.po: ../backend/pnm.c
umax.*.po: ../backend/umax.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)
MKDIR = $(top_srcdir)/mkinstalldirs
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
MSGFMT = msgfmt
XGETTEXT = xgettext
MSGMERGE = msgmerge
OPTS = ../include/sane/saneopts.h
TMP_FILE_DIR = .tmp
ALL_POS = $(wildcard *.po)
ALL_BACKENDS = $(sort $(basename $(basename $(ALL_POS))))
ALL_POTS = $(addsuffix .pot,$(ALL_BACKENDS))
ALL_MOS = $(addsuffix .mo,$(basename $(ALL_POS)))
ALL_LINGUAS = $(sort $(subst .,,$(suffix $(basename $(ALL_POS)))))
INSTALL_TRANSLATIONS = @INSTALL_TRANSLATIONS@
DISTFILES = Makefile.in README epson.de.po mustek.de.po \
mustek_usb.de.po umax.de.po
.PHONY: all clean depend dist distclean install install-translations \
uninstall update-mo update-po generate-%
.SUFFIXES: .po .mo
# backend.lang.po -> backend.lang.mo
.po.mo:
@echo generating $@ from $<
@$(MSGFMT) -o $@ $<
# Sourcefiles -> backend.lang.po (updating po)
$(foreach lang,$(ALL_LINGUAS),%.$(lang).po): $(OPTS)
@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)
$(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) $${dir} && \
$(INSTALL_DATA) $${mo_file} $${dir}/sane-$${backend}.mo ;
install: $(if $(INSTALL_TRANSLATIONS),$(addprefix install-,$(ALL_MOS)))
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: $(if $(INSTALL_TRANSLATIONS),uninstall-translations)
clean:
rm -f *.mo
rm -f *.old
distclean: clean
rm -f Makefile
rm -f *.pot
rm -f *~
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