linux: update kernels to latest LTS
[openadk.git] / target / mips / Makefile
blob2255ffa42947770cb2395d7ee6777ada613f6baf
1 # This file is part of the OpenADK project. OpenADK is copyrighted
2 # material, please see the LICENCE file in the top-level directory.
4 include $(ADK_TOPDIR)/rules.mk
5 include $(ADK_TOPDIR)/mk/kernel-build.mk
6 include $(ADK_TOPDIR)/mk/image.mk
8 KERNEL:=$(LINUX_DIR)/$(ADK_TARGET_KERNEL)
9 ifeq ($(ADK_TARGET_KERNEL_UIMAGE),y)
10 KERNEL:=$(LINUX_DIR)/arch/mips/boot/uImage
11 endif
12 ifeq ($(ADK_TARGET_KERNEL_UIMAGEGZ),y)
13 KERNEL:=$(LINUX_DIR)/arch/mips/boot/uImage.gz
14 endif
16 OSTRIP:=-R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id
18 QEMU_ARGS:=-M malta
19 QEMU_ARGS+=${ADK_QEMU_ARGS}
20 QEMU_ARGS+=-device e1000,netdev=adk0 -netdev user,id=adk0
22 ifeq ($(ADK_TARGET_CPU_MIPS_MIPS32R6),y)
23 QEMU_ARGS+=-cpu mips32r6-generic
24 endif
26 # target helper text
27 ifeq ($(ADK_TARGET_FS),archive)
28 targethelp:
29 @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
30 ifeq ($(ADK_TARGET_QEMU),y)
31 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
32 @echo "Use following command to create a QEMU Image:"
33 @echo "./scripts/create.sh qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
34 @echo "Start qemu with following options:"
35 @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${ADK_TARGET_CPU_ARCH}.img'
36 endif
37 ifeq ($(ADK_TARGET_SYSTEM_MIKROTIK_RB532),y)
38 @echo "Use following command to install it on CF card:"
39 @echo "sudo ./scripts/install-rb532.sh /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
40 @echo 'Or boot your Routerboard via NFS and'
41 @echo 'then install kernel and filesystem via:'
42 @echo 'adkinstall -c -a ${ROOTFSTARBALL}'
43 endif
44 ifeq ($(ADK_TARGET_SYSTEM_IMGTEC_CI20),y)
45 @echo "Use following command to install it on SD card:"
46 @echo "sudo ./scripts/install.sh $(ADK_TARGET_SYSTEM) /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
47 endif
48 endif
49 ifeq ($(ADK_TARGET_FS),initramfs)
50 targethelp:
51 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
52 @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
53 ifeq ($(ADK_TARGET_QEMU),y)
54 @echo "Start qemu with following command line:"
55 @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
56 endif
57 endif
58 ifeq ($(ADK_TARGET_FS),initramfsarchive)
59 targethelp:
60 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
61 @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
62 endif
63 ifeq ($(ADK_TARGET_FS),initramfspiggyback)
64 targethelp:
65 @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
66 ifeq ($(ADK_TARGET_QEMU),y)
67 @echo "Start qemu with following command line:"
68 @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
69 endif
70 endif
71 ifeq ($(ADK_TARGET_FS),nfsroot)
72 targethelp:
73 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
74 @echo 'The nfs root tarball is: ${FW_DIR}/${ROOTFSUSERTARBALL}'
75 endif
76 ifeq ($(ADK_TARGET_FS),usb)
77 targethelp:
78 @echo 'The root tarball is: ${FW_DIR}/${ROOTFSTARBALL}'
79 endif
80 ifeq ($(ADK_TARGET_FS),genimage)
81 targethelp:
82 @echo "The disk image is: $(FW_DIR)/sdcard.img"
83 ifeq ($(ADK_TARGET_QEMU),y)
84 @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} $(FW_DIR)/disk.img'
85 else
86 @echo "Use following command to install it on SD card:"
87 @echo 'sudo dd if=$(FW_DIR)/sdcard.img of=/dev/sdX bs=2048k'
88 endif
89 endif
90 ifeq ($(ADK_TARGET_FS),ubifs)
91 targethelp:
92 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
93 @echo 'The UBI image is: ${FW_DIR}/${ROOTFSUBIFS}'
94 endif
96 # dummy
97 kernel-strip:
98 @cp $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
100 kernel-install: kernel-strip
101 @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/${TARGET_KERNEL}
103 # filesystem specific targets
104 ifeq ($(ADK_TARGET_FS),archive)
105 imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
106 endif
107 ifeq ($(ADK_TARGET_FS),initramfs)
108 imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
109 endif
110 ifeq ($(ADK_TARGET_FS),initramfsarchive)
111 imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
112 endif
113 ifeq ($(ADK_TARGET_FS),initramfspiggyback)
114 imageinstall: createinitramfs targethelp
115 endif
116 ifeq (${ADK_TARGET_FS},genimage)
117 imageinstall: ${FW_DIR}/${GENIMAGE} targethelp
118 endif
119 ifeq ($(ADK_TARGET_FS),nfsroot)
120 imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
121 endif
122 ifeq ($(ADK_TARGET_FS),ubifs)
123 imageinstall: $(FW_DIR)/$(ROOTFSUBIFS) targethelp
124 endif