diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-09-23 20:00:05 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-09-26 16:26:29 -0400 |
commit | d11311f66524dd61b4f186bbbc91d0e47b7e4f4d (patch) | |
tree | 71305c620216a15dda02439d64dac7418c1b1baf | |
parent | 03119e29b4bb744478e6e01922da4d50cf4cbcbc (diff) |
Makefile: create a standard 'pot' target
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | common.mk | 10 | ||||
-rw-r--r-- | src/chroot-tools/Makefile | 2 | ||||
-rw-r--r-- | src/lib/Makefile | 4 |
4 files changed, 18 insertions, 4 deletions
@@ -26,23 +26,25 @@ copy: PHONY $(addprefix copy-, $(packages)) build: PHONY $(addprefix build-, $(packages)) install: PHONY $(addprefix install-,$(packages)) clean: PHONY $(addprefix clean-, $(packages)) +pot: PHONY $(addprefix pot-, $(filter-out doc,$(packages))) check: @cd test && ./testenv $(TESTENVFLAGS) roundup -%/copy: PHONY % - $(MAKE) -C $* copy %/build: PHONY % $(MAKE) -C $* %/install: PHONY % $(MAKE) -C $* install %/clean: PHONY % $(MAKE) -C $* clean +%/pot: PHONY % + $(MAKE) -C $* pot .SECONDEXPANSION: $(addprefix copy-, $(packages)): copy-%: PHONY $$(addsuffix /copy, $$($$*)) $(addprefix build-, $(packages)): build-%: PHONY $$(addsuffix /build, $$($$*)) $(addprefix install-,$(packages)): install-%: PHONY $$(addsuffix /install,$$($$*)) $(addprefix clean-, $(packages)): clean-%: PHONY $$(addsuffix /clean, $$($$*)) +$(addprefix pot-, $(packages)): pot-%: PHONY $$(addsuffix /pot, $$($$*)) ################################################################################ @@ -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) > '$@' diff --git a/src/chroot-tools/Makefile b/src/chroot-tools/Makefile index db1cdf5..b42d28d 100644 --- a/src/chroot-tools/Makefile +++ b/src/chroot-tools/Makefile @@ -6,6 +6,8 @@ no-progs = $(libexecs) # These are the shell libraries we will use libs = makechrootpkg.sh $(wildcard hooks-*.sh) +pots = $(libexecs) $(libs) + pkglibexecdir = $(libexecdir)/libretools/chroot clean_files = makechrootpkg.sh.ugly* *~ include ../../common.mk diff --git a/src/lib/Makefile b/src/lib/Makefile index fd6d31d..4f24ad3 100644 --- a/src/lib/Makefile +++ b/src/lib/Makefile @@ -3,6 +3,8 @@ libexecs = $(filter-out librelib,$(wildcard libre*)) # include common.sh in libs explicitly, because it might not exist yet # when the wildcard is performed libs = $(sort $(wildcard *.sh) common.sh) + +pots = $(libs) include ../../common.mk # Build ############################################################## @@ -19,8 +21,6 @@ common.sh: %: %.in %.top Makefile # Translate ########################################################## -pot: libreblacklist.pot common.sh.pot librelib.pot - libreblacklist.pot: libreblacklist { \ sed -n '/^# Usage:/,/()/{ /^#/ { =; p; } }' $< | \ |