remove duplicate package
[openadk.git] / target / mips / Makefile
blobdb66205bdbb6e76e6404bd505b4c452945d7a276
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 mips32r6-generic
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 ifeq ($(ADK_TARGET_SYSTEM_IMGTEC_CI20),y)
42 @echo "Use following command to install it on SD card:"
43 @echo "sudo ./scripts/install.sh $(ADK_TARGET_SYSTEM) /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
44 endif
45 endif
46 ifeq ($(ADK_TARGET_FS),initramfs)
47 targethelp:
48 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
49 @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
50 ifeq ($(ADK_TARGET_QEMU),y)
51 @echo "Start qemu with following command line:"
52 @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
53 endif
54 endif
55 ifeq ($(ADK_TARGET_FS),initramfsarchive)
56 targethelp:
57 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
58 @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
59 endif
60 ifeq ($(ADK_TARGET_FS),initramfspiggyback)
61 targethelp:
62 @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
63 ifeq ($(ADK_TARGET_QEMU),y)
64 @echo "Start qemu with following command line:"
65 @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
66 endif
67 endif
68 ifeq ($(ADK_TARGET_FS),nfsroot)
69 targethelp:
70 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
71 @echo 'The nfs root tarball is: ${FW_DIR}/${ROOTFSUSERTARBALL}'
72 endif
73 ifeq ($(ADK_TARGET_FS),usb)
74 targethelp:
75 @echo 'The root tarball is: ${FW_DIR}/${ROOTFSTARBALL}'
76 endif
77 ifeq ($(ADK_TARGET_FS),genimage)
78 targethelp:
79 @echo "The disk image is: $(FW_DIR)/disk.img"
80 ifeq ($(ADK_TARGET_QEMU),y)
81 @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} $(FW_DIR)/disk.img'
82 else
83 @echo "Use following command to install it on SD card:"
84 @echo 'sudo dd if=$(FW_DIR)/disk.img of=/dev/sdX bs=2048k'
85 endif
86 endif
87 ifeq ($(ADK_TARGET_FS),ubifs)
88 targethelp:
89 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
90 @echo 'The UBI image is: ${FW_DIR}/${ROOTFSUBIFS}'
91 endif
93 # image creation and kernel install
94 kernel-strip:
95 ifeq ($(ADK_TARGET_KERNEL_UIMAGE),)
96 $(TARGET_CROSS)objcopy $(OSTRIP) -S $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
97 else
98 @cp $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
99 endif
101 kernel-install: kernel-strip
102 @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/${TARGET_KERNEL}
104 # filesystem specific targets
105 ifeq ($(ADK_TARGET_FS),archive)
106 imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
107 endif
108 ifeq ($(ADK_TARGET_FS),initramfs)
109 imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
110 endif
111 ifeq ($(ADK_TARGET_FS),initramfsarchive)
112 imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
113 endif
114 ifeq ($(ADK_TARGET_FS),initramfspiggyback)
115 imageinstall: createinitramfs targethelp
116 endif
117 ifeq (${ADK_TARGET_FS},genimage)
118 imageinstall: ${FW_DIR}/${GENIMAGE} targethelp
119 endif
120 ifeq ($(ADK_TARGET_FS),nfsroot)
121 imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
122 endif
123 ifeq ($(ADK_TARGET_FS),ubifs)
124 imageinstall: $(FW_DIR)/$(ROOTFSUBIFS) targethelp
125 endif