j2: update binutils patch in a hackish way, need to recheck on hardware
[openadk.git] / target / mips64 / Makefile
blobae50d23444a4b5f0da7160e636db308ad5713807
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 OSTRIP:=-R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id
11 QEMU_ARGS:=-M malta
12 QEMU_ARGS+=${ADK_QEMU_ARGS}
13 QEMU_ARGS+=-device e1000,netdev=adk0 -netdev user,id=adk0
15 ifeq ($(ADK_TARGET_CPU_MIPS64_MIPS64R6),y)
16 QEMU_ARGS+=-cpu I6400
17 endif
19 # target helper text
20 ifeq ($(ADK_TARGET_FS),nfsroot)
21 targethelp:
22 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
23 @echo 'The nfs root tarball is: ${FW_DIR}/${ROOTFSUSERTARBALL}'
24 ifeq ($(ADK_TARGET_SYSTEM_LEMOTE_YEELONG),y)
25 @echo 'Boot your Lemote Yeelong and type following commands in PMON:'
26 @echo 'PMON> ifaddr rtl0 <ip-address-client>'
27 @echo 'PMON> load tftp://<ip-address-server>/${TARGET_KERNEL}'
28 @echo 'PMON> g'
29 endif
30 endif
31 ifeq ($(ADK_TARGET_FS),yaffs)
32 targethelp:
33 @echo 'The root tarball is: ${FW_DIR}/${ROOTFSTARBALL}'
34 @echo 'Format your NAND with Routerboot, boot via NFS and'
35 @echo 'then install kernel and filesystem via:'
36 @echo 'adkinstall ${ROOTFSTARBALL}'
37 endif
38 ifeq ($(ADK_TARGET_FS),usb)
39 targethelp:
40 @echo 'The root tarball is: ${FW_DIR}/${ROOTFSTARBALL}'
41 ifeq ($(ADK_TARGET_SYSTEM_LEMOTE_YEELONG),y)
42 @echo "Startup the netbook and type del to enter PMON:"
43 @echo "PMON> load /dev/fs/ext2@usb0/boot/kernel"
44 @echo "PMON> g"
45 endif
46 endif
47 ifeq ($(ADK_TARGET_FS),archive)
48 targethelp:
49 @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
50 ifeq ($(ADK_TARGET_QEMU),y)
51 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
52 @echo "Use following command to create a QEMU Image:"
53 @echo "./scripts/create.sh qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
54 @echo "Start qemu with following options:"
55 @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${ADK_TARGET_CPU_ARCH}.img'
56 endif
57 ifeq ($(ADK_TARGET_SYSTEM_LEMOTE_YEELONG),y)
58 @echo "Startup the Lemote Yeelong and type del to enter PMON:"
59 @echo "PMON> load /dev/fs/ext2@wd0a/boot/kernel"
60 @echo "PMON> g root=/dev/sda1"
61 endif
62 endif
63 ifeq ($(ADK_TARGET_FS),initramfsarchive)
64 targethelp:
65 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
66 @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
67 endif
68 ifeq ($(ADK_TARGET_FS),initramfs)
69 targethelp:
70 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
71 @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
72 ifeq ($(ADK_TARGET_QEMU),y)
73 @echo "Start qemu with following command line:"
74 @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
75 endif
76 endif
77 ifeq ($(ADK_TARGET_FS),initramfspiggyback)
78 targethelp:
79 @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
80 ifeq ($(ADK_TARGET_QEMU),y)
81 @echo "Start qemu with following command line:"
82 @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
83 endif
84 endif
86 # image creation and kernel install
87 kernel-strip:
88 $(TARGET_CROSS)objcopy $(OSTRIP) -S $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
90 kernel-install: kernel-strip
91 @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/${TARGET_KERNEL}
93 # filesystem specific targets
94 ifeq ($(ADK_TARGET_FS),nfsroot)
95 imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
96 endif
97 ifeq ($(ADK_TARGET_FS),archive)
98 imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
99 endif
100 ifeq ($(ADK_TARGET_FS),initramfsarchive)
101 imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
102 endif
103 ifeq ($(ADK_TARGET_FS),initramfs)
104 imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
105 endif
106 ifeq ($(ADK_TARGET_FS),initramfspiggyback)
107 imageinstall: createinitramfs targethelp
108 endif
109 ifeq ($(ADK_TARGET_FS),usb)
110 imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
111 endif