1
0
mirror of https://github.com/rkd77/elinks.git synced 2025-02-02 15:09:23 -05:00

Use $@ to simplify a rule and try to nullify metacharacters

I changed the %.gmo rule in po/Makefile to use $@ instead of a shell
variable, and made various tweaks in it to better support strange file
names, e.g. spaces in $(srcdir).  I suppose other makefiles in ELinks and
other rules in po/Makefile do not support those, but one must start
somewhere.  I don't think it will ever be feasible to support backslashes
and quotes without horrible contortions, but spaces and dashes should be
doable.

I also quoted the ~ in --check-accelerators=~ in case some shell might want
to expand it as the home directory. Bash 3.00.16(1) doesn't because the
word contains dashes.
This commit is contained in:
Kalle Olavi Niemitalo 2005-12-10 17:07:21 +01:00 committed by Jonas Fonseca
parent f25f944123
commit ce852b9d5f

View File

@ -17,9 +17,8 @@ POTFILES_ABS_LIST = potfiles.list
# However, if srcdir != builddir, then this Makefile ignores the *.gmo
# files in the srcdir and builds new ones in the builddir.
%.gmo: $(srcdir)/%.po
@file=`echo $* | sed 's,.*/,,'`.gmo \
&& rm -f $$file && echo -n $*": " \
&& $(GMSGFMT) --statistics -o $$file $<
@rm -f -- "$@" && printf "%s: " "$*" \
&& $(GMSGFMT) --statistics -o "$@" -- "$<"
### The default rule
@ -88,7 +87,7 @@ update-gmo: Makefile $(GMOFILES)
check-po:
@$(foreach lang,$(basename $(if $(strip $(PO)),$(PO),$(GMOFILES))), \
echo -n "$(lang): "; \
$(GMSGFMT) --check --check-accelerators=~ --verbose --statistics -o /dev/null $(srcdir)/$(lang).po; \
$(GMSGFMT) --check --check-accelerators="~" --verbose --statistics -o /dev/null $(srcdir)/$(lang).po; \
)
### Installation and distribution