5 include ..
/..
/toolchain-aarch64
/vars.mk
7 TARGET
= aarch64-crux-linux-gnueabi
11 CROSSTOOLS
= $(PWD
)/..
/..
/toolchain-aarch64
/crosstools
13 KERNEL_VERSION
= 4.1.1
15 .PHONY
: all clean image modules map config
17 all: image modules map
19 clean: image-clean modules-clean map-clean
21 distclean: clean image-distclean modules-distclean map-distclean
23 $(WORK
)/linux-
$(KERNEL_VERSION
).
tar.xz
:
24 wget
-P
$(WORK
) ftp
://ftp.kernel.org
/pub
/linux
/kernel
/v4.x
/linux-
$(KERNEL_VERSION
).
tar.xz
26 $(WORK
)/linux-
$(KERNEL_VERSION
): $(WORK
)/linux-
$(KERNEL_VERSION
).
tar.xz config-
$(KERNEL_VERSION
)
27 tar -C
$(WORK
) -xvf
$(WORK
)/linux-
$(KERNEL_VERSION
).
tar.xz
28 sed
-e
's|LINUX_COMPILE_BY=.*|LINUX_COMPILE_BY=devel|g' -e
's|`hostname`|crux-arm.nu|g' -i
$(WORK
)/linux-
$(KERNEL_VERSION
)/scripts
/mkcompile_h
29 cd
$(WORK
)/linux-
$(KERNEL_VERSION
) && \
31 cp
-v
$(PWD
)/config-
$(KERNEL_VERSION
) .config
&& \
32 touch
$(WORK
)/linux-
$(KERNEL_VERSION
)
34 $(WORK
)/Image-
$(KERNEL_VERSION
): $(WORK
)/linux-
$(KERNEL_VERSION
)
35 cd
$(WORK
)/linux-
$(KERNEL_VERSION
) && \
36 export PATH
=$(CROSSTOOLS
)/bin
:$$PATH && \
37 export LD_LIBRARY_PATH
=$(CROSSTOOLS
)/lib
:$$LD_LIBRARY_PATH && \
38 make ARCH
=arm64 CROSS_COMPILE
=$(TARGET
)- $(MJ
) Image
39 cp
-v
$(WORK
)/linux-
$(KERNEL_VERSION
)/arch
/arm64
/boot
/Image
$(WORK
)/Image-
$(KERNEL_VERSION
)
40 touch
$(WORK
)/Image-
$(KERNEL_VERSION
)
42 image
: $(WORK
)/Image-
$(KERNEL_VERSION
)
45 rm -vrf
$(WORK
)/linux-
$(KERNEL_VERSION
) $(WORK
)/Image-
$(KERNEL_VERSION
)
47 image-distclean
: image-clean
49 $(WORK
)/modules-
$(KERNEL_VERSION
): $(WORK
)/linux-
$(KERNEL_VERSION
)
50 cd
$(WORK
)/linux-
$(KERNEL_VERSION
) && \
51 export PATH
=$(CROSSTOOLS
)/bin
:$$PATH && \
52 export LD_LIBRARY_PATH
=$(LD_LIBRARY_PATH
)/lib
:$$LD_LIBRARY_PATH && \
53 make ARCH
=arm64 CROSS_COMPILE
=$(TARGET
)- modules
&& \
54 make ARCH
=arm64 CROSS_COMPILE
=$(TARGET
)- INSTALL_MOD_PATH
=$(WORK
)/modules-
$(KERNEL_VERSION
) modules_install
55 rm -f
$(WORK
)/modules-
$(KERNEL_VERSION
)/lib
/modules
/$(KERNEL_VERSION
)/{source
,build
}
56 touch
$(WORK
)/modules-
$(KERNEL_VERSION
)
58 $(WORK
)/modules-
$(KERNEL_VERSION
).
tar.xz
: $(WORK
)/modules-
$(KERNEL_VERSION
)
59 cd
$(WORK
)/modules-
$(KERNEL_VERSION
) && \
60 tar cvJf
$(WORK
)/modules-
$(KERNEL_VERSION
).
tar.xz
*
61 touch
$(WORK
)/modules-
$(KERNEL_VERSION
).
tar.xz
63 modules
: $(WORK
)/modules-
$(KERNEL_VERSION
).
tar.xz
66 rm -vrf
$(WORK
)/modules-
$(KERNEL_VERSION
) $(WORK
)/modules-
$(KERNEL_VERSION
).
tar.xz
68 modules-distclean
: modules-clean
70 $(WORK
)/System.map-
$(KERNEL_VERSION
): $(WORK
)/linux-
$(KERNEL_VERSION
)
71 cp
$(WORK
)/linux-
$(KERNEL_VERSION
)/System.map
$(WORK
)/System.map-
$(KERNEL_VERSION
)
72 touch
$(WORK
)/System.map-
$(KERNEL_VERSION
)
74 map
: $(WORK
)/System.map-
$(KERNEL_VERSION
)
77 rm -vrf
$(WORK
)/System.map-
$(KERNEL_VERSION
)
79 map-distclean
: map-clean
81 config
: $(WORK
)/linux-
$(KERNEL_VERSION
)
82 cd
$(WORK
)/linux-
$(KERNEL_VERSION
) && \
83 export PATH
=$(CROSSTOOLS
)/bin
:$$PATH && \
84 export LD_LIBRARY_PATH
=$(CROSSTOOLS
)/lib
:$$LD_LIBRARY_PATH && \
85 make ARCH
=arm64 CROSS_COMPILE
=$(TARGET
)- menuconfig
86 touch
$(WORK
)/linux-
$(KERNEL_VERSION
)