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.mk
6 include $(ADK_TOPDIR
)/mk
/modules.mk
7 include $(ADK_TOPDIR
)/mk
/kernel-build.mk
8 include $(ADK_TOPDIR
)/mk
/image.mk
10 KERNEL
:=$(LINUX_DIR
)/$(ADK_TARGET_KERNEL
)
11 OSTRIP
:=-R .reginfo
-R .notes
-R .note
-R .comment
-R .mdebug
-R .note.gnu.build-id
14 QEMU_ARGS
+=${ADK_QEMU_ARGS}
15 QEMU_ARGS
+=-device e1000
,netdev
=adk0
-netdev user
,id
=adk0
18 ifeq ($(ADK_TARGET_FS
),archive
)
20 @echo
"The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
21 ifeq ($(ADK_TARGET_QEMU
),y
)
22 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
23 @echo
"Use following command to create a QEMU Image:"
24 @echo
"./scripts/create.sh qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
25 @echo
"Start qemu with following options:"
26 @echo
'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${ADK_TARGET_CPU_ARCH}.img'
28 ifeq ($(ADK_TARGET_SYSTEM_MIKROTIK_RB532
),y
)
29 @echo
"Use following command to install it on CF card:"
30 @echo
"sudo ./scripts/install-rb532.sh /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
31 @echo
'Or boot your Routerboard via NFS and'
32 @echo
'then install kernel and filesystem via:'
33 @echo
'adkinstall -c -a ${ROOTFSTARBALL}'
36 ifeq ($(ADK_TARGET_FS
),initramfs
)
38 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
39 @echo
'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
40 ifeq ($(ADK_TARGET_QEMU
),y
)
41 @echo
"Start qemu with following command line:"
42 @echo
'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
45 ifeq ($(ADK_TARGET_FS
),initramfsarchive
)
47 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
48 @echo
"The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
50 ifeq ($(ADK_TARGET_FS
),initramfspiggyback
)
52 @echo
'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
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)'
58 ifeq ($(ADK_TARGET_FS
),nfsroot
)
60 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
61 @echo
'The nfs root tarball is: ${FW_DIR}/${ROOTFSUSERTARBALL}'
63 ifeq ($(ADK_TARGET_FS
),usb
)
65 @echo
'The root tarball is: ${FW_DIR}/${ROOTFSTARBALL}'
67 ifeq ($(ADK_TARGET_FS
),yaffs
)
69 @echo
'The root tarball is: ${FW_DIR}/${ROOTFSTARBALL}'
70 @echo
'Format your NAND with Routerboot, boot via NFS and'
71 @echo
'then install kernel and filesystem via:'
72 @echo
'adkinstall -n -a ${ROOTFSTARBALL}'
75 # image creation and kernel install
77 $(TARGET_CROSS
)objcopy
$(OSTRIP
) -S
$(KERNEL
) $(BUILD_DIR
)/$(TARGET_KERNEL
)
79 kernel-install
: kernel-strip
80 @cp
$(BUILD_DIR
)/$(TARGET_KERNEL
) $(FW_DIR
)/${TARGET_KERNEL}
82 # filesystem specific targets
83 ifeq ($(ADK_TARGET_FS
),archive
)
84 imageinstall
: $(FW_DIR
)/$(ROOTFSTARBALL
) targethelp
86 ifeq ($(ADK_TARGET_FS
),initramfs
)
87 imageinstall
: kernel-install
$(FW_DIR
)/$(INITRAMFS
) targethelp
89 ifeq ($(ADK_TARGET_FS
),initramfsarchive
)
90 imageinstall
: kernel-install
$(FW_DIR
)/$(ROOTFSUSERTARBALL
) targethelp
92 ifeq ($(ADK_TARGET_FS
),initramfspiggyback
)
93 imageinstall
: createinitramfs targethelp
95 ifeq ($(ADK_TARGET_FS
),nfsroot
)
96 imageinstall
: kernel-install
$(FW_DIR
)/$(ROOTFSUSERTARBALL
) targethelp
98 ifeq ($(ADK_TARGET_FS
),yaffs
)
99 imageinstall
: $(FW_DIR
)/$(ROOTFSTARBALL
) targethelp