Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
intl: rebuild pot files only on request 'make intl'
  • Loading branch information
perexg committed Jun 18, 2015
1 parent 10460ef commit 06aec5e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
14 changes: 10 additions & 4 deletions Makefile
Expand Up @@ -511,7 +511,7 @@ reconfigure:
$(ROOTDIR)/configure $(CONFIGURE_ARGS)

# Binary
${PROG}: check_config make_webui $(PO-FILES) $(MO-FILES) $(OBJS)
${PROG}: check_config make_webui $(MO-FILES) $(OBJS)
$(CC) -o $@ $(OBJS) $(CFLAGS) $(LDFLAGS)

# Object
Expand Down Expand Up @@ -566,9 +566,14 @@ $(BUILDDIR)/build.o: $(BUILDDIR)/build.c
$(CC) -c -o $@ $<

# Internationalization
intl/tvheadend.pot: $(I18N-C)
@$(XGETTEXT) -o $@.new $(I18N-C)
@mv $@.new $@
.PHONY: intl
intl:
@printf "Building tvheadend.pot\n"
@$(XGETTEXT) -o intl/tvheadend.pot.new $(I18N-C)
@mv intl/tvheadend.pot.new intl/tvheadend.pot
$(MAKE) -f Makefile.webui LANGUAGES="$(LANGUAGES)" WEBUI=std intl

intl/tvheadend.pot:

intl/tvheadend.de.po: intl/tvheadend.pot
$(call merge-po,$@,$<)
Expand All @@ -583,6 +588,7 @@ intl/tvheadend.pl.po: intl/tvheadend.pot
$(call merge-po,$@,$<)

${BUILDDIR}/%.mo: %.po
@printf "Building $@\n"
@mkdir -p $(dir $@)/$(subst .,,$(suffix $(basename $@)))/LC_MESSAGES
@$(MSGFMT) -o $@ $<
@ln -sf ../../tvheadend.$(subst .,,$(suffix $(basename $@))).mo \
Expand Down
11 changes: 8 additions & 3 deletions Makefile.webui
Expand Up @@ -191,6 +191,7 @@ define merge-po
endef

define go-po
@printf "Building $(1)\n"
@mkdir -p $(dir $(1))
$(VV)$(POJS_PY) --in="$(2)" > $(1).new
@echo "tvh_locale_lang = '$(subst .,,$(suffix $(basename $(2))))';" >> $(1).new
Expand Down Expand Up @@ -244,9 +245,13 @@ compile-debug: $(WEBDIR)/extjs-debug.c $(WEBDIR)/extjs-tv-debug.c
@echo "WEBUI debug finished"

# Internationalization
intl/js/tvheadend.js.pot: $(JAVASCRIPT_SRC)
@$(XGETTEXT) -o $@.new $(JAVASCRIPT_SRC)
@mv $@.new $@
.PHONY: intl
intl:
@printf "Building intl/js/tvheadend.js.pot\n"
@$(XGETTEXT) -o intl/js/tvheadend.js.pot.new $(JAVASCRIPT_SRC)
@mv intl/js/tvheadend.js.pot.new intl/js/tvheadend.js.pot

intl/js/tvheadend.js.pot:

intl/js/tvheadend.js.de.po: intl/js/tvheadend.js.pot
$(call merge-po,$@,$<)
Expand Down

0 comments on commit 06aec5e

Please sign in to comment.