File: rules

package info (click to toggle)
kernel-image-2.2.20-atari 2.2.20-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 20 kB
  • ctags: 6
  • sloc: makefile: 54
file content (74 lines) | stat: -rwxr-xr-x 1,917 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
#!/usr/bin/make -f
#
# debian/rules for m68k kernel packages
#

VERSION        := 2.2.20
SUBARCH        := atari

SHELL          := /bin/bash -e
PATCHES        := /usr/src/kernel-patches/m68k/$(VERSION)

DEB_BUILD_ARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH)

MAKEKPKG       := make-kpkg
ifneq ($(DEB_BUILD_ARCH),m68k)
MAKEKPKG       += --arch m68k --cross_compile m68k-linux
endif

build: build-stamp
build-stamp: unpack-stamp patch-stamp
	dh_testdir
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -rf kernel-source-$(VERSION)
	rm -f *.deb *-stamp debian/files
	dh_clean

unpack: unpack-stamp
unpack-stamp:
	if   [ -f   /usr/src/kernel-source-$(VERSION).tar ]; then \
		 tar xf /usr/src/kernel-source-$(VERSION).tar;        \
	else bzcat  /usr/src/kernel-source-$(VERSION).tar.bz2 | tar xf -; fi
	touch unpack-stamp

patch: patch-stamp
patch-stamp: unpack-stamp
	dh_testdir
	cd kernel-source-$(VERSION); $(PATCHES)/apply/apply
	touch patch-stamp

unpatch: patch-stamp
	dh_testdir
	cd kernel-source-$(VERSION); $(PATCHES)/unpatch/unpatch
	rm -f patch-stamp

image: image-stamp
image-stamp: build-stamp
	dh_testdir
	dh_testroot
	mkdir -p                kernel-source-$(VERSION)/debian
	cp debian/control       kernel-source-$(VERSION)/debian
	cp debian/changelog     kernel-source-$(VERSION)/debian
	cp debian/kernel-config kernel-source-$(VERSION)/.config
	touch                   kernel-source-$(VERSION)/debian/official
	cd kernel-source-$(VERSION); \
	$(MAKEKPKG) --subarch $(SUBARCH) --arch_in_name kernel_image
	sed -e s/_$(DEB_BUILD_ARCH).deb/_m68k.deb/ \
		<kernel-source-$(VERSION)/debian/files >>debian/files
	mv *.deb ..
	touch image-stamp

# Build architecture-independent files here.
binary-indep:

# Build architecture-dependent files here.
binary-arch: image-stamp

binary: binary-indep binary-arch

.PHONY: build clean binary-indep binary-arch binary
.PHONY: unpack patch unpatch image