Ticket #2296 (closed enhancement: fixed)

Opened 9 months ago

Last modified 9 months ago

Let the user to override Makefile variable without changing the Makefile

Reported by: ticket Assigned to: khali
Priority: minor Milestone: 3.0.1
Component: unsorted Version:
Keywords: Makefile build Cc: giamby@infinito.it

Description

Hi,

I would like to propose a little patch to the Makefile of lm-sensors.

The problem is that some linux/unix distributions (in this case I'm using GoboLinux?) let you to choose the installation dir or nearly any library or package. In the case of lm-sensors, this can be accomplished by simply editing the PREFIX variable of the Makefile. Unfortunately this is not very handy to cope with automatic tool, since they need to change the makefile. An easier way is proposed with this patch: let the user to override the PREFIX variable using system environment. All you need to change is the way you assign the variable by using the "?=" assignment operator of gnu make. Hope this make sense. giamby@infinito.it

Attachments

01-Makefile.patch (0.6 kB) - added by ticket on 01/15/08 09:52:04.

Change History

01/15/08 09:52:04 changed by ticket

  • attachment 01-Makefile.patch added.

01/18/08 22:42:18 changed by khali

  • cc set to giamby@infinito.it.
  • owner changed from somebody to khali.
  • status changed from new to assigned.

This has been discussed 9 months ago on the lm-sensors list:

http://lists.lm-sensors.org/pipermail/lm-sensors/2007-April/019461.html

The conclusion was that it is already possible to override the Makefile variables from the command line. Note that the variables must be passed on the command line (e.g. "make PREFIX=/usr") and not through the environment as you seem to expect ("PREFIX=/usr make" won't work.)

01/19/08 11:22:20 changed by khali

  • status changed from assigned to closed.
  • resolution set to fixed.
  • milestone set to 3.0.1.

I've documented the variable overriding mechanism (r5107).