Makefile 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #
  2. # This file is subject to the terms and conditions of the GNU General Public
  3. # License. See the file "COPYING" in the main directory of this archive
  4. # for more details.
  5. #
  6. # Copyright (C) 2004-2006 Atmel Corporation.
  7. # Default target when executing plain make
  8. .PHONY: all
  9. all: uImage vmlinux.elf
  10. KBUILD_DEFCONFIG := atstk1002_defconfig
  11. KBUILD_CFLAGS += -pipe -fno-builtin -mno-pic
  12. KBUILD_AFLAGS += -mrelax -mno-pic
  13. CFLAGS_MODULE += -mno-relax
  14. LDFLAGS_vmlinux += --relax
  15. cpuflags-$(CONFIG_PLATFORM_AT32AP) += -march=ap
  16. KBUILD_CFLAGS += $(cpuflags-y)
  17. KBUILD_AFLAGS += $(cpuflags-y)
  18. CHECKFLAGS += -D__avr32__ -D__BIG_ENDIAN
  19. head-$(CONFIG_LOADER_U_BOOT) += arch/avr32/boot/u-boot/head.o
  20. head-y += arch/avr32/kernel/head.o
  21. core-$(CONFIG_PLATFORM_AT32AP) += arch/avr32/mach-at32ap/
  22. core-$(CONFIG_BOARD_ATSTK1000) += arch/avr32/boards/atstk1000/
  23. core-$(CONFIG_BOARD_ATNGW100) += arch/avr32/boards/atngw100/
  24. core-$(CONFIG_LOADER_U_BOOT) += arch/avr32/boot/u-boot/
  25. core-y += arch/avr32/kernel/
  26. core-y += arch/avr32/mm/
  27. drivers-$(CONFIG_OPROFILE) += arch/avr32/oprofile/
  28. libs-y += arch/avr32/lib/
  29. archincdir-$(CONFIG_PLATFORM_AT32AP) := arch-at32ap
  30. include/asm-avr32/.arch: $(wildcard include/config/platform/*.h) include/config/auto.conf
  31. @echo ' SYMLINK include/asm-avr32/arch -> include/asm-avr32/$(archincdir-y)'
  32. ifneq ($(KBUILD_SRC),)
  33. $(Q)mkdir -p include/asm-avr32
  34. $(Q)ln -fsn $(srctree)/include/asm-avr32/$(archincdir-y) include/asm-avr32/arch
  35. else
  36. $(Q)ln -fsn $(archincdir-y) include/asm-avr32/arch
  37. endif
  38. @touch $@
  39. archprepare: include/asm-avr32/.arch
  40. CLEAN_FILES += include/asm-avr32/.arch include/asm-avr32/arch
  41. BOOT_TARGETS := vmlinux.elf vmlinux.bin uImage uImage.srec
  42. .PHONY: $(BOOT_TARGETS) install
  43. boot := arch/$(ARCH)/boot/images
  44. KBUILD_IMAGE := $(boot)/uImage
  45. vmlinux.elf: KBUILD_IMAGE := $(boot)/vmlinux.elf
  46. vmlinux.cso: KBUILD_IMAGE := $(boot)/vmlinux.cso
  47. uImage.srec: KBUILD_IMAGE := $(boot)/uImage.srec
  48. uImage: KBUILD_IMAGE := $(boot)/uImage
  49. quiet_cmd_listing = LST $@
  50. cmd_listing = avr32-linux-objdump $(OBJDUMPFLAGS) -lS $< > $@
  51. quiet_cmd_disasm = DIS $@
  52. cmd_disasm = avr32-linux-objdump $(OBJDUMPFLAGS) -d $< > $@
  53. vmlinux.elf vmlinux.bin uImage.srec uImage vmlinux.cso: vmlinux
  54. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  55. install: vmlinux
  56. $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@
  57. vmlinux.s: vmlinux
  58. $(call if_changed,disasm)
  59. vmlinux.lst: vmlinux
  60. $(call if_changed,listing)
  61. CLEAN_FILES += vmlinux.s vmlinux.lst
  62. archclean:
  63. $(Q)$(MAKE) $(clean)=$(boot)
  64. define archhelp
  65. @echo '* vmlinux.elf - ELF image with load address 0'
  66. @echo ' vmlinux.cso - PathFinder CSO image'
  67. @echo '* uImage - Create a bootable image for U-Boot'
  68. endef