Makefile: new target 'pot-files'

Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>
This commit is contained in:
Davide Madrisan 2012-11-19 22:45:31 +01:00
parent cd9d62f95b
commit f525086f8b
4 changed files with 70 additions and 4 deletions

View File

@ -59,7 +59,7 @@ pck_infiles := $(wildcard *.in conf/*.in lib/*.in man/*.in man/*/*.in plugins/*.
s,@date@,`LC_ALL="C" date "+%a %b %d %Y"`,g;\
s,@date_my@,`LC_ALL="C" date "+%B %Y"`," $< > $@
all: dist-update locales check
all: dist-update locales check pot-files
check: dist-update
@echo "Checking libraries and scripts for syntax errors..."
@ -71,6 +71,22 @@ check: dist-update
dist-update: $(pck_infiles:.in=)
pot-files: dist-update
@echo "Creating pot files..."
@echo "Generating po template '$(PACKAGE).pot'..."; \
/usr/bin/xgettext -i -L shell \
--copyright-holder="Davide Madrisan" \
--msgid-bugs-address="davide.madrisan@gmail.com" \
--no-location \
--package-name=$(PACKAGE) \
--package-version=${VERSION} \
$(PACKAGE) -o $(srcdir)/po/$(PACKAGE).pot 2>/dev/null
@$(MAKE) pot-files -C lib || exit 1
@$(MAKE) pot-files -C plugins || exit 1
@$(MAKE) pot-files -C tests || exit 1
# /usr/bin/msgmerge -i --update po/it/$(PACKAGE).po po/$(PACKAGE).pot
locales:
@for loc in $(LOCALES); do\
$(MAKE) -C po/$$loc || exit 1;\
@ -208,4 +224,5 @@ mostlyclean:
$(MAKE) clean -C man/$$loc || exit 1;\
$(MAKE) clean -C po/$$loc || exit 1;\
done
@rm -f po/$(PACKAGE).pot

View File

@ -19,8 +19,9 @@ srcdir = ..
include $(srcdir)/Makefile.env
pck_libs := libapse.lib libcfg.lib libmsgmng.lib libnetwork.lib libspec.lib \
libtest.lib README.API
libtest.lib
pck_libs_infiles := $(wildcard *.in)
pck_libs_all := $(pck_libs) README.API
all:
@ -31,16 +32,32 @@ check: $(pck_libs)
&& echo "[PASSED]" || { echo "[FAILED]"; exit 1; };\
done
install: $(pck_libs)
pot-files: $(pck_libs)
@for f in $(pck_libs); do\
echo -n "Generating po template '$$f.pot'...";\
/usr/bin/xgettext -i -L shell \
--copyright-holder="Davide Madrisan" \
--msgid-bugs-address="davide.madrisan@gmail.com" \
--no-location \
--package-name=$(PACKAGE) \
--package-version=${VERSION} \
$$f -o $(srcdir)/po/$$f.pot 2>/dev/null \
&& echo "[DONE]" || { echo "[ERROR]"; exit 1; };\
done
install: $(pck_libs_all)
@$(INSTALL_DIR) $(DESTDIR)$(libdir)
for f in $(pck_libs); do\
$(INSTALL_DATA) $${f} $(DESTDIR)$(libdir)/$${f};\
done
uninstall:
for f in $(pck_libs); do\
for f in $(pck_libs_all); do\
rm -f $(DESTDIR)$(libdir)/$${f};\
done
clean:
rm -f $(patsubst %.in,%,$(pck_libs_infiles))
@for f in $(pck_libs_all); do\
rm -f $(srcdir)/po/$$f.pot;\
done

View File

@ -30,6 +30,19 @@ check: $(pck_plugins)
&& echo "[PASSED]" || { echo "[FAILED]"; exit 1; };\
done
pot-files: $(pck_plugins)
@for f in $(pck_plugins); do\
echo -n "Generating po template '$$f.pot'...";\
/usr/bin/xgettext -i -L shell \
--copyright-holder="Davide Madrisan" \
--msgid-bugs-address="davide.madrisan@gmail.com" \
--no-location \
--package-name=$(PACKAGE) \
--package-version=${VERSION} \
$$f -o $(srcdir)/po/$$f.pot 2>/dev/null \
&& echo "[DONE]" || { echo "[ERROR]"; exit 1; };\
done
install: $(pck_plugins)
@$(INSTALL_DIR) $(DESTDIR)$(plugindir)
for f in $(pck_plugins); do\
@ -43,3 +56,6 @@ uninstall:
clean:
rm -f $(patsubst %.in,%,$(pck_plugins_infiles))
@for f in $(pck_plugins); do\
rm -f $(srcdir)/po/$$f.pot;\
done

View File

@ -30,6 +30,19 @@ check: $(pck_tests)
&& echo "[PASSED]" || { echo "[FAILED]"; exit 1; };\
done
pot-files: $(pck_tests)
@for f in $(pck_tests); do\
echo -n "Generating po template '$$f.pot'...";\
/usr/bin/xgettext -i -L shell \
--copyright-holder="Davide Madrisan" \
--msgid-bugs-address="davide.madrisan@gmail.com" \
--no-location \
--package-name=$(PACKAGE) \
--package-version=${VERSION} \
$$f -o $(srcdir)/po/$$f.pot 2>/dev/null \
&& echo "[DONE]" || { echo "[ERROR]"; exit 1; };\
done
install: $(pck_tests)
@$(INSTALL_DIR) $(DESTDIR)$(testdir)
for f in $(pck_tests); do\
@ -43,3 +56,6 @@ uninstall:
clean:
rm -f $(patsubst %.in,%,$(pck_tests_infiles))
@for f in $(pck_tests); do\
rm -f $(srcdir)/po/$$f.pot;\
done