Commit | Line | Data |
---|---|---|
cacea90b VM |
1 | # |
2 | # src/kernel/Makefile | |
3 | # | |
4 | ||
5 | TARGET = arm-crux-linux-gnueabi | |
6 | ||
0aa7f5eb | 7 | PWD = $(shell pwd) |
cacea90b | 8 | WORK = $(PWD)/work |
0aa7f5eb | 9 | CROSSTOOLS = $(PWD)/../../toolchain/crosstools |
cacea90b | 10 | |
c41a11ef | 11 | KERNEL_VERSION = 2.6.31.14.27-efikamx_20111026 |
cacea90b VM |
12 | |
13 | .PHONY: all clean image modules map config | |
14 | ||
15 | all: image modules map | |
16 | ||
17 | clean: image-clean modules-clean map-clean | |
18 | ||
19 | distclean: clean image-distclean modules-distclean map-distclean | |
cacea90b VM |
20 | |
21 | $(WORK)/linux-$(KERNEL_VERSION).tar.bz2: | |
22 | wget -P $(WORK) http://crux-arm.nu/files/distfiles/efikamx/linux-$(KERNEL_VERSION).tar.bz2 | |
23 | ||
0aa7f5eb | 24 | $(WORK)/linux-$(KERNEL_VERSION): $(WORK)/linux-$(KERNEL_VERSION).tar.bz2 $(PWD)/config-$(KERNEL_VERSION) |
cacea90b | 25 | tar -C $(WORK) -xvjf $(WORK)/linux-$(KERNEL_VERSION).tar.bz2 |
7928605d VM |
26 | cd $(WORK) && \ |
27 | patch -p1 -i $(WORK)/Makefile_arm_unaligned.diff | |
0aa7f5eb | 28 | cp -v $(PWD)/config-$(KERNEL_VERSION) $(WORK)/linux-$(KERNEL_VERSION)/.config |
cacea90b VM |
29 | touch $(WORK)/linux-$(KERNEL_VERSION) |
30 | ||
0aa7f5eb | 31 | $(WORK)/zImage-$(KERNEL_VERSION): $(WORK)/linux-$(KERNEL_VERSION) |
cacea90b | 32 | cd $(WORK)/linux-$(KERNEL_VERSION) && \ |
0aa7f5eb | 33 | export PATH=$(CROSSTOOLS)/bin:$$PATH && \ |
cacea90b | 34 | export LD_LIBRARY_PATH=$(CROSSTOOLS)/lib:$$LD_LIBRARY_PATH && \ |
7928605d | 35 | make zImage ARCH=arm CROSS_COMPILE=$(TARGET)- |
0aa7f5eb JB |
36 | cp -v $(WORK)/linux-$(KERNEL_VERSION)/arch/arm/boot/zImage $(WORK)/zImage-$(KERNEL_VERSION) |
37 | ln -sf zImage-$(KERNEL_VERSION) $(WORK)/zImage | |
38 | touch $(WORK)/zImage-$(KERNEL_VERSION) | |
cacea90b | 39 | |
0aa7f5eb | 40 | image: $(WORK)/zImage-$(KERNEL_VERSION) |
cacea90b VM |
41 | |
42 | image-clean: | |
0aa7f5eb | 43 | rm -vf $(WORK)/zImage-$(KERNEL_VERSION) |
cacea90b VM |
44 | |
45 | image-distclean: image-clean | |
0aa7f5eb | 46 | rm -vrf $(WORK)/linux-$(KERNEL_VERSION) $(WORK)/linux-$(KERNEL_VERSION).tar.bz2 |
cacea90b VM |
47 | |
48 | $(WORK)/modules-$(KERNEL_VERSION): $(WORK)/linux-$(KERNEL_VERSION) | |
49 | cd $(WORK)/linux-$(KERNEL_VERSION) && \ | |
50 | export PATH=$(CROSSTOOLS)/bin:$$PATH && \ | |
51 | export LD_LIBRARY_PATH=$(LD_LIBRARY_PATH)/lib:$$LD_LIBRARY_PATH && \ | |
52 | make ARCH=arm CROSS_COMPILE=$(TARGET)- modules && \ | |
53 | make ARCH=arm CROSS_COMPILE=$(TARGET)- INSTALL_MOD_PATH=$(WORK)/modules-$(KERNEL_VERSION) modules_install | |
54 | rm -f $(WORK)/modules-$(KERNEL_VERSION)/lib/modules/$(KERNEL_VERSION)/{source,build} | |
55 | touch $(WORK)/modules-$(KERNEL_VERSION) | |
56 | ||
57 | modules: $(WORK)/modules-$(KERNEL_VERSION) | |
58 | ||
59 | modules-clean: | |
60 | rm -vrf $(WORK)/modules-$(KERNEL_VERSION) | |
61 | ||
62 | modules-distclean: modules-clean | |
63 | ||
64 | $(WORK)/System.map-$(KERNEL_VERSION): $(WORK)/linux-$(KERNEL_VERSION) | |
65 | cp $(WORK)/linux-$(KERNEL_VERSION)/System.map $(WORK)/System.map-$(KERNEL_VERSION) | |
66 | touch $(WORK)/System.map-$(KERNEL_VERSION) | |
67 | ||
68 | map: $(WORK)/System.map-$(KERNEL_VERSION) | |
69 | ||
70 | map-clean: | |
71 | rm -vrf $(WORK)/System.map-$(KERNEL_VERSION) | |
72 | ||
73 | map-distclean: map-clean | |
74 | ||
75 | config: $(WORK)/linux-$(KERNEL_VERSION) | |
76 | cd $(WORK)/linux-$(KERNEL_VERSION) && \ | |
77 | export PATH=$(CROSSTOOLS)/bin:$$PATH && \ | |
78 | export LD_LIBRARY_PATH=$(CROSSTOOLS)/lib:$$LD_LIBRARY_PATH && \ | |
79 | make ARCH=arm CROSS_COMPILE=$(TARGET)- menuconfig | |
80 | touch $(WORK)/linux-$(KERNEL_VERSION) | |
81 | ||
82 | # End of file |