remove duplicate package
[openadk.git] / target / sparc / Makefile
blobb768e72ed6ffd952237c8c40944992d49e15b6cd
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
14 endif
15 ifeq ($(ADK_TARGET_KERNEL_VMLINUX_AOUT),y)
16 KERNEL:=$(LINUX_DIR)/arch/sparc/boot/image
17 endif
19 QEMU_ARGS:=-M SS-10
20 QEMU_ARGS+=${ADK_QEMU_ARGS}
21 ifeq ($(ADK_TARGET_FS),archive)
22 QEMU_ARGS+=-append "root=/dev/sda1"
23 endif
25 # target helper text
26 ifeq ($(ADK_TARGET_FS),archive)
27 targethelp:
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'
35 endif
36 endif
37 ifeq ($(ADK_TARGET_FS),initramfs)
38 targethelp:
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}'
44 endif
45 endif
46 ifeq ($(ADK_TARGET_FS),initramfsarchive)
47 targethelp:
48 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
49 @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
50 endif
51 ifeq ($(ADK_TARGET_FS),initramfspiggyback)
52 targethelp:
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)'
57 endif
58 endif
59 ifeq ($(ADK_TARGET_FS),nfsroot)
60 targethelp:
61 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
62 @echo 'The nfs root tarball is: ${FW_DIR}/${ROOTFSUSERTARBALL}'
63 endif
65 # image creation and kernel install
66 kernel-strip:
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)
73 else
74 cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
75 endif
77 # filesystem specific targets
78 ifeq ($(ADK_TARGET_FS),archive)
79 imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
80 endif
81 ifeq ($(ADK_TARGET_FS),initramfs)
82 imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
83 endif
84 ifeq ($(ADK_TARGET_FS),initramfsarchive)
85 imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
86 endif
87 ifeq ($(ADK_TARGET_FS),initramfspiggyback)
88 imageinstall: createinitramfs targethelp
89 endif
90 ifeq ($(ADK_TARGET_FS),nfsroot)
91 imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
92 endif