j2: update binutils patch in a hackish way, need to recheck on hardware
[openadk.git] / target / x86_64 / Makefile
blobe4b53e1b0b98e91ddb7b72733107abcbe0ce7b25
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/x86/boot/bzImage
10 QEMU_ARCH:=x86_64
12 QEMU_ARGS:=-M pc
13 ifeq ($(ADK_PACKAGE_GRUB_EFI_X86_64),y)
14 QEMU_ARGS+=-L . -bios bios-x86_64.bin
15 endif
16 QEMU_ARGS+=${ADK_QEMU_ARGS}
17 QEMU_ARGS+=-net user -net nic,model=e1000
18 ifeq ($(ADK_TARGET_QEMU_WITH_AUDIO),y)
19 QEMU_ARGS+=-soundhw ac97
20 endif
22 ifeq ($(ADK_TARGET_QEMU_WITH_BOOTLOADER),y)
23 ifeq ($(ADK_TARGET_QEMU_WITHOUT_GRAPHIC),y)
24 CREATE:=./scripts/create.sh -g -t
25 else
26 CREATE:=./scripts/create.sh -g
27 endif
28 else
29 CREATE:=./scripts/create.sh
30 endif
32 # target helper text
33 ifeq ($(ADK_TARGET_FS),archive)
34 targethelp:
35 @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
36 ifeq ($(ADK_TARGET_QEMU),y)
37 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
38 @echo "Use following command to create a QEMU Image:"
39 @echo "$(CREATE) qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
40 @echo "Start qemu with following options:"
41 ifeq ($(ADK_TARGET_QEMU_WITH_BOOTLOADER),y)
42 @echo 'qemu-system-${QEMU_ARCH} ${QEMU_ARGS} qemu-${ADK_TARGET_CPU_ARCH}.img'
43 else
44 @echo 'qemu-system-${QEMU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${ADK_TARGET_CPU_ARCH}.img'
45 endif
46 endif
47 ifeq ($(ADK_HARDWARE_VBOX),y)
48 @cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
49 @echo "Use following command to create a VirtualBox Image:"
50 @echo "./scripts/create.sh -T vdi vbox-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
51 endif
52 endif
53 ifeq ($(ADK_TARGET_FS),initramfs)
54 targethelp:
55 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
56 @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
57 ifeq ($(ADK_TARGET_QEMU),y)
58 @echo "Start qemu with following command line:"
59 @echo 'qemu-system-${QEMU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
60 endif
61 endif
62 ifeq ($(ADK_TARGET_FS),initramfsarchive)
63 targethelp:
64 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
65 @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
66 endif
67 ifeq ($(ADK_TARGET_FS),initramfspiggyback)
68 targethelp:
69 @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
70 ifeq ($(ADK_TARGET_QEMU),y)
71 @echo "Start qemu with following command line:"
72 @echo 'qemu-system-${QEMU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
73 endif
74 endif
75 ifeq ($(ADK_TARGET_FS),nfsroot)
76 targethelp:
77 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
78 @echo 'The nfs root tarball is: ${FW_DIR}/${ROOTFSUSERTARBALL}'
79 endif
80 ifeq ($(ADK_TARGET_FS),usb)
81 targethelp:
82 @echo 'The root tarball is: ${FW_DIR}/${ROOTFSTARBALL}'
83 @echo "To install everything to USB disk use:"
84 @echo "sudo ./scripts/install.sh -g -t default /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
85 endif
86 ifeq ($(ADK_TARGET_FS),iso)
87 targethelp:
88 @echo 'ISO image is at $<'
89 endif
90 ifeq ($(ADK_TARGET_FS),genimage)
91 targethelp:
92 @echo "The disk image is: $(FW_DIR)/disk.img"
93 ifeq ($(ADK_TARGET_QEMU),y)
94 @echo 'qemu-system-${QEMU_ARCH} ${QEMU_ARGS} $(FW_DIR)/disk.img'
95 else
96 @echo "Use following command to install it on SD card:"
97 @echo 'sudo dd if=$(FW_DIR)/disk.img of=/dev/sdX bs=2048k'
98 endif
99 endif
101 # image creation and kernel install
102 kernel-strip:
103 @cp $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
105 kernel-install: kernel-strip
106 @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/${TARGET_KERNEL}
108 # filesystem specific targets
109 ifeq ($(ADK_TARGET_FS),archive)
110 imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
111 endif
112 ifeq ($(ADK_TARGET_FS),initramfs)
113 imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
114 endif
115 ifeq ($(ADK_TARGET_FS),initramfsarchive)
116 imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
117 endif
118 ifeq ($(ADK_TARGET_FS),initramfspiggyback)
119 imageinstall: createinitramfs targethelp
120 endif
121 ifeq (${ADK_TARGET_FS},iso)
122 imageinstall: ${FW_DIR}/${ROOTFSISO} targethelp
123 endif
124 ifeq (${ADK_TARGET_FS},genimage)
125 imageinstall: ${FW_DIR}/${GENIMAGE} targethelp
126 endif
127 ifeq ($(ADK_TARGET_FS),nfsroot)
128 imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
129 endif
130 ifeq ($(ADK_TARGET_FS),usb)
131 imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
132 endif