add srec support for kernel format
[openadk.git] / target / h8300 / Makefile
blob6c0add73ed4976ba96cbc923289c2104cf5fab25
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 ifeq ($(ADK_TARGET_KERNEL_VMLINUX_SREC),y)
10 KERNEL:=$(LINUX_DIR)/arch/h8300/boot/vmlinux.srec
11 endif
12 OSTRIP:=-R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id
14 # target helper text
15 ifeq ($(ADK_TARGET_FS),initramfs)
16 targethelp:
17 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
18 @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
19 endif
20 ifeq ($(ADK_TARGET_FS),initramfsarchive)
21 targethelp:
22 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
23 @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
24 endif
25 ifeq ($(ADK_TARGET_FS),initramfspiggyback)
26 targethelp:
27 @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
28 ifeq ($(ADK_TARGET_SIM),y)
29 @echo "Run the simulator via:"
30 @echo '$(TARGET_CROSS)gdb $(FW_DIR)/$(TARGET_KERNEL)'
31 @echo 'gdb> target sim'
32 @echo 'gdb> sim intmode 1'
33 @echo 'gdb> sim sci net 12345'
34 @echo 'gdb> load'
35 @echo 'start telnet localhost 12345 in a second shell'
36 @echo 'gdb> run earlyprintk=h8300-sim console=ttySC0'
37 endif
38 endif
39 ifeq ($(ADK_TARGET_FS),nfsroot)
40 targethelp:
41 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
42 @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
43 endif
45 kernel-strip:
46 $(TARGET_CROSS)objcopy $(OSTRIP) -S $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
48 kernel-install: kernel-strip
49 @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
51 # filesystem specific targets
52 ifeq ($(ADK_TARGET_FS),initramfs)
53 imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
54 endif
55 ifeq ($(ADK_TARGET_FS),initramfsarchive)
56 imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
57 endif
58 ifeq ($(ADK_TARGET_FS),initramfspiggyback)
59 imageinstall: createinitramfs targethelp
60 endif
61 ifeq ($(ADK_TARGET_FS),nfsroot)
62 imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
63 endif