fix logic error with ADK_EXPERIMENTAL
[openadk.git] / target / x86_64 / Makefile
blobe4e0c4d1daaa7059c7ed4ed0069938ecb34a49bb
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)/arch/x86/boot/bzImage
12 QEMU_ARCH:=x86_64
13 QEMU_ARGS:=-M pc
14 QEMU_ARGS+=${ADK_QEMU_ARGS}
15 QEMU_ARGS+=-net user -net nic,model=e1000
17 ifeq ($(ADK_TARGET_QEMU_WITH_AUDIO),y)
18 QEMU_ARGS+=-soundhw ac97
19 endif
21 ifeq ($(ADK_TARGET_QEMU_WITH_BOOTLOADER),y)
22 ifeq ($(ADK_TARGET_QEMU_WITHOUT_GRAPHIC),y)
23 CREATE:=./scripts/create.sh -g -t
24 else
25 CREATE:=./scripts/create.sh -g
26 endif
27 else
28 CREATE:=./scripts/create.sh
29 endif
31 # target helper text
32 ifeq ($(ADK_TARGET_FS),archive)
33 targethelp:
34 @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
35 ifeq ($(ADK_TARGET_QEMU),y)
36 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
37 @echo "Use following command to create a QEMU Image:"
38 @echo "./scripts/create.sh qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
39 @echo "Start qemu with following options:"
40 ifeq ($(ADK_TARGET_QEMU_WITH_BOOTLOADER),y)
41 @echo 'qemu-system-${QEMU_ARCH} ${QEMU_ARGS} qemu-${ADK_TARGET_CPU_ARCH}.img'
42 else
43 @echo 'qemu-system-${QEMU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${ADK_TARGET_CPU_ARCH}.img'
44 endif
45 endif
46 ifeq ($(ADK_HARDWARE_VBOX),y)
47 @cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
48 @echo "Use following command to create a VirtualBox Image:"
49 @echo "./scripts/create.sh -T vdi vbox-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
50 endif
51 endif
52 ifeq ($(ADK_TARGET_FS),initramfs)
53 targethelp:
54 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
55 @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
56 ifeq ($(ADK_TARGET_QEMU),y)
57 @echo "Start qemu with following command line:"
58 @echo 'qemu-system-${QEMU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
59 endif
60 endif
61 ifeq ($(ADK_TARGET_FS),initramfsarchive)
62 targethelp:
63 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
64 @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
65 endif
66 ifeq ($(ADK_TARGET_FS),initramfspiggyback)
67 targethelp:
68 @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
69 ifeq ($(ADK_TARGET_QEMU),y)
70 @echo "Start qemu with following command line:"
71 @echo 'qemu-system-${QEMU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
72 endif
73 endif
74 ifeq ($(ADK_TARGET_FS),nfsroot)
75 targethelp:
76 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
77 @echo 'The nfs root tarball is: ${FW_DIR}/${ROOTFSUSERTARBALL}'
78 endif
79 ifeq ($(ADK_TARGET_FS),usb)
80 targethelp:
81 @echo 'The root tarball is: ${FW_DIR}/${ROOTFSTARBALL}'
82 @echo "To install everything to USB use:"
83 @echo "sudo ./scripts/install.sh -t /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
84 endif
85 ifeq ($(ADK_TARGET_FS),iso)
86 targethelp:
87 @echo 'ISO image is at $<'
88 endif
90 # image creation and kernel install
91 kernel-strip:
92 @cp $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
94 kernel-install: kernel-strip
95 @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/${TARGET_KERNEL}
97 # filesystem specific targets
98 ifeq ($(ADK_TARGET_FS),archive)
99 imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
100 endif
101 ifeq ($(ADK_TARGET_FS),initramfs)
102 imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
103 endif
104 ifeq ($(ADK_TARGET_FS),initramfsarchive)
105 imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
106 endif
107 ifeq ($(ADK_TARGET_FS),initramfspiggyback)
108 imageinstall: createinitramfs targethelp
109 endif
110 ifeq (${ADK_TARGET_FS},iso)
111 imageinstall: ${FW_DIR}/${ROOTFSISO} targethelp
112 endif
113 ifeq ($(ADK_TARGET_FS),nfsroot)
114 imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
115 endif
116 ifeq ($(ADK_TARGET_FS),usb)
117 imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
118 endif