drop yaffs2 support
[openadk.git] / target / mips / Makefile
blobcb4a32432dd96487048eb8bd7f46dd80dda34b14
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
13 OSTRIP:=-R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id
15 QEMU_ARGS:=-M malta
16 QEMU_ARGS+=${ADK_QEMU_ARGS}
17 QEMU_ARGS+=-device e1000,netdev=adk0 -netdev user,id=adk0
19 ifeq ($(ADK_TARGET_CPU_MIPS_MIPS32R6),y)
20 QEMU_ARGS+=-cpu P5600
21 endif
23 # target helper text
24 ifeq ($(ADK_TARGET_FS),archive)
25 targethelp:
26 @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
27 ifeq ($(ADK_TARGET_QEMU),y)
28 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
29 @echo "Use following command to create a QEMU Image:"
30 @echo "./scripts/create.sh qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
31 @echo "Start qemu with following options:"
32 @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${ADK_TARGET_CPU_ARCH}.img'
33 endif
34 ifeq ($(ADK_TARGET_SYSTEM_MIKROTIK_RB532),y)
35 @echo "Use following command to install it on CF card:"
36 @echo "sudo ./scripts/install-rb532.sh /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
37 @echo 'Or boot your Routerboard via NFS and'
38 @echo 'then install kernel and filesystem via:'
39 @echo 'adkinstall -c -a ${ROOTFSTARBALL}'
40 endif
41 endif
42 ifeq ($(ADK_TARGET_FS),initramfs)
43 targethelp:
44 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
45 @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
46 ifeq ($(ADK_TARGET_QEMU),y)
47 @echo "Start qemu with following command line:"
48 @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
49 endif
50 endif
51 ifeq ($(ADK_TARGET_FS),initramfsarchive)
52 targethelp:
53 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
54 @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
55 endif
56 ifeq ($(ADK_TARGET_FS),initramfspiggyback)
57 targethelp:
58 @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
59 ifeq ($(ADK_TARGET_QEMU),y)
60 @echo "Start qemu with following command line:"
61 @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
62 endif
63 endif
64 ifeq ($(ADK_TARGET_FS),nfsroot)
65 targethelp:
66 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
67 @echo 'The nfs root tarball is: ${FW_DIR}/${ROOTFSUSERTARBALL}'
68 endif
69 ifeq ($(ADK_TARGET_FS),usb)
70 targethelp:
71 @echo 'The root tarball is: ${FW_DIR}/${ROOTFSTARBALL}'
72 endif
73 ifeq ($(ADK_TARGET_FS),genimage)
74 targethelp:
75 @echo "The disk image is: $(FW_DIR)/disk.img"
76 ifeq ($(ADK_TARGET_QEMU),y)
77 @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} $(FW_DIR)/disk.img'
78 else
79 @echo "Use following command to install it on SD card:"
80 @echo 'sudo dd if=$(FW_DIR)/disk.img of=/dev/sdX bs=2048k'
81 endif
82 endif
83 ifeq ($(ADK_TARGET_FS),ubifs)
84 targethelp:
85 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
86 @echo 'The UBI image is: ${FW_DIR}/${ROOTFSUBIFS}'
87 endif
89 # image creation and kernel install
90 kernel-strip:
91 ifeq ($(ADK_TARGET_KERNEL_UIMAGE),)
92 $(TARGET_CROSS)objcopy $(OSTRIP) -S $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
93 else
94 @cp $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
95 endif
97 kernel-install: kernel-strip
98 @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/${TARGET_KERNEL}
100 # filesystem specific targets
101 ifeq ($(ADK_TARGET_FS),archive)
102 imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
103 endif
104 ifeq ($(ADK_TARGET_FS),initramfs)
105 imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
106 endif
107 ifeq ($(ADK_TARGET_FS),initramfsarchive)
108 imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
109 endif
110 ifeq ($(ADK_TARGET_FS),initramfspiggyback)
111 imageinstall: createinitramfs targethelp
112 endif
113 ifeq (${ADK_TARGET_FS},genimage)
114 imageinstall: ${FW_DIR}/${GENIMAGE} targethelp
115 endif
116 ifeq ($(ADK_TARGET_FS),nfsroot)
117 imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
118 endif
119 ifeq ($(ADK_TARGET_FS),ubifs)
120 imageinstall: $(FW_DIR)/$(ROOTFSUBIFS) targethelp
121 endif