Re: [PATCH] build: make PREFIX overwritable on the commandline

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 22, 2017 at 5:25 PM, Uwe Kleine-König <uwe@xxxxxxxxxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux