barebox: update to 2017.11.0, fix x86 builds
[openadk.git] / target / h8300 / Makefile
blobdf8939529c93d0d993977e98a1f126c27f2c6f5a
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)/vmlinux
9 OSTRIP:=-R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id
10 ifeq ($(ADK_TARGET_KERNEL_UIMAGEBIN),y)
11 KERNEL:=$(LINUX_DIR)/arch/h8300/boot/uImage.bin
12 OSTRIP:=
13 endif
14 ifeq ($(ADK_TARGET_KERNEL_ZIMAGE),y)
15 KERNEL:=$(LINUX_DIR)/arch/h8300/boot/zImage
16 OSTRIP:=
17 endif
18 ifeq ($(ADK_TARGET_KERNEL_VMLINUX_SREC),y)
19 KERNEL:=$(LINUX_DIR)/arch/h8300/boot/vmlinux.srec
20 endif
22 # target helper text
23 ifeq ($(ADK_TARGET_FS),archive)
24 targethelp:
25 @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
26 endif
27 ifeq ($(ADK_TARGET_FS),initramfs)
28 targethelp:
29 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
30 @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
31 endif
32 ifeq ($(ADK_TARGET_FS),initramfsarchive)
33 targethelp:
34 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
35 @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
36 endif
37 ifeq ($(ADK_TARGET_FS),initramfspiggyback)
38 targethelp:
39 @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
40 ifeq ($(ADK_TARGET_SIM),y)
41 @echo "Run the simulator via:"
42 @echo '$(TARGET_CROSS)gdb $(FW_DIR)/$(TARGET_KERNEL)'
43 @echo 'gdb> target sim'
44 @echo 'gdb> sim intmode 1'
45 @echo 'gdb> sim sci net 12345'
46 @echo 'gdb> load'
47 @echo 'start telnet localhost 12345 in a second shell'
48 @echo 'gdb> run earlyprintk=h8300-sim console=ttySC0'
49 endif
50 endif
51 ifeq ($(ADK_TARGET_FS),nfsroot)
52 targethelp:
53 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
54 @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
55 endif
57 kernel-strip:
58 ifneq ($(OSTRIP),)
59 $(TARGET_CROSS)objcopy $(OSTRIP) -S $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
60 else
61 @cp $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
62 endif
64 kernel-install: kernel-strip
65 @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
67 # filesystem specific targets
68 ifeq ($(ADK_TARGET_FS),archive)
69 imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) targethelp
70 endif
71 ifeq ($(ADK_TARGET_FS),initramfs)
72 imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
73 endif
74 ifeq ($(ADK_TARGET_FS),initramfsarchive)
75 imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
76 endif
77 ifeq ($(ADK_TARGET_FS),initramfspiggyback)
78 imageinstall: createinitramfs targethelp
79 endif
80 ifeq ($(ADK_TARGET_FS),nfsroot)
81 imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
82 endif