Makefile 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #
  2. # Copyright (C) 2004-2006 Atmel Corporation
  3. #
  4. # This file is subject to the terms and conditions of the GNU General Public
  5. # License. See the file "COPYING" in the main directory of this archive
  6. # for more details.
  7. #
  8. MKIMAGE := $(srctree)/scripts/mkuboot.sh
  9. extra-y := vmlinux.bin vmlinux.gz
  10. OBJCOPYFLAGS_vmlinux.bin := -O binary -R .note.gnu.build-id
  11. $(obj)/vmlinux.bin: vmlinux FORCE
  12. $(call if_changed,objcopy)
  13. $(obj)/vmlinux.gz: $(obj)/vmlinux.bin FORCE
  14. $(call if_changed,gzip)
  15. quiet_cmd_uimage = UIMAGE $@
  16. cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A avr32 -O linux -T kernel \
  17. -C gzip -a $(CONFIG_LOAD_ADDRESS) -e $(CONFIG_ENTRY_ADDRESS) \
  18. -n 'Linux-$(KERNELRELEASE)' -d $< $@
  19. targets += uImage uImage.srec
  20. $(obj)/uImage: $(obj)/vmlinux.gz
  21. $(call if_changed,uimage)
  22. @echo ' Image $@ is ready'
  23. OBJCOPYFLAGS_uImage.srec := -I binary -O srec
  24. $(obj)/uImage.srec: $(obj)/uImage
  25. $(call if_changed,objcopy)
  26. OBJCOPYFLAGS_vmlinux.elf := --change-section-lma .text-0x80000000 \
  27. --change-section-lma __ex_table-0x80000000 \
  28. --change-section-lma .rodata-0x80000000 \
  29. --change-section-lma .data-0x80000000 \
  30. --change-section-lma .init-0x80000000 \
  31. --change-section-lma .bss-0x80000000 \
  32. --change-section-lma __param-0x80000000 \
  33. --change-section-lma __ksymtab-0x80000000 \
  34. --change-section-lma __ksymtab_gpl-0x80000000 \
  35. --change-section-lma __kcrctab-0x80000000 \
  36. --change-section-lma __kcrctab_gpl-0x80000000 \
  37. --change-section-lma __ksymtab_strings-0x80000000 \
  38. --set-start 0xa0000000
  39. $(obj)/vmlinux.elf: vmlinux FORCE
  40. $(call if_changed,objcopy)
  41. quiet_cmd_sfdwarf = SFDWARF $@
  42. cmd_sfdwarf = sfdwarf $< TO $@ GNUAVR IW $(SFDWARF_FLAGS) > $(obj)/sfdwarf.log
  43. $(obj)/vmlinux.cso: $(obj)/vmlinux.elf FORCE
  44. $(call if_changed,sfdwarf)
  45. install: $(BOOTIMAGE)
  46. sh $(srctree)/install-kernel.sh $<
  47. # Generated files to be removed upon make clean
  48. clean-files := vmlinux.elf vmlinux.bin vmlinux.gz uImage uImage.srec