summaryrefslogtreecommitdiff
path: root/common.mk
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-09-23 20:00:05 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-09-26 16:26:29 -0400
commitd11311f66524dd61b4f186bbbc91d0e47b7e4f4d (patch)
tree71305c620216a15dda02439d64dac7418c1b1baf /common.mk
parent03119e29b4bb744478e6e01922da4d50cf4cbcbc (diff)
Makefile: create a standard 'pot' target
Diffstat (limited to 'common.mk')
-rw-r--r--common.mk10
1 files changed, 10 insertions, 0 deletions
diff --git a/common.mk b/common.mk
index 33beed6..ea89de1 100644
--- a/common.mk
+++ b/common.mk
@@ -55,6 +55,9 @@ install_files += $(addprefix $(DESTDIR)$(bindir)/,$(progs)) \
$(addprefix $(DESTDIR)$(mandir)/man8/,$(filter %.8,$(mans)))
clean_files += $(patsubst %.in,%,$(copy_files)) $(copy_files) $(mans) $(wildcard *.pot)
+pots += $(filter-out $(no-pots) ,$(progs))
+pot_files += $(addsuffix .pot,$(pots))
+
# Set the default target #######################################################
all: PHONY build
@@ -81,6 +84,13 @@ build: PHONY $(build_files)
@$(edit) <"$<" >"$@" || { rm -f -- '$@'; false; }
@chmod 755 "$@" || { rm -f -- '$@'; false; }
+# Build ########################################################################
+
+pot: everything.pot
+
+everything.pot: $(pot_files)
+ cat $^ | $(pofmt) > '$@'
+
%.pot: %
{ $(xgettext-sh-std); $(xgettext-sh-prose); } | $(pofmt) > '$@'