linux headers_install target seem to be broken

Hi,

I’m currently on 3.8.11, with patches from git://github.com/beagleboard/kernel.git and when I do make O=O_PATH ARCH=arm INSTALL_HDR_PATH=I_PATH V=0 headers_install
it seem to work at a first glance, but no files from include/linux is seen, only directories. Further headers_check does not work at all. There is a patch from git://github.com/beagleboard/kernel.git
that seem to cause this; 0002-headers_install-Fix-build-failures-on-deep-directory.patch

If I take the Makefile.headersinst from before that patch it seems ok.

It looks like my “make” version instead of creating one tmp-file with mktemp (see code in Makefile.headersinsts introduced by the aforementioned patch) creates one tmp-file for each iteration in the loop, instead of a single file.

I don’t think that the person submitting this patch did not test it, but it is rather something subtle with my version of make.

I’m runnig kubuntu 13.04 with this version of make:

haen@haen-linux:$ aptitude show make
Package: make
State: installed
Automatically installed: no
Version: 3.81-8.2ubuntu2
Priority: optional
Section: devel
Maintainer: Ubuntu Developers ubuntu-devel-discuss@lists.ubuntu.com
Architecture: amd64
Uncompressed Size: 324 k
Depends: libc6 (>= 2.14)
Suggests: make-doc
Conflicts: make
Description: An utility for Directing compilation.
GNU Make is an utility which controls the generation of executables and other target files of a program from the program’s source files. It determines automatically which pieces of a large program need to be (re)created, and issues the commands to (re)create
them. Make is not limited to programs and executable, it can be applied to any task where a set of target files must be created based on a set of input files, based on dependency and processing rules. Indeed, Make is a general purpose dependency solver.
Homepage: http://www.gnu.org/software/make/

haen@haen-linux:/opt/repos/beaglebone_kernel$ make --version
GNU Make 3.81
Copyright © 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for x86_64-pc-linux-gnu
haen@haen-linux:$

Anyone experienced something similar ?

br Håkan Engblom

haen@haen-linux:$ rm /tmp/tmp.*
haen@haen-linux:$ rm -rf O_PATH ; mkdir O_PATH ; make O=O_PATH ARCH=arm INSTALL_HDR_PATH=I_PATH V=0 headers_install
CHK include/generated/uapi/linux/version.h
UPD include/generated/uapi/linux/version.h
HOSTCC scripts/basic/fixdep
WRAP arch/arm/include/generated/asm/auxvec.h
WRAP arch/arm/include/generated/asm/bitsperlong.h
WRAP arch/arm/include/generated/asm/cputime.h
WRAP arch/arm/include/generated/asm/current.h
WRAP arch/arm/include/generated/asm/emergency-restart.h
WRAP arch/arm/include/generated/asm/errno.h
WRAP arch/arm/include/generated/asm/exec.h
WRAP arch/arm/include/generated/asm/ioctl.h
WRAP arch/arm/include/generated/asm/ipcbuf.h
WRAP arch/arm/include/generated/asm/irq_regs.h
WRAP arch/arm/include/generated/asm/kdebug.h
WRAP arch/arm/include/generated/asm/local.h
WRAP arch/arm/include/generated/asm/local64.h
WRAP arch/arm/include/generated/asm/msgbuf.h
WRAP arch/arm/include/generated/asm/param.h
WRAP arch/arm/include/generated/asm/parport.h
WRAP arch/arm/include/generated/asm/poll.h
WRAP arch/arm/include/generated/asm/resource.h
WRAP arch/arm/include/generated/asm/sections.h
WRAP arch/arm/include/generated/asm/segment.h
WRAP arch/arm/include/generated/asm/sembuf.h
WRAP arch/arm/include/generated/asm/serial.h
WRAP arch/arm/include/generated/asm/shmbuf.h
WRAP arch/arm/include/generated/asm/siginfo.h
WRAP arch/arm/include/generated/asm/sizes.h
WRAP arch/arm/include/generated/asm/socket.h
WRAP arch/arm/include/generated/asm/sockios.h
WRAP arch/arm/include/generated/asm/termbits.h
WRAP arch/arm/include/generated/asm/termios.h
WRAP arch/arm/include/generated/asm/timex.h
WRAP arch/arm/include/generated/asm/trace_clock.h
WRAP arch/arm/include/generated/asm/types.h
WRAP arch/arm/include/generated/asm/unaligned.h
HOSTCC scripts/unifdef
INSTALL include/asm-generic (35 files)
INSTALL include/drm (15 files)
INSTALL include/linux/byteorder (2 files)
INSTALL include/linux/caif (2 files)
INSTALL include/linux/can (5 files)
INSTALL include/linux/dvb (8 files)
INSTALL include/linux/hdlc (1 file)
INSTALL include/linux/hsi (1 file)
INSTALL include/linux/isdn (1 file)
INSTALL include/linux/mmc (1 file)
INSTALL include/linux/netfilter/ipset (4 files)
INSTALL include/linux/netfilter (76 files)
INSTALL include/linux/netfilter_arp (2 files)
INSTALL include/linux/netfilter_bridge (18 files)
INSTALL include/linux/netfilter_ipv4 (10 files)
INSTALL include/linux/netfilter_ipv6 (12 files)
INSTALL include/linux/nfsd (5 files)
INSTALL include/linux/raid (2 files)
INSTALL include/linux/spi (1 file)
INSTALL include/linux/sunrpc (1 file)
INSTALL include/linux/tc_act (7 files)
INSTALL include/linux/tc_ematch (4 files)
INSTALL include/linux/usb (10 files)
INSTALL include/linux/wimax (1 file)
INSTALL include/linux (380 files)
INSTALL include/mtd (5 files)
INSTALL include/rdma (6 files)
INSTALL include/scsi/fc (4 files)
INSTALL include/scsi (3 files)
INSTALL include/sound (10 files)
INSTALL include/video (3 files)
INSTALL include/xen (2 files)
INSTALL include/uapi (0 file)
INSTALL include/asm (33 files)
haen@haen-linux:$ make O=O_PATH ARCH=arm INSTALL_HDR_PATH=I_PATH V=0 headers_check
CHK include/generated/uapi/linux/version.h
I_PATH/include/uapi/…install.cmd:2: *** missing separator. Stop.
make[1]: *** [headers_install] Error 2
make: *** [sub-make] Error 2
haen@haen-linux:$ ll O_PATH/I_PATH/include/linux/
total 96
drwxrwxr-x 23 haen haen 4096 maj 16 14:07 ./
drwxrwxr-x 13 haen haen 4096 maj 16 14:07 …/
drwxrwxr-x 2 haen haen 4096 maj 16 14:07 byteorder/
drwxrwxr-x 2 haen haen 4096 maj 16 14:07 caif/
drwxrwxr-x 2 haen haen 4096 maj 16 14:07 can/
drwxrwxr-x 2 haen haen 4096 maj 16 14:07 dvb/
drwxrwxr-x 2 haen haen 4096 maj 16 14:07 hdlc/
drwxrwxr-x 2 haen haen 4096 maj 16 14:07 hsi/
-rw-rw-r-- 1 haen haen 0 maj 16 14:07 .install
-rw-rw-r-- 1 haen haen 288 maj 16 14:07 …install.cmd
drwxrwxr-x 2 haen haen 4096 maj 16 14:07 isdn/
drwxrwxr-x 2 haen haen 4096 maj 16 14:07 mmc/
drwxrwxr-x 3 haen haen 4096 maj 16 14:07 netfilter/
drwxrwxr-x 2 haen haen 4096 maj 16 14:07 netfilter_arp/
drwxrwxr-x 2 haen haen 4096 maj 16 14:07 netfilter_bridge/
drwxrwxr-x 2 haen haen 4096 maj 16 14:07 netfilter_ipv4/
drwxrwxr-x 2 haen haen 4096 maj 16 14:07 netfilter_ipv6/
drwxrwxr-x 2 haen haen 4096 maj 16 14:07 nfsd/
drwxrwxr-x 2 haen haen 4096 maj 16 14:07 raid/
drwxrwxr-x 2 haen haen 4096 maj 16 14:07 spi/
drwxrwxr-x 2 haen haen 4096 maj 16 14:07 sunrpc/
drwxrwxr-x 2 haen haen 4096 maj 16 14:07 tc_act/
drwxrwxr-x 2 haen haen 4096 maj 16 14:07 tc_ematch/
drwxrwxr-x 2 haen haen 4096 maj 16 14:07 usb/
drwxrwxr-x 2 haen haen 4096 maj 16 14:07 wimax/
haen@haen-linux:$ ll /tmp/tmp.*
-rw------- 1 haen haen 315 maj 16 14:07 /tmp/tmp.0iMBCnXwYv
-rw------- 1 haen haen 152 maj 16 14:07 /tmp/tmp.1Adumt2GHP
-rw------- 1 haen haen 307 maj 16 14:07 /tmp/tmp.28mFLdJ4m4
-rw------- 1 haen haen 166 maj 16 14:07 /tmp/tmp.2FjSfsBxkQ
-rw------- 1 haen haen 471 maj 16 14:07 /tmp/tmp.3S2XmMYZVd
-rw------- 1 haen haen 138 maj 16 14:07 /tmp/tmp.4daXNHyEQV
-rw------- 1 haen haen 1286 maj 16 14:07 /tmp/tmp.6YKf3kL20E
-rw------- 1 haen haen 88 maj 16 14:07 /tmp/tmp.7W4nFvjoaD
-rw------- 1 haen haen 57 maj 16 14:07 /tmp/tmp.80nuucW3tR
-rw------- 1 haen haen 153 maj 16 14:07 /tmp/tmp.8PSRH1ml8q
-rw------- 1 haen haen 229 maj 16 14:07 /tmp/tmp.8uc5jrUItf
-rw------- 1 haen haen 781 maj 16 14:07 /tmp/tmp.AQdWjXfV1k
-rw------- 1 haen haen 66 maj 16 14:07 /tmp/tmp.bI2CWNGvzc
-rw------- 1 haen haen 185 maj 16 14:07 /tmp/tmp.DiMfVl7Wg3
-rw------- 1 haen haen 573 maj 16 14:07 /tmp/tmp.ePEO7aHS2Q
-rw------- 1 haen haen 329 maj 16 14:07 /tmp/tmp.EPSABxVT97
-rw------- 1 haen haen 36 maj 16 14:07 /tmp/tmp.FCitB9UFms
-rw------- 1 haen haen 1452 maj 16 14:07 /tmp/tmp.FCXZ2XLPMI
-rw------- 1 haen haen 0 maj 16 14:07 /tmp/tmp.FFQUFAAAiP
-rw------- 1 haen haen 11759 maj 16 14:07 /tmp/tmp.FmqSbqTWId
-rw------- 1 haen haen 3358 maj 16 14:07 /tmp/tmp.fnpXfygpc5
-rw------- 1 haen haen 33 maj 16 14:07 /tmp/tmp.fzhytsPNqg
-rw------- 1 haen haen 508 maj 16 14:07 /tmp/tmp.G1kggU329G
-rw------- 1 haen haen 392 maj 16 14:07 /tmp/tmp.gc5F49jUpp
-rw------- 1 haen haen 159 maj 16 14:07 /tmp/tmp.gSt1Vc7tkD
-rw------- 1 haen haen 67 maj 16 14:07 /tmp/tmp.h5SJ0dypSn
-rw------- 1 haen haen 67 maj 16 14:07 /tmp/tmp.HCaPyf4waN
-rw------- 1 haen haen 65 maj 16 14:07 /tmp/tmp.hiTCPvnpxX
-rw------- 1 haen haen 34 maj 16 14:07 /tmp/tmp.hKVAUbxWp6
-rw------- 1 haen haen 639 maj 16 14:07 /tmp/tmp.i8jpUddZMX
-rw------- 1 haen haen 456 maj 16 14:07 /tmp/tmp.i99ZVZGwEE
-rw------- 1 haen haen 325 maj 16 14:07 /tmp/tmp.IeKFTmNXbE
-rw------- 1 haen haen 64 maj 16 14:07 /tmp/tmp.IMhx5PcYOf
-rw------- 1 haen haen 65 maj 16 14:07 /tmp/tmp.isfbPXqCHw
-rw------- 1 haen haen 128 maj 16 14:07 /tmp/tmp.IZKiOeROfN
-rw------- 1 haen haen 160 maj 16 14:07 /tmp/tmp.kJBTx5Rp8l
-rw------- 1 haen haen 67 maj 16 14:07 /tmp/tmp.Ku7x3DvD5O
-rw------- 1 haen haen 201 maj 16 14:07 /tmp/tmp.LrH2J2KYbn
-rw------- 1 haen haen 23556 maj 16 14:07 /tmp/tmp.mzF6JVkYY5
-rw------- 1 haen haen 300 maj 16 14:07 /tmp/tmp.n5OMv8Gcyo
-rw------- 1 haen haen 921 maj 16 14:07 /tmp/tmp.NYKQ9AUFV9
-rw------- 1 haen haen 67 maj 16 14:07 /tmp/tmp.nZMymG3do0
-rw------- 1 haen haen 2371 maj 16 14:07 /tmp/tmp.p0tpdx5nNg
-rw------- 1 haen haen 1092 maj 16 14:07 /tmp/tmp.PHHaI0T0tb
-rw------- 1 haen haen 206 maj 16 14:07 /tmp/tmp.PiIHkJGT9N
-rw------- 1 haen haen 0 maj 16 14:07 /tmp/tmp.qfd3UqRuob
-rw------- 1 haen haen 0 maj 16 14:07 /tmp/tmp.QnsTcFNXdP
-rw------- 1 haen haen 107 maj 16 14:07 /tmp/tmp.QwTZ9BbQtu
-rw------- 1 haen haen 36 maj 16 14:07 /tmp/tmp.r5DBiGYxe5
-rw------- 1 haen haen 91 maj 16 14:07 /tmp/tmp.Rjc28NbO1a
-rw------- 1 haen haen 125 maj 16 14:07 /tmp/tmp.sLDo5nvM8N
-rw------- 1 haen haen 334 maj 16 14:07 /tmp/tmp.sLfnalF4PV
-rw------- 1 haen haen 169 maj 16 14:07 /tmp/tmp.T0BIQKpw8X
-rw------- 1 haen haen 34 maj 16 14:07 /tmp/tmp.t3AvhxjJQ5
-rw------- 1 haen haen 97 maj 16 14:07 /tmp/tmp.tew8IipDhb
-rw------- 1 haen haen 36 maj 16 14:07 /tmp/tmp.THBcXiAvKy
-rw------- 1 haen haen 324 maj 16 14:07 /tmp/tmp.TQI9F1Lf5Q
-rw------- 1 haen haen 260 maj 16 14:07 /tmp/tmp.uZEyNBUFt0
-rw------- 1 haen haen 76 maj 16 14:07 /tmp/tmp.VhKNjDyrxi
-rw------- 1 haen haen 0 maj 16 14:07 /tmp/tmp.VpGGgWoVTf
-rw------- 1 haen haen 934 maj 16 14:07 /tmp/tmp.vWsEFI9yxY
-rw------- 1 haen haen 270 maj 16 14:07 /tmp/tmp.w8Dy2Gq3tw
-rw------- 1 haen haen 487 maj 16 14:07 /tmp/tmp.XHjrrq4bTs
-rw------- 1 haen haen 894 maj 16 14:07 /tmp/tmp.xMFD8PRzN2
-rw------- 1 haen haen 945 maj 16 14:07 /tmp/tmp.YLo16UBJ2b
-rw------- 1 haen haen 644 maj 16 14:07 /tmp/tmp.yOMunEs8kz
-rw------- 1 haen haen 5714 maj 16 14:07 /tmp/tmp.yxaunNgfcv
-rw------- 1 haen haen 176 maj 16 14:07 /tmp/tmp.Yypcy39saL
-rw------- 1 haen haen 36 maj 16 14:07 /tmp/tmp.ZliW5K2mLw
-rw------- 1 haen haen 119 maj 16 14:07 /tmp/tmp.ZSSjTFNnJF
haen@haen-linux:$