This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: I18N: automatic determination of potfiles list
> If the tools are not available, autoconf replaces @POSUB@ with
> nothing, and the rules are not included in the main dependency graph.
Ah, ok.
> "po" in this context is a phony target. I suppose I could rename it
> something else, as long as it contains the "po" string so that I don't
> have to hack up the autoconf macros even more. I'm not aware of
> problems with having a directory name depend *on* something, at least
> as long as there aren't any associated commands. Can you illustrate a
> problem situation?
Well, the "po" directory has a timestamp. Make might think it's up to
date, and not run the rules. The flip side is that whenever you do
anything in that directory, the timestamp may be reset, which might
cause make to build more than it should. And it's confusing, because
"po" really does exist. IMHO it's better to just avoid all that and
use an obviously phony name. "build-po" comes to mind.
> > > +# Dummy rule to deal with dependency produced by use of
> > > +# "install-@POSUB@" above, when NLS is disabled.
> > > +install-:
> >
> > This should probably have an '@true' command. Maybe a .PHONY too.
>
> Is that really necessary? An empty command list is AFAIK entirely
> equivalent to @true as long as no pattern rules apply, and we've
> disabled all the pattern rules that could conceivably match.
I'm thinking of the "Make: Nothing to be done for `install-'."
message. The @true silences that. And we do it in other places too,
so there might be other reasons.
> > > +install-po:
> > > + $(mkinstalldirs) $(DESTDIR)$(datadir)
> > > + for cat in $(CATALOGS); do \
> > > + cat=`basename $$cat`; \
> > > + lang=`echo $$cat | sed 's/\.gmo$$//'`; \
> > > + dir=$(localedir)/$$lang/LC_MESSAGES; \
> > > + $(mkinstalldirs) $(DESTDIR)$$dir; \
> >
> > Check for this mkinstalldirs failing?
>
> I should add a set -e before the for loop.
A simple "|| exit 1" will do. I've seen odd cases where builtins
return unexpected exit codes.
> > > +# Create po/ as an empty directory; used by the .po/.gmo build rules for
> > > +# scratch space.
> > > +test -d po || mkdir po
> >
> > Shouldn't the Makefile do this?
>
> No, then I have to add dependencies *of* stuff on a directory, which
> definitely doesn't work right.
I meant a simple "test -d po || mkdir po" as the first command of the
rules that need it.