fix formatting
[openadk.git] / target / mips64 / Makefile
blob37cc8ff586cdb93518f1636f7e62906d03e8a642
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),usb)
32 targethelp:
33 @echo 'The root tarball is: ${FW_DIR}/${ROOTFSTARBALL}'
34 ifeq ($(ADK_TARGET_SYSTEM_LEMOTE_YEELONG),y)
35 @echo "Startup the netbook and type del to enter PMON:"
36 @echo "PMON> load /dev/fs/ext2@usb0/boot/kernel"
37 @echo "PMON> g"
38 endif
39 endif
40 ifeq ($(ADK_TARGET_FS),archive)
41 targethelp:
42 @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
43 ifeq ($(ADK_TARGET_QEMU),y)
44 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
45 @echo "Use following command to create a QEMU Image:"
46 @echo "./scripts/create.sh qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
47 @echo "Start qemu with following options:"
48 @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${ADK_TARGET_CPU_ARCH}.img'
49 endif
50 ifeq ($(ADK_TARGET_SYSTEM_LEMOTE_YEELONG),y)
51 @echo "Startup the Lemote Yeelong and type del to enter PMON:"
52 @echo "PMON> load /dev/fs/ext2@wd0a/boot/kernel"
53 @echo "PMON> g root=/dev/sda1"
54 endif
55 endif
56 ifeq ($(ADK_TARGET_FS),initramfsarchive)
57 targethelp:
58 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
59 @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
60 endif
61 ifeq ($(ADK_TARGET_FS),initramfs)
62 targethelp:
63 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
64 @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
65 ifeq ($(ADK_TARGET_QEMU),y)
66 @echo "Start qemu with following command line:"
67 @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
68 endif
69 endif
70 ifeq ($(ADK_TARGET_FS),initramfspiggyback)
71 targethelp:
72 @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
73 ifeq ($(ADK_TARGET_QEMU),y)
74 @echo "Start qemu with following command line:"
75 @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
76 endif
77 endif
79 # image creation and kernel install
80 kernel-strip:
81 $(TARGET_CROSS)objcopy $(OSTRIP) -S $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
83 kernel-install: kernel-strip
84 @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/${TARGET_KERNEL}
86 # filesystem specific targets
87 ifeq ($(ADK_TARGET_FS),nfsroot)
88 imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
89 endif
90 ifeq ($(ADK_TARGET_FS),archive)
91 imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
92 endif
93 ifeq ($(ADK_TARGET_FS),initramfsarchive)
94 imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
95 endif
96 ifeq ($(ADK_TARGET_FS),initramfs)
97 imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
98 endif
99 ifeq ($(ADK_TARGET_FS),initramfspiggyback)
100 imageinstall: createinitramfs targethelp
101 endif
102 ifeq ($(ADK_TARGET_FS),usb)
103 imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
104 endif