Skip to contentSkip to conversation

Make it possible to override INSTALL_HDR_PATH

PATCH In review Arun Sharma 2 participants 3 messages May 3, 2011 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Make it possible to override INSTALL_HDR_PATH

Makefile +1 -1
index cb715df..ec68886 100644
@@ -1009,7 +1009,7 @@ firmware_install: FORCE
 # Kernel headers
 
 #Default location for installed headers
-export INSTALL_HDR_PATH = $(objtree)/usr
+export INSTALL_HDR_PATH ?= $(objtree)/usr
 
 hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj
 
Signature · 1 line
1.7.4
#1 lore raw

Arun, All,

Makefile firmware_install: FORCE · line 1015

Quoted 13 lines · On Tuesday 03 May 2011 23:46:12 Arun Sharma wrote:
Makefile +1 -1
index cb715df..ec68886 100644
@@ -1009,7 +1009,7 @@ firmware_install: FORCE
 # Kernel headers
 
 #Default location for installed headers
-export INSTALL_HDR_PATH = $(objtree)/usr
+export INSTALL_HDR_PATH ?= $(objtree)/usr
 
 hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj
 

Already works for me here in 2.6.38.5:

  $ head -n 5 Makefile
  VERSION = 2
  PATCHLEVEL = 6
  SUBLEVEL = 38
  EXTRAVERSION = .5
  NAME = Flesh-Eating Bats with Fangs
  $ rm -rf FOO
  $ mkdir FOO
  $ make INSTALL_HDR_PATH=$(pwd)/FOO ARCH=x86 headers_install
  $ ls -l FOO
  total 4
  drwxr-xr-x 12 ymorin users 4096 2011-05-03 23:57 include
  $ cat FOO/include/linux/version.h
  #define LINUX_VERSION_CODE 132646
  #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
  $ make --version | head -n 1
  GNU Make 3.81

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw
Quoted 2 lines · Yann E. MORIN
  $ make INSTALL_HDR_PATH=$(pwd)/FOO ARCH=x86 headers_install
  $ ls -l FOO

Works for me too :) I was trying:

echo 'INSTALL_HDR_PATH=$RPM_BUILD_ROOT/usr make %{?_smp_mflags} headers_install'

along the lines of:

scripts/packaging/mkspec:

echo 'INSTALL_MOD_PATH=$RPM_BUILD_ROOT make %{?_smp_mflags} KBUILD_SRC=modules_install'

While we're on the topic, could we enhance mkspec to spit out -devel and -headers rpms too? I can post patches if there is sufficient interest.

It'd be nice to use the same mechanism to define/override:

INSTALL_PATH
INSTALL_MOD_PATH
INSTALL_HDR_PATH

-Arun