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 OSTRIP
:=-R .reginfo
-R .notes
-R .note
-R .comment
-R .mdebug
9 OSTRIP
+=-R .note.gnu.build-id
-K sun4u_init
-K _end
-K _start
11 KERNEL
:=$(LINUX_DIR
)/vmlinux
12 ifeq ($(ADK_TARGET_KERNEL_ZIMAGE
),y
)
13 KERNEL
:=$(LINUX_DIR
)/arch
/sparc
/boot
/zImage
15 ifeq ($(ADK_TARGET_KERNEL_VMLINUX_AOUT
),y
)
16 KERNEL
:=$(LINUX_DIR
)/arch
/sparc
/boot
/image
20 QEMU_ARGS
+=${ADK_QEMU_ARGS}
21 ifeq ($(ADK_TARGET_FS
),archive
)
22 QEMU_ARGS
+=-append
"root=/dev/sda1"
26 ifeq ($(ADK_TARGET_FS
),archive
)
28 @echo
"The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
29 ifeq ($(ADK_TARGET_QEMU
),y
)
30 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
31 @echo
"Use following command to create a QEMU Image:"
32 @echo
"./scripts/create.sh qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
33 @echo
"Start qemu with following options:"
34 @echo
'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${ADK_TARGET_CPU_ARCH}.img'
37 ifeq ($(ADK_TARGET_FS
),initramfs
)
39 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
40 @echo
'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
41 ifeq ($(ADK_TARGET_QEMU
),y
)
42 @echo
"Start qemu with following command line:"
43 @echo
'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
46 ifeq ($(ADK_TARGET_FS
),initramfsarchive
)
48 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
49 @echo
"The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
51 ifeq ($(ADK_TARGET_FS
),initramfspiggyback
)
53 @echo
'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
54 ifeq ($(ADK_TARGET_QEMU
),y
)
55 @echo
"Start qemu with following command line:"
56 @echo
'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
59 ifeq ($(ADK_TARGET_FS
),nfsroot
)
61 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
62 @echo
'The nfs root tarball is: ${FW_DIR}/${ROOTFSUSERTARBALL}'
65 # image creation and kernel install
67 cp
$(KERNEL
) $(BUILD_DIR
)/$(TARGET_KERNEL
)
68 $(TARGET_CROSS
)objcopy
$(OSTRIP
) -S
$(KERNEL
) $(BUILD_DIR
)/$(TARGET_KERNEL
)
70 kernel-install
: kernel-strip
71 ifeq ($(ADK_TARGET_KERNEL_VMLINUX_AOUT
),y
)
72 PATH
='$(HOST_PATH)' elftoaout
-o
$(FW_DIR
)/$(TARGET_KERNEL
) $(BUILD_DIR
)/$(TARGET_KERNEL
)
74 cp
$(BUILD_DIR
)/$(TARGET_KERNEL
) $(FW_DIR
)/$(TARGET_KERNEL
)
77 # filesystem specific targets
78 ifeq ($(ADK_TARGET_FS
),archive
)
79 imageinstall
: $(FW_DIR
)/$(ROOTFSTARBALL
) targethelp
81 ifeq ($(ADK_TARGET_FS
),initramfs
)
82 imageinstall
: kernel-install
$(FW_DIR
)/$(INITRAMFS
) targethelp
84 ifeq ($(ADK_TARGET_FS
),initramfsarchive
)
85 imageinstall
: kernel-install
$(FW_DIR
)/$(ROOTFSUSERTARBALL
) targethelp
87 ifeq ($(ADK_TARGET_FS
),initramfspiggyback
)
88 imageinstall
: createinitramfs targethelp
90 ifeq ($(ADK_TARGET_FS
),nfsroot
)
91 imageinstall
: kernel-install
$(FW_DIR
)/$(ROOTFSUSERTARBALL
) targethelp