5 TARGET
= arm-crux-linux-gnueabi
9 CROSSTOOLS
= $(PWD
)/..
/..
/toolchain
/crosstools
11 KERNEL_VERSION
= 3.1.9-raspberrypi_20120803
13 .PHONY
: all clean image modules map config
15 all: image modules map
17 clean: image-clean modules-clean map-clean
19 distclean: clean image-distclean modules-distclean map-distclean
21 $(WORK
)/tools-
$(KERNEL_VERSION
).
tar.bz2
:
22 wget
-P
$(WORK
) http
://crux-arm.nu
/files
/distfiles
/raspberrypi
/tools-
$(KERNEL_VERSION
).
tar.bz2
24 $(WORK
)/linux-
$(KERNEL_VERSION
).
tar.bz2
:
25 wget
-P
$(WORK
) http
://crux-arm.nu
/files
/distfiles
/raspberrypi
/linux-
$(KERNEL_VERSION
).
tar.bz2
27 $(WORK
)/linux-
$(KERNEL_VERSION
): $(WORK
)/linux-
$(KERNEL_VERSION
).
tar.bz2
$(PWD
)/config-
$(KERNEL_VERSION
)
28 tar -C
$(WORK
) -xvjf
$(WORK
)/linux-
$(KERNEL_VERSION
).
tar.bz2
29 cp
-v
$(PWD
)/config-
$(KERNEL_VERSION
) $(WORK
)/linux-
$(KERNEL_VERSION
)/.config
30 touch
$(WORK
)/linux-
$(KERNEL_VERSION
)
32 $(WORK
)/zImage-
$(KERNEL_VERSION
): $(WORK
)/linux-
$(KERNEL_VERSION
)
33 cd
$(WORK
)/linux-
$(KERNEL_VERSION
) && \
34 export PATH
=$(CROSSTOOLS
)/bin
:$$PATH && \
35 export LD_LIBRARY_PATH
=$(CROSSTOOLS
)/lib
:$$LD_LIBRARY_PATH && \
36 make ARCH
=arm CROSS_COMPILE
=$(TARGET
)- zImage
37 cp
-v
$(WORK
)/linux-
$(KERNEL_VERSION
)/arch
/arm
/boot
/zImage
$(WORK
)/zImage-
$(KERNEL_VERSION
)
38 ln
-sf zImage-
$(KERNEL_VERSION
) $(WORK
)/zImage
39 touch
$(WORK
)/zImage-
$(KERNEL_VERSION
)
41 $(WORK
)/kernel.img
: $(WORK
)/zImage-
$(KERNEL_VERSION
)
42 wget
--no-check-certificate
-P
$(WORK
) https
://raw.github.com
/raspberrypi
/tools
/master
/mkimage
/imagetool-uncompressed.py
43 wget
--no-check-certificate
-P
$(WORK
) https
://github.com
/raspberrypi
/tools
/raw
/master
/mkimage
/first32k.bin
44 wget
--no-check-certificate
-P
$(WORK
) https
://github.com
/raspberrypi
/tools
/raw
/master
/mkimage
/boot-uncompressed.txt
45 wget
--no-check-certificate
-P
$(WORK
) https
://github.com
/raspberrypi
/tools
/raw
/master
/mkimage
/args-uncompressed.txt
47 python imagetool-uncompressed.py zImage-
$(KERNEL_VERSION
)
49 image
: $(WORK
)/kernel.img
52 rm -vf
$(WORK
)/zImage-
$(KERNEL_VERSION
) $(WORK
)/kernel.img
54 image-distclean
: image-clean
55 rm -vrf
$(WORK
)/linux-
$(KERNEL_VERSION
) $(WORK
)/linux-
$(KERNEL_VERSION
).
tar.bz2
56 rm -vf
$(WORK
)/imagetool-uncompressed.py
$(WORK
)/first32k.bin
$(WORK
)/boot-uncompressed.txt
$(WORK
)/args-uncompressed.txt
58 $(WORK
)/modules-
$(KERNEL_VERSION
): $(WORK
)/linux-
$(KERNEL_VERSION
)
59 cd
$(WORK
)/linux-
$(KERNEL_VERSION
) && \
60 export PATH
=$(CROSSTOOLS
)/bin
:$$PATH && \
61 export LD_LIBRARY_PATH
=$(LD_LIBRARY_PATH
)/lib
:$$LD_LIBRARY_PATH && \
62 make ARCH
=arm CROSS_COMPILE
=$(TARGET
)- modules
&& \
63 make ARCH
=arm CROSS_COMPILE
=$(TARGET
)- INSTALL_MOD_PATH
=$(WORK
)/modules-
$(KERNEL_VERSION
) modules_install
64 rm -f
$(WORK
)/modules-
$(KERNEL_VERSION
)/lib
/modules
/$(KERNEL_VERSION
)/{source
,build
}
65 touch
$(WORK
)/modules-
$(KERNEL_VERSION
)
67 modules
: $(WORK
)/modules-
$(KERNEL_VERSION
)
70 rm -vrf
$(WORK
)/modules-
$(KERNEL_VERSION
)
72 modules-distclean
: modules-clean
74 $(WORK
)/System.map-
$(KERNEL_VERSION
): $(WORK
)/linux-
$(KERNEL_VERSION
)
75 cp
$(WORK
)/linux-
$(KERNEL_VERSION
)/System.map
$(WORK
)/System.map-
$(KERNEL_VERSION
)
76 touch
$(WORK
)/System.map-
$(KERNEL_VERSION
)
78 map
: $(WORK
)/System.map-
$(KERNEL_VERSION
)
81 rm -vrf
$(WORK
)/System.map-
$(KERNEL_VERSION
)
83 map-distclean
: map-clean
85 config
: $(WORK
)/linux-
$(KERNEL_VERSION
)
86 cd
$(WORK
)/linux-
$(KERNEL_VERSION
) && \
87 export PATH
=$(CROSSTOOLS
)/bin
:$$PATH && \
88 export LD_LIBRARY_PATH
=$(CROSSTOOLS
)/lib
:$$LD_LIBRARY_PATH && \
89 make ARCH
=arm CROSS_COMPILE
=$(TARGET
)- menuconfig
90 touch
$(WORK
)/linux-
$(KERNEL_VERSION
)