public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Revert "make: let src/Makefile set *dir vars properly"
@ 2022-04-14  6:36 Stefan Hajnoczi
  2022-04-14 12:55 ` Jens Axboe
  2022-04-14 12:55 ` Jens Axboe
  0 siblings, 2 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2022-04-14  6:36 UTC (permalink / raw)
  To: linux-block; +Cc: Jens Axboe, Stefan Hajnoczi, Paymon MARANDI

This reverts commit 9236f53a8ffe96cc2430f7131bbcba5756b97bc2.

"make install DESTDIR=..." specifies a root directory where files are
installed. For example, includedir=/usr/include DESTDIR=/a should
install header files into /a/usr/include.

Commit 9236f53a8ffe removed the includedir=, etc arguments on the make
command-line in ./Makefile, leaving only prefix=$(DESTDIR)$(prefix). It
claimed "prefix suffice for setting *dir variables in src/Makefile" but
this is incorrect. "make install DESTDIR=..." now has no effect and
files are not installed with a DESTDIR prefix.

The GNU make manual 9.5 Overriding Variables says:

  all ordinary assignments of the same variable in the makefile are
  ignored; we say they have been overridden by the command line
  argument.

This explains why it was necessary to set includedir=, etc on the make
command-line in ./Makefile. We need to override these variables with
DESTDIR from the command-line so they are not clobbered in src/Makefile
when config-host.mak is included.

Cc: Paymon MARANDI <darwinskernel@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Makefile b/Makefile
index d6f8520..28c0fd8 100644
--- a/Makefile
+++ b/Makefile
@@ -45,6 +45,9 @@ endif
 
 install: $(NAME).pc
 	@$(MAKE) -C src install prefix=$(DESTDIR)$(prefix) \
+		includedir=$(DESTDIR)$(includedir) \
+		libdir=$(DESTDIR)$(libdir) \
+		libdevdir=$(DESTDIR)$(libdevdir) \
 		relativelibdir=$(relativelibdir)
 	$(INSTALL) -D -m 644 $(NAME).pc $(DESTDIR)$(libdevdir)/pkgconfig/$(NAME).pc
 	$(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man2
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Revert "make: let src/Makefile set *dir vars properly"
  2022-04-14  6:36 [PATCH] Revert "make: let src/Makefile set *dir vars properly" Stefan Hajnoczi
@ 2022-04-14 12:55 ` Jens Axboe
  2022-04-19  7:00   ` Stefan Hajnoczi
  2022-04-14 12:55 ` Jens Axboe
  1 sibling, 1 reply; 4+ messages in thread
From: Jens Axboe @ 2022-04-14 12:55 UTC (permalink / raw)
  To: Stefan Hajnoczi, linux-block; +Cc: Paymon MARANDI

On 4/14/22 12:36 AM, Stefan Hajnoczi wrote:
> This reverts commit 9236f53a8ffe96cc2430f7131bbcba5756b97bc2.
> 
> "make install DESTDIR=..." specifies a root directory where files are
> installed. For example, includedir=/usr/include DESTDIR=/a should
> install header files into /a/usr/include.
> 
> Commit 9236f53a8ffe removed the includedir=, etc arguments on the make
> command-line in ./Makefile, leaving only prefix=$(DESTDIR)$(prefix). It
> claimed "prefix suffice for setting *dir variables in src/Makefile" but
> this is incorrect. "make install DESTDIR=..." now has no effect and
> files are not installed with a DESTDIR prefix.
> 
> The GNU make manual 9.5 Overriding Variables says:
> 
>   all ordinary assignments of the same variable in the makefile are
>   ignored; we say they have been overridden by the command line
>   argument.
> 
> This explains why it was necessary to set includedir=, etc on the make
> command-line in ./Makefile. We need to override these variables with
> DESTDIR from the command-line so they are not clobbered in src/Makefile
> when config-host.mak is included.

I think this should have gone to io-uring@vger.kernel.org, the patch had
me confused for a second.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Revert "make: let src/Makefile set *dir vars properly"
  2022-04-14  6:36 [PATCH] Revert "make: let src/Makefile set *dir vars properly" Stefan Hajnoczi
  2022-04-14 12:55 ` Jens Axboe
@ 2022-04-14 12:55 ` Jens Axboe
  1 sibling, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2022-04-14 12:55 UTC (permalink / raw)
  To: linux-block, stefanha; +Cc: darwinskernel

On Thu, 14 Apr 2022 07:36:51 +0100, Stefan Hajnoczi wrote:
> This reverts commit 9236f53a8ffe96cc2430f7131bbcba5756b97bc2.
> 
> "make install DESTDIR=..." specifies a root directory where files are
> installed. For example, includedir=/usr/include DESTDIR=/a should
> install header files into /a/usr/include.
> 
> Commit 9236f53a8ffe removed the includedir=, etc arguments on the make
> command-line in ./Makefile, leaving only prefix=$(DESTDIR)$(prefix). It
> claimed "prefix suffice for setting *dir variables in src/Makefile" but
> this is incorrect. "make install DESTDIR=..." now has no effect and
> files are not installed with a DESTDIR prefix.
> 
> [...]

Applied, thanks!

[1/1] Revert "make: let src/Makefile set *dir vars properly"
      commit: 415c62fca6b8014bf9b03517c4d6e0e2e7ad02a9

Best regards,
-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Revert "make: let src/Makefile set *dir vars properly"
  2022-04-14 12:55 ` Jens Axboe
@ 2022-04-19  7:00   ` Stefan Hajnoczi
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2022-04-19  7:00 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, Paymon MARANDI

[-- Attachment #1: Type: text/plain, Size: 1444 bytes --]

On Thu, Apr 14, 2022 at 06:55:48AM -0600, Jens Axboe wrote:
> On 4/14/22 12:36 AM, Stefan Hajnoczi wrote:
> > This reverts commit 9236f53a8ffe96cc2430f7131bbcba5756b97bc2.
> > 
> > "make install DESTDIR=..." specifies a root directory where files are
> > installed. For example, includedir=/usr/include DESTDIR=/a should
> > install header files into /a/usr/include.
> > 
> > Commit 9236f53a8ffe removed the includedir=, etc arguments on the make
> > command-line in ./Makefile, leaving only prefix=$(DESTDIR)$(prefix). It
> > claimed "prefix suffice for setting *dir variables in src/Makefile" but
> > this is incorrect. "make install DESTDIR=..." now has no effect and
> > files are not installed with a DESTDIR prefix.
> > 
> > The GNU make manual 9.5 Overriding Variables says:
> > 
> >   all ordinary assignments of the same variable in the makefile are
> >   ignored; we say they have been overridden by the command line
> >   argument.
> > 
> > This explains why it was necessary to set includedir=, etc on the make
> > command-line in ./Makefile. We need to override these variables with
> > DESTDIR from the command-line so they are not clobbered in src/Makefile
> > when config-host.mak is included.
> 
> I think this should have gone to io-uring@vger.kernel.org, the patch had
> me confused for a second.

Sorry about that. I have updated my configuration to send patches to the
correct list.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-04-19  7:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-14  6:36 [PATCH] Revert "make: let src/Makefile set *dir vars properly" Stefan Hajnoczi
2022-04-14 12:55 ` Jens Axboe
2022-04-19  7:00   ` Stefan Hajnoczi
2022-04-14 12:55 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox