Makefile 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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 linux.lst
  10. KBUILD_DEFCONFIG := atstk1002_defconfig
  11. CFLAGS += -pipe -fno-builtin -mno-pic
  12. AFLAGS += -mrelax -mno-pic
  13. CFLAGS_MODULE += -mno-relax
  14. LDFLAGS_vmlinux += --relax
  15. cpuflags-$(CONFIG_CPU_AP7000) += -mcpu=ap7000
  16. CFLAGS += $(cpuflags-y)
  17. AFLAGS += $(cpuflags-y)
  18. CHECKFLAGS += -D__avr32__
  19. LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
  20. head-$(CONFIG_LOADER_U_BOOT) += arch/avr32/boot/u-boot/head.o
  21. head-y += arch/avr32/kernel/head.o
  22. core-$(CONFIG_PLATFORM_AT32AP) += arch/avr32/mach-at32ap/
  23. core-$(CONFIG_BOARD_ATSTK1000) += arch/avr32/boards/atstk1000/
  24. core-$(CONFIG_LOADER_U_BOOT) += arch/avr32/boot/u-boot/
  25. core-y += arch/avr32/kernel/
  26. core-y += arch/avr32/mm/
  27. libs-y += arch/avr32/lib/ #$(LIBGCC)
  28. archincdir-$(CONFIG_PLATFORM_AT32AP) := arch-at32ap
  29. include/asm-avr32/.arch: $(wildcard include/config/platform/*.h) include/config/auto.conf
  30. @echo ' SYMLINK include/asm-avr32/arch -> include/asm-avr32/$(archincdir-y)'
  31. ifneq ($(KBUILD_SRC),)
  32. $(Q)mkdir -p include/asm-avr32
  33. $(Q)ln -fsn $(srctree)/include/asm-avr32/$(archincdir-y) include/asm-avr32/arch
  34. else
  35. $(Q)ln -fsn $(archincdir-y) include/asm-avr32/arch
  36. endif
  37. @touch $@
  38. archprepare: include/asm-avr32/.arch
  39. BOOT_TARGETS := vmlinux.elf vmlinux.bin uImage uImage.srec
  40. .PHONY: $(BOOT_TARGETS) install
  41. boot := arch/$(ARCH)/boot/images
  42. KBUILD_IMAGE := $(boot)/uImage
  43. vmlinux.elf: KBUILD_IMAGE := $(boot)/vmlinux.elf
  44. vmlinux.cso: KBUILD_IMAGE := $(boot)/vmlinux.cso
  45. uImage.srec: KBUILD_IMAGE := $(boot)/uImage.srec
  46. uImage: KBUILD_IMAGE := $(boot)/uImage
  47. quiet_cmd_listing = LST $@
  48. cmd_listing = avr32-linux-objdump $(OBJDUMPFLAGS) -lS $< > $@
  49. quiet_cmd_disasm = DIS $@
  50. cmd_disasm = avr32-linux-objdump $(OBJDUMPFLAGS) -d $< > $@
  51. vmlinux.elf vmlinux.bin uImage.srec uImage vmlinux.cso: vmlinux
  52. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  53. install: vmlinux
  54. $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@
  55. linux.s: vmlinux
  56. $(call if_changed,disasm)
  57. linux.lst: vmlinux
  58. $(call if_changed,listing)
  59. define archhelp
  60. @echo '* vmlinux.elf - ELF image with load address 0'
  61. @echo ' vmlinux.cso - PathFinder CSO image'
  62. @echo ' uImage - Create a bootable image for U-Boot'
  63. endef