[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Refactor locale targets into separate Makefile

From: Greg Stein <gstein_at_lyra.org>
Date: 2004-06-22 07:19:30 CEST

On Mon, Jun 21, 2004 at 10:30:39PM +0200, Erik Huelsmann wrote:
>...
> +++ Makefile.in (working copy)
>...
> @@ -522,12 +503,10 @@
> .dvi.pdf:
> $(DVIPDF) $< $@
>
> -.po.spo:
> - sed '/^"Content-Type: text\/plain; charset=UTF-8\\n"$$/d' $< > $@
>
> -.spo.mo:
> - $(MSGFMT) -o $@ $<
> +include subversion/po/Makefile

That include mechanism is non-portable. Take a look at what configure
does, and the Makefile.in construction, for including build-outputs.mk. A
similar mechanism will be required *if* you want to include the targets.
It might be cleaner to use (ugh) recursive make.

>...
> +++ subversion/po/Makefile (revision 0)
> @@ -0,0 +1,35 @@
> +
> +abs_srcdir ?= ../..
> +MSGFMT ?= msgfmt
> +MSGMERGE ?= msgmerge
> +XGETTEXT ?= xgettext

I'm not familiar with the ?= construction. I suspect it is non-portable.

> +
> +locale-gnu-pot:
> + (cd $(abs_srcdir)/subversion/ ; \
> + find . \
> + -name .svn -prune -or \
> + -name tests -prune -or \
> + -name bindings -prune -or \
> + -name "*.c" -print -or \
> + -name "svn_error_codes.h" -print | \
> + $(XGETTEXT) --sort-by-file -k_ -kN_ -kSVN_ERRDEF:3 \
> + --msgid-bugs-address=dev@subversion.tigris.org \
> + --add-comments --files-from=- -o po/subversion.pot )
> +
> +locale-gnu-po-update: locale-gnu-pot
> + (cd $(abs_srcdir)/subversion/po ; \
> + for i in *.po ; do \
> + $(MSGMERGE) --sort-by-file --update $$i subversion.pot ; \
> + done )

For both of these rules, there is no need to use parentheses. A subshell
is not required, although you still want to retain the semicolons and
backslashes to ensure that they are run as a single command.

[ as a guess, I'd guess that somebody didn't realize that the 'cd' won't
  extend past the single Makefile command; each line in a target is run
  within its own shell process, so the cd won't carry very far ]

And that said, I still think that we shouldn't use 'find' in a rule to
look for inputs. Those should be determined by gen-make with specific
instructions from the build.conf file. It is way too easy to add a new
subdirectory or somesuch, and have it accidentally picked up by the find
command. The set of files could be dropped into a text file at the top
level, and the --files-from switch would point to that file. Heck,
build.conf might not need to change that much, as gen-make could just look
at all the of the .c files in its dependency graph.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jun 22 07:23:54 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.