Skip to contentSkip to conversation

Fix "make clean" for s390 target

PATCH Applied Eric Farman 4 participants 13 messages Aug 14, 2017 – Aug 15, 2017

lore
Share & tools
lore
#0 lore raw

cover Fix "make clean" for s390 target

How often does one really do a "make clean" ? Rather infrequently, as I only stumbled on this today.

Perhaps I have missed the RM variable somewhere, as I see similar syntax in some of the tests/tcg/ Makefiles, but I don't see it being set here. My configure statement isn't terribly interesting, just enabling debug for an s390x target, and as such there's no RM variable in its output. I'll trust that Thomas will chime in with where it should have been. In the meantime, this does the trick for me.

I didn't rebuild the image file after this change, because it didn't seem necessary. Let me know if that was a bad assumption, and I can submit one.

Eric Farman (1):
pc-bios/s390-ccw: Use rm command during make clean

 pc-bios/s390-ccw/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.11.2
#1 lore raw

PATCH 1/1 pc-bios/s390-ccw: Use rm command during make clean

This reverts what I think was an accidental change that replaced the "rm -f" command with an undefined variable RM, and causes the "make clean" command to fail for a s390 target:

make[1]: Entering directory '/usr/src/qemu/build/pc-bios/s390-ccw' rm -f *.timestamp
*.o *.d *.img *.elf *~ *.a
/bin/sh: *.o: command not found
Makefile:39: recipe for target 'clean' failed
make[1]: *** [clean] Error 127
make[1]: Leaving directory '/usr/src/qemu/build/pc-bios/s390-ccw' Makefile:489: recipe for target 'clean' failed
make: *** [clean] Error 1

Fixes 3e4415a751d2 ("pc-bios/s390-ccw: Add core files for the network

bootloading program")

---
 pc-bios/s390-ccw/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
pc-bios/s390-ccw/Makefile +1 -1
index cbae74522a..6d0c2ee691 100644
@@ -36,4 +36,4 @@ s390-netboot.img:
 endif
 
 clean:
-	$(RM) *.o *.d *.img *.elf *~ *.a
+	rm -f *.o *.d *.img *.elf *~ *.a
Signature · 1 line
2.11.2
#2 lore raw

Re: [Qemu-devel] [PATCH 1/1] pc-bios/s390-ccw: Use rm command during make clean

Quoted 26 lines · On Mon, 14 Aug 2017 22:44:50 +0200 Eric Farman <[email protected]>…

This reverts what I think was an accidental change that replaced the "rm -f" command with an undefined variable RM, and causes the "make clean" command to fail for a s390 target:

make[1]: Entering directory '/usr/src/qemu/build/pc-bios/s390-ccw' rm -f *.timestamp
*.o *.d *.img *.elf *~ *.a
/bin/sh: *.o: command not found
Makefile:39: recipe for target 'clean' failed
make[1]: *** [clean] Error 127
make[1]: Leaving directory '/usr/src/qemu/build/pc-bios/s390-ccw' Makefile:489: recipe for target 'clean' failed
make: *** [clean] Error 1

Fixes 3e4415a751d2 ("pc-bios/s390-ccw: Add core files for the network

bootloading program")

---
 pc-bios/s390-ccw/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
pc-bios/s390-ccw/Makefile +0 -0
index cbae74522a..6d0c2ee691 100644

pc-bios/s390-ccw/Makefile s390-netboot.img: · line 39

Quoted 5 lines
pc-bios/s390-ccw/Makefile +1 -1
@@ -36,4 +36,4 @@ s390-netboot.img:
 endif
 
 clean:
-	$(RM) *.o *.d *.img *.elf *~ *.a
+	rm -f *.o *.d *.img *.elf *~ *.a

Thanks, applied with a tweaked commit message:

pc-bios/s390-ccw: Use rm command during make clean

This reverts a change that replaced the "rm -f" command with the undefined variable RM (expected to be set by make), and causes the "make clean" command to fail for a s390 target:
(...)

#3 lore raw
In reply to Eric Farman
Quoted 9 lines · Eric Farman

How often does one really do a "make clean" ? Rather infrequently, as I only stumbled on this today.

Perhaps I have missed the RM variable somewhere, as I see similar syntax in some of the tests/tcg/ Makefiles, but I don't see it being set here. My configure statement isn't terribly interesting, just enabling debug for an s390x target, and as such there's no RM variable in its output. I'll trust that Thomas will chime in with where it should have been. In the meantime, this does the trick for me.

RM is one of the variables that should be pre-initialized by Make, and AFAIK should be used to increase portability (well, it's likely not important for QEMU since we require a posix-shell like built environment anyway).

According to the info page of Make, chapter "10.3 Variables Used by Implicit Rules":

`RM'
Command to remove a file; default `rm -f'.

I've also checked it again and "make clean" works fine here (using GNU Make 3.82). Which version of Make (and Linux distro) are you using?

Anyway, maybe I also simply missed something, so I'm certainly also fine with the patch to revert it to "rm -f".

Thomas

#4 lore raw
Quoted 16 lines · On Tue, 15 Aug 2017 07:02:10 +0200 Thomas Huth <[email protected]> wrote:
Quoted 9 lines · Eric Farman

How often does one really do a "make clean" ? Rather infrequently, as I only stumbled on this today.

Perhaps I have missed the RM variable somewhere, as I see similar syntax in some of the tests/tcg/ Makefiles, but I don't see it being set here. My configure statement isn't terribly interesting, just enabling debug for an s390x target, and as such there's no RM variable in its output. I'll trust that Thomas will chime in with where it should have been. In the meantime, this does the trick for me.

RM is one of the variables that should be pre-initialized by Make, and AFAIK should be used to increase portability (well, it's likely not important for QEMU since we require a posix-shell like built environment anyway).

Quoted 8 lines

According to the info page of Make, chapter "10.3 Variables Used by Implicit Rules":

`RM'
Command to remove a file; default `rm -f'.

I've also checked it again and "make clean" works fine here (using GNU Make 3.82). Which version of Make (and Linux distro) are you using?

Interesting. It fails for me with GNU Make 3.82 on my RHEL guest as well.

Quoted 2 lines

Anyway, maybe I also simply missed something, so I'm certainly also fine with the patch to revert it to "rm -f".

Given that other bios makefiles use rm -f as well, let's just change back until we figure out what's wrong.

#5 lore raw
Quoted 28 lines · Cornelia Huck
Quoted 16 lines · On Tue, 15 Aug 2017 07:02:10 +0200 Thomas Huth <[email protected]> wrote:
Quoted 9 lines · Eric Farman

How often does one really do a "make clean" ? Rather infrequently, as I only stumbled on this today.

Perhaps I have missed the RM variable somewhere, as I see similar syntax in some of the tests/tcg/ Makefiles, but I don't see it being set here. My configure statement isn't terribly interesting, just enabling debug for an s390x target, and as such there's no RM variable in its output. I'll trust that Thomas will chime in with where it should have been. In the meantime, this does the trick for me.

RM is one of the variables that should be pre-initialized by Make, and AFAIK should be used to increase portability (well, it's likely not important for QEMU since we require a posix-shell like built environment anyway).

Quoted 8 lines

According to the info page of Make, chapter "10.3 Variables Used by Implicit Rules":

`RM'
Command to remove a file; default `rm -f'.

I've also checked it again and "make clean" works fine here (using GNU Make 3.82). Which version of Make (and Linux distro) are you using?

Quoted 8 lines

Interesting. It fails for me with GNU Make 3.82 on my RHEL guest as well.

Quoted 2 lines

Anyway, maybe I also simply missed something, so I'm certainly also fine with the patch to revert it to "rm -f".

Given that other bios makefiles use rm -f as well, let's just change back until we figure out what's wrong.

I just discovered that it fails for me as well when I do "make clean" from the top directory. So far I was only doing "make clean" after doing a "cd pc-bios/s390-ccw" first, and that works fine. Weird. Something seems to unset the RM variable in our build system, but I fail to find the spot where this happens...

Thomas

#6 lore raw
Quoted 35 lines · Thomas Huth
Quoted 34 lines · Cornelia Huck
Quoted 16 lines · On Tue, 15 Aug 2017 07:02:10 +0200 Thomas Huth <[email protected]> wrote:
Quoted 9 lines · Eric Farman

How often does one really do a "make clean" ? Rather infrequently, as I only stumbled on this today.

Perhaps I have missed the RM variable somewhere, as I see similar syntax in some of the tests/tcg/ Makefiles, but I don't see it being set here. My configure statement isn't terribly interesting, just enabling debug for an s390x target, and as such there's no RM variable in its output. I'll trust that Thomas will chime in with where it should have been. In the meantime, this does the trick for me.

RM is one of the variables that should be pre-initialized by Make, and AFAIK should be used to increase portability (well, it's likely not important for QEMU since we require a posix-shell like built environment anyway).

Quoted 8 lines

According to the info page of Make, chapter "10.3 Variables Used by Implicit Rules":

`RM'
Command to remove a file; default `rm -f'.

I've also checked it again and "make clean" works fine here (using GNU Make 3.82). Which version of Make (and Linux distro) are you using?

Interesting. It fails for me with GNU Make 3.82 on my RHEL guest as well.

Quoted 2 lines

Anyway, maybe I also simply missed something, so I'm certainly also fine with the patch to revert it to "rm -f".

Quoted 8 lines
Quoted 2 lines

Given that other bios makefiles use rm -f as well, let's just change back until we figure out what's wrong.

I just discovered that it fails for me as well when I do "make clean" from the top directory. So far I was only doing "make clean" after doing a "cd pc-bios/s390-ccw" first, and that works fine. Weird. Something seems to unset the RM variable in our build system, but I fail to find the spot where this happens...

Ok, just found it: It's this line in rules.mak:

MAKEFLAGS += -rR

The parameter -R disables the built-in variables, so RM can indeed not work here. Sorry, I wasn't aware of that setting yet, so your patch is indeed the right fix here (or we should maybe define RM in rules.mak, too).

Thomas

#7 lore raw
Quoted 45 lines · On Tue, 15 Aug 2017 10:26:18 +0200 Thomas Huth <[email protected]> wrote:
Quoted 35 lines · Thomas Huth
Quoted 34 lines · Cornelia Huck
Quoted 16 lines · On Tue, 15 Aug 2017 07:02:10 +0200 Thomas Huth <[email protected]> wrote:
Quoted 9 lines · Eric Farman

How often does one really do a "make clean" ? Rather infrequently, as I only stumbled on this today.

Perhaps I have missed the RM variable somewhere, as I see similar syntax in some of the tests/tcg/ Makefiles, but I don't see it being set here. My configure statement isn't terribly interesting, just enabling debug for an s390x target, and as such there's no RM variable in its output. I'll trust that Thomas will chime in with where it should have been. In the meantime, this does the trick for me.

RM is one of the variables that should be pre-initialized by Make, and AFAIK should be used to increase portability (well, it's likely not important for QEMU since we require a posix-shell like built environment anyway).

Quoted 8 lines

According to the info page of Make, chapter "10.3 Variables Used by Implicit Rules":

`RM'
Command to remove a file; default `rm -f'.

I've also checked it again and "make clean" works fine here (using GNU Make 3.82). Which version of Make (and Linux distro) are you using?

Interesting. It fails for me with GNU Make 3.82 on my RHEL guest as well.

Quoted 2 lines

Anyway, maybe I also simply missed something, so I'm certainly also fine with the patch to revert it to "rm -f".

Quoted 8 lines
Quoted 2 lines

Given that other bios makefiles use rm -f as well, let's just change back until we figure out what's wrong.

I just discovered that it fails for me as well when I do "make clean" from the top directory. So far I was only doing "make clean" after doing a "cd pc-bios/s390-ccw" first, and that works fine. Weird. Something seems to unset the RM variable in our build system, but I fail to find the spot where this happens...

Quoted 7 lines

Ok, just found it: It's this line in rules.mak:

MAKEFLAGS += -rR

The parameter -R disables the built-in variables, so RM can indeed not work here. Sorry, I wasn't aware of that setting yet, so your patch is indeed the right fix here (or we should maybe define RM in rules.mak, too).

The other users are all in tests/tcg/.

Would there be value in using the built-in variables generally? (Well, value that outweighs having to go through the qemu build system...)

#8 lore raw
Quoted 2 lines · Cornelia Huck

On Tue, 15 Aug 2017 10:26:18 +0200
Thomas Huth <[email protected]> wrote:

[...]

Quoted 8 lines
Quoted 3 lines

The parameter -R disables the built-in variables, so RM can indeed not work here. Sorry, I wasn't aware of that setting yet, so your patch is indeed the right fix here (or we should maybe define RM in rules.mak, too).

The other users are all in tests/tcg/.

Would there be value in using the built-in variables generally? (Well, value that outweighs having to go through the qemu build system...)

There are some non-posix shells where "rm -f" does not work (e.g. COMMAND.COM on Windows), and this is where $(RM) is really useful. But since we require a posix-style built environment anyway, it's not that important for the QEMU build system. OTOH, $(RM) is a standard Make variable, so other people might step into this trap as well - so it's maybe better to define it in rules.mak to avoid future confusion?

Thomas

#9 lore raw
In reply to Thomas Huth
Quoted 21 lines · Thomas Huth
Quoted 20 lines · Thomas Huth
Quoted 19 lines · Cornelia Huck
Quoted 16 lines · On Tue, 15 Aug 2017 07:02:10 +0200 Thomas Huth <[email protected]> wrote:
Quoted 9 lines · Eric Farman

How often does one really do a "make clean" ? Rather infrequently, as I only stumbled on this today.

Perhaps I have missed the RM variable somewhere, as I see similar syntax in some of the tests/tcg/ Makefiles, but I don't see it being set here. My configure statement isn't terribly interesting, just enabling debug for an s390x target, and as such there's no RM variable in its output. I'll trust that Thomas will chime in with where it should have been. In the meantime, this does the trick for me.

RM is one of the variables that should be pre-initialized by Make, and AFAIK should be used to increase portability (well, it's likely not important for QEMU since we require a posix-shell like built environment anyway).

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

According to the info page of Make, chapter "10.3 Variables Used by Implicit Rules":

`RM'
Command to remove a file; default `rm -f'.

I've also checked it again and "make clean" works fine here (using GNU Make 3.82). Which version of Make (and Linux distro) are you using?

Not that it matters now, but make 4.1 on F24

Quoted 16 lines
Quoted 7 lines
Quoted 7 lines

Interesting. It fails for me with GNU Make 3.82 on my RHEL guest as well.

Quoted 2 lines

Anyway, maybe I also simply missed something, so I'm certainly also fine with the patch to revert it to "rm -f".

Quoted 8 lines
Quoted 2 lines

Given that other bios makefiles use rm -f as well, let's just change back until we figure out what's wrong.

I just discovered that it fails for me as well when I do "make clean" from the top directory. So far I was only doing "make clean" after doing a "cd pc-bios/s390-ccw" first, and that works fine. Weird. Something seems to unset the RM variable in our build system, but I fail to find the spot where this happens...

Quoted 7 lines

Ok, just found it: It's this line in rules.mak:

MAKEFLAGS += -rR

The parameter -R disables the built-in variables, so RM can indeed not work here. Sorry, I wasn't aware of that setting yet, so your patch is indeed the right fix here (or we should maybe define RM in rules.mak, too).

Excellent find, Thomas! I was not aware of that either. Thanks to both you and Cornelia for this.

- Eric

#10 lore raw
In reply to Eric Farman
Quoted 2 lines · Eric Farman

How often does one really do a "make clean" ? Rather infrequently, as I only stumbled on this today.

FWIW, one of my standard pre-merge build tests does a "make clean" and then a make (mostly as a check that we do build from clean as well as incrementally). Not sure why it didn't catch this...

thanks
-- PMM

#11 lore raw
Quoted 8 lines · On Tue, 15 Aug 2017 11:00:51 +0100 Peter Maydell <[email protected]>…
Quoted 2 lines · Eric Farman

How often does one really do a "make clean" ? Rather infrequently, as I only stumbled on this today.

FWIW, one of my standard pre-merge build tests does a "make clean" and then a make (mostly as a check that we do build from clean as well as incrementally). Not sure why it didn't catch this...

Probably because you don't build on s390x... I'll add it to my workflow, though.

#12 lore raw
Quoted 7 lines · Cornelia Huck
Quoted 4 lines · On Tue, 15 Aug 2017 11:00:51 +0100 Peter Maydell <[email protected]>…
Quoted 2 lines · Eric Farman

How often does one really do a "make clean" ? Rather infrequently, as I only stumbled on this today.

Quoted 6 lines
Quoted 4 lines

FWIW, one of my standard pre-merge build tests does a "make clean" and then a make (mostly as a check that we do build from clean as well as incrementally). Not sure why it didn't catch this...

Probably because you don't build on s390x...

I do, but not with a 'make clean' step :-)

thanks
-- PMM