remove duplicate package
[openadk.git] / target / riscv32 / Makefile
blob3d34f7f098061bc28c1ef2911a25c0313884b4f9
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)/arch/riscv/boot/Image
9 QEMU_ARGS:=-M virt -m 512 -nographic
10 ifeq ($(ADK_TARGET_WITH_MMU),)
11 QEMU_ARGS+=-bios none
12 endif
13 ifeq ($(ADK_TARGET_QEMU_WITH_VIRTIO),y)
14 QEMU_ARGS+=-netdev user,id=eth0 -device virtio-net-device,netdev=eth0
15 endif
16 ifeq ($(ADK_TARGET_FS),archive)
17 QEMU_ARGS+=-device virtio-blk-device,drive=vda -drive file=qemu-${ADK_TARGET_CPU_ARCH}.img,if=none,id=vda,format=raw
18 endif
20 # target helper text
21 ifeq ($(ADK_TARGET_FS),archive)
22 targethelp:
23 @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
24 ifeq ($(ADK_TARGET_QEMU),y)
25 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
26 @echo "Use following command to create a QEMU Image:"
27 @echo "./scripts/create.sh qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
28 @echo "Start qemu with following options:"
29 @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/fw_jump.elf'
30 endif
31 endif
32 ifeq ($(ADK_TARGET_FS),initramfs)
33 targethelp:
34 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
35 @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
36 ifeq ($(ADK_TARGET_QEMU),y)
37 @echo "Start qemu with following command line:"
38 @echo 'qemu-system-riscv32 ${QEMU_ARGS} -kernel $(FW_DIR)/fw_jump.elf -initrd ${FW_DIR}/${INITRAMFS}'
39 endif
40 endif
41 ifeq ($(ADK_TARGET_FS),initramfsarchive)
42 targethelp:
43 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
44 @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
45 endif
46 ifeq ($(ADK_TARGET_FS),initramfspiggyback)
47 targethelp:
48 @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
49 ifeq ($(ADK_TARGET_QEMU),y)
50 @echo "Start qemu with following command line:"
51 @echo 'qemu-system-riscv32 ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
52 endif
53 endif
55 kernel-strip:
57 kernel-install: kernel-strip
58 @cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
60 # filesystem specific targets
61 ifeq ($(ADK_TARGET_FS),initramfs)
62 imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
63 endif
64 ifeq ($(ADK_TARGET_FS),initramfsarchive)
65 imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
66 endif
67 ifeq ($(ADK_TARGET_FS),initramfspiggyback)
68 imageinstall: createinitramfs targethelp
69 endif