* [PATCH] build: make PREFIX overwritable on the commandline
@ 2017-09-22 21:25 Uwe Kleine-König
2017-09-23 11:20 ` Christopher Li
0 siblings, 1 reply; 4+ messages in thread
From: Uwe Kleine-König @ 2017-09-22 21:25 UTC (permalink / raw)
To: linux-sparse
This way I can just use
make install PREFIX=/usr
on the command line to install sparse into the system.
Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index d0341764158e..e011df3cc0dc 100644
--- a/Makefile
+++ b/Makefile
@@ -54,7 +54,7 @@ BASIC_CFLAGS += -Wp,-MD,$(@D)/.$(@F).d
endif
DESTDIR=
-PREFIX=$(HOME)
+PREFIX ?= $(HOME)
BINDIR=$(PREFIX)/bin
LIBDIR=$(PREFIX)/lib
MANDIR=$(PREFIX)/share/man
--
2.14.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] build: make PREFIX overwritable on the commandline
2017-09-22 21:25 [PATCH] build: make PREFIX overwritable on the commandline Uwe Kleine-König
@ 2017-09-23 11:20 ` Christopher Li
2017-09-23 18:31 ` Uwe Kleine-König
0 siblings, 1 reply; 4+ messages in thread
From: Christopher Li @ 2017-09-23 11:20 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: Linux-Sparse
On Fri, Sep 22, 2017 at 5:25 PM, Uwe Kleine-König <uwe@kleine-koenig.org> wrote:
> This way I can just use
>
> make install PREFIX=/usr
>
> on the command line to install sparse into the system.
>
> DESTDIR=
> -PREFIX=$(HOME)
> +PREFIX ?= $(HOME)
Are you sure you need this patch to use "make install PREFIX=/usr" ?
Variable that assign from the command line will ignore other normal assignment.
You need to use override to assign to command line variables.
This patch can show it:
diff --git a/Makefile b/Makefile
index a4653aa1..868e7816 100644
--- a/Makefile
+++ b/Makefile
@@ -55,6 +55,7 @@ endif
DESTDIR=
PREFIX=$(HOME)
+$(info prefix origin: $(origin PREFIX) value: $(PREFIX))
BINDIR=$(PREFIX)/bin
LIBDIR=$(PREFIX)/lib
MANDIR=$(PREFIX)/share/man
When I invoke with PREFIX=/usr/local/
$ make PREFIX=/usr/local/ clean
prefix origin: command line value: /usr/local/
So your patch is not needed.
Chris
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] build: make PREFIX overwritable on the commandline
2017-09-23 11:20 ` Christopher Li
@ 2017-09-23 18:31 ` Uwe Kleine-König
2017-10-03 4:38 ` Christopher Li
0 siblings, 1 reply; 4+ messages in thread
From: Uwe Kleine-König @ 2017-09-23 18:31 UTC (permalink / raw)
To: Christopher Li; +Cc: Linux-Sparse
[-- Attachment #1: Type: text/plain, Size: 767 bytes --]
On Sat, Sep 23, 2017 at 07:20:27AM -0400, Christopher Li wrote:
> On Fri, Sep 22, 2017 at 5:25 PM, Uwe Kleine-König <uwe@kleine-koenig.org> wrote:
> > This way I can just use
> >
> > make install PREFIX=/usr
> >
> > on the command line to install sparse into the system.
> >
> > DESTDIR=
> > -PREFIX=$(HOME)
> > +PREFIX ?= $(HOME)
>
> Are you sure you need this patch to use "make install PREFIX=/usr" ?
Oh, you're right. I pass PREFIX via the environment. But as there are
already other things I pass on the command line I can also pass PREFIX
there. I still consider ?= as the right thing to do there, but it's not
important any more. If you still consider the patch fine, I can update
the commit log accordingly.
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] build: make PREFIX overwritable on the commandline
2017-09-23 18:31 ` Uwe Kleine-König
@ 2017-10-03 4:38 ` Christopher Li
0 siblings, 0 replies; 4+ messages in thread
From: Christopher Li @ 2017-10-03 4:38 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: Linux-Sparse
On Sat, Sep 23, 2017 at 2:31 PM, Uwe Kleine-König <uwe@kleine-koenig.org> wrote:
>> Are you sure you need this patch to use "make install PREFIX=/usr" ?
>
> Oh, you're right. I pass PREFIX via the environment. But as there are
> already other things I pass on the command line I can also pass PREFIX
> there. I still consider ?= as the right thing to do there, but it's not
> important any more. If you still consider the patch fine, I can update
> the commit log accordingly.
Sorry for the delay. I am catching up with the patches.
I don't mind having the patch if you want to pass PREFIX from the
environment.
Please update the comments.
Thanks
Chris
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-10-03 4:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-22 21:25 [PATCH] build: make PREFIX overwritable on the commandline Uwe Kleine-König
2017-09-23 11:20 ` Christopher Li
2017-09-23 18:31 ` Uwe Kleine-König
2017-10-03 4:38 ` Christopher Li
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.