Skip to contentSkip to conversation

PO makefile rules touching source

Qemu-devel Dr. David Alan Gilbert 4 participants 5 messages Aug 6, 2015 – Aug 7, 2015

lore
Share & tools
lore
#0 lore raw

Hi Stefan,
I don't really understand the way PO stuff is supposed to work,
but I often get the problem that my git tree gets changed during an out of tree build, causing the po subdirectory to be dirtied.

I think this is due to the rule:

$(PO_PATH)/%.po: $(PO_PATH)/messages.po

        $(call quiet-command, msgmerge -q $@ $< > [email protected] && mv [email protected] $@, "  GEN   $@")

in po/Makefile.

Why does that merge into $(PO_PATH)/%.po rather than %.po - i.e. why to the source rather than to the build directory?

Dave

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

#1 lore raw

Am 06.08.2015 um 13:54 schrieb Dr. David Alan Gilbert:

Quoted 13 lines

Hi Stefan,
I don't really understand the way PO stuff is supposed to work,
but I often get the problem that my git tree gets changed during an out of tree build, causing the po subdirectory to be dirtied.

I think this is due to the rule:

$(PO_PATH)/%.po: $(PO_PATH)/messages.po

         $(call quiet-command, msgmerge -q $@ $< > [email protected] && mv [email protected] $@, "  GEN   $@")

in po/Makefile.

Quoted 7 lines

Why does that merge into $(PO_PATH)/%.po rather than %.po - i.e. why to the source rather than to the build directory?

Dave

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

Hi Dave,

the *.po files are initially generated, then manually enhanced by the translated texts.

Each time when there are modifications to the related source file (for QEMU: ui/gtk.c), the *.po files need updates, too (new or removed texts, but most often changes of line numbers).

That's why I have sent a patch to update the *.po files for QEMU 2.4.0. With this patch (which is still not applied), you would not get changes when doing a complete build because *.po files and ui/gtk.c would match.

As long as there is the mismatch, you'll get modified *.po files when running
"make install". I usually handle this case by running "git diff po|patch -p1 -R" which removes the *.po modifications.

Stefan

#2 lore raw
Quoted 3 lines · Stefan Weil

That's why I have sent a patch to update the
*.po files for QEMU 2.4.0. With this patch
(which is still not applied)

Sorry, I didn't notice that patch when I was collecting up last minute fixes, and it's now missed the 2.4 release.

-- PMM

#3 lore raw
In reply to Stefan Weil
Quoted 38 lines · * Stefan Weil ([email protected]) wrote:

Am 06.08.2015 um 13:54 schrieb Dr. David Alan Gilbert:

Quoted 13 lines

Hi Stefan,
I don't really understand the way PO stuff is supposed to work,
but I often get the problem that my git tree gets changed during an out of tree build, causing the po subdirectory to be dirtied.

I think this is due to the rule:

$(PO_PATH)/%.po: $(PO_PATH)/messages.po

        $(call quiet-command, msgmerge -q $@ $< > [email protected] && mv [email protected] $@, "  GEN   $@")

in po/Makefile.

Quoted 7 lines

Why does that merge into $(PO_PATH)/%.po rather than %.po - i.e. why to the source rather than to the build directory?

Dave

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

Hi Dave,

the *.po files are initially generated, then manually enhanced by the translated texts.

Each time when there are modifications to the related source file (for QEMU: ui/gtk.c), the *.po files need updates, too (new or removed texts, but most often changes of line numbers).

That's why I have sent a patch to update the *.po files for QEMU 2.4.0. With this patch (which is still not applied), you would not get changes when doing a complete build because *.po files and ui/gtk.c would match.

Quoted 5 lines

As long as there is the mismatch, you'll get modified *.po files when running
"make install". I usually handle this case by running "git diff po|patch -p1 -R" which removes the *.po modifications.

But why are these files in the source tree *ever* updated by a make install; if you're saying the .po files need updating, that's fine, but have the makefile do the update into the build directory, not the source directory. You might want a convenience make target for updating the source directory po files to make your life easier, but I don't understand why that triggers during a normal make install.

Dave

Quoted 4 lines

Stefan

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

#4 lore raw
Quoted 45 lines · Dr. David Alan Gilbert
Quoted 38 lines · * Stefan Weil ([email protected]) wrote:

Am 06.08.2015 um 13:54 schrieb Dr. David Alan Gilbert:

Quoted 13 lines

Hi Stefan,
I don't really understand the way PO stuff is supposed to work,
but I often get the problem that my git tree gets changed during an out of tree build, causing the po subdirectory to be dirtied.

I think this is due to the rule:

$(PO_PATH)/%.po: $(PO_PATH)/messages.po

        $(call quiet-command, msgmerge -q $@ $< > [email protected] && mv [email protected] $@, "  GEN   $@")

in po/Makefile.

Quoted 7 lines

Why does that merge into $(PO_PATH)/%.po rather than %.po - i.e. why to the source rather than to the build directory?

Dave

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

Hi Dave,

the *.po files are initially generated, then manually enhanced by the translated texts.

Each time when there are modifications to the related source file (for QEMU: ui/gtk.c), the *.po files need updates, too (new or removed texts, but most often changes of line numbers).

That's why I have sent a patch to update the *.po files for QEMU 2.4.0. With this patch (which is still not applied), you would not get changes when doing a complete build because *.po files and ui/gtk.c would match.

Quoted 5 lines

As long as there is the mismatch, you'll get modified *.po files when running
"make install". I usually handle this case by running "git diff po|patch -p1 -R" which removes the *.po modifications.

Quoted 6 lines

But why are these files in the source tree *ever* updated by a make install; if you're saying the .po files need updating, that's fine, but have the makefile do the update into the build directory, not the source directory. You might want a convenience make target for updating the source directory po files to make your life easier, but I don't understand why that triggers during a normal make install.

I agree. IMO Makefile should generally write anything to the build dir and only read the SRC_PATH.

Fam