File: rules

package info (click to toggle)
linux-kernel-headers 2.5.999-test7-bk-17
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 28,268 kB
  • ctags: 214,024
  • sloc: ansic: 324,929; cpp: 783; makefile: 79; asm: 61; sh: 61
file content (79 lines) | stat: -rwxr-xr-x 2,411 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/usr/bin/make -f

# Work around a bug in cdbs 0.4.14.
DEB_PATCHDIRS_READONLY = no

# This implements the .deb package creation using debhelper.
include /usr/share/cdbs/1/rules/debhelper.mk

# Simple patches in debian/patches.
include /usr/share/cdbs/1/rules/simple-patchsys.mk

pkgdir = debian/linux-kernel-headers
includedir = $(pkgdir)/usr/include

kernel_arch := $(DEB_HOST_ARCH)
kernel_arch := $(patsubst powerpc,ppc,$(kernel_arch))
kernel_arch := $(patsubst hppa,parisc,$(kernel_arch))
kernel_arch := $(patsubst mipsel,mips,$(kernel_arch))
kernel_arch := $(patsubst amd64,x86_64,$(kernel_arch))

other_headers := $(wildcard others/asm-$(kernel_arch)-*)
other_headers_inst := $(patsubst others/asm-$(kernel_arch)-%,%,$(other_headers))

# Install architecture-specific headers into debian/linux-kernel-headers.
# Common headers are handled by linux-kernel-headers.install.
common-install-arch:: lkh-install lkh-test

lkh-install: stamp-lkh-install
stamp-lkh-install: build
	install -d $(includedir)
	install -d $(includedir)/linux

ifeq ($(kernel_arch),sparc)
	# Sparc and Sparc64 have separate headers.  Generate wrappers.
	cp -a include/asm-sparc $(includedir)/asm-sparc
	cp -a include/asm-sparc64 $(includedir)/asm-sparc64
	mkdir include/asm
	sh debian/generate-asm.sh $(includedir)
else
	rm -rf $(includedir)/asm
	cp -a include/asm-$(kernel_arch) $(includedir)/asm
endif

	cp autoconfs/autoconf-$(DEB_HOST_ARCH).h $(includedir)/linux/autoconf.h

ifeq ($(kernel_arch),x86_64)
	# install the i386 kernel headers in /usr/include/i386-linux
	mkdir -p $(includedir)/i386-linux
	ln -s ../linux $(includedir)/i386-linux
	ln -s ../asm-generic $(includedir)/i386-linux
	cp -a include/asm-i386 $(includedir)/i386-linux/asm
endif

ifeq ($(kernel_arch),arm)
	# ARM needs some extra symlinks.
	rm -f $(includedir)/asm/proc
	rm -f $(includedir)/asm/arch
	ln -s proc-armv $(includedir)/asm/proc
	ln -s arch-ebsa285 $(includedir)/asm/arch
endif

	# Some architectures need to include generated headers.  We can't
	# generate them at build time, so maintain a static collection.
	# Note: not compatible with Sparc hack, above.
	for i in dummy $(other_headers_inst); do \
	  if test $$i != dummy; then \
	    cp others/asm-$(kernel_arch)-$$i \
	       $(includedir)/asm/$$i; \
	  fi; \
	done

	touch $@

lkh-test: lkh-install build
	$(MAKE) -C testsuite all

clean::
	$(MAKE) -C testsuite clean
	rm -f stamp-lkh-install