Makefile 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 -D__linux__
  12. KBUILD_AFLAGS += -mrelax -mno-pic
  13. KBUILD_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. machine-$(CONFIG_PLATFORM_AT32AP) := at32ap
  20. machdirs := $(patsubst %,arch/avr32/mach-%/, $(machine-y))
  21. KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs))
  22. head-$(CONFIG_LOADER_U_BOOT) += arch/avr32/boot/u-boot/head.o
  23. head-y += arch/avr32/kernel/head.o
  24. core-y += $(machdirs)
  25. core-$(CONFIG_BOARD_ATSTK1000) += arch/avr32/boards/atstk1000/
  26. core-$(CONFIG_BOARD_ATNGW100_COMMON) += arch/avr32/boards/atngw100/
  27. core-$(CONFIG_BOARD_HAMMERHEAD) += arch/avr32/boards/hammerhead/
  28. core-$(CONFIG_BOARD_FAVR_32) += arch/avr32/boards/favr-32/
  29. core-$(CONFIG_BOARD_MERISC) += arch/avr32/boards/merisc/
  30. core-$(CONFIG_BOARD_MIMC200) += arch/avr32/boards/mimc200/
  31. core-$(CONFIG_LOADER_U_BOOT) += arch/avr32/boot/u-boot/
  32. core-y += arch/avr32/kernel/
  33. core-y += arch/avr32/mm/
  34. drivers-$(CONFIG_OPROFILE) += arch/avr32/oprofile/
  35. libs-y += arch/avr32/lib/
  36. BOOT_TARGETS := vmlinux.elf vmlinux.bin uImage uImage.srec
  37. .PHONY: $(BOOT_TARGETS) install
  38. boot := arch/$(ARCH)/boot/images
  39. KBUILD_IMAGE := $(boot)/uImage
  40. vmlinux.elf: KBUILD_IMAGE := $(boot)/vmlinux.elf
  41. vmlinux.cso: KBUILD_IMAGE := $(boot)/vmlinux.cso
  42. uImage.srec: KBUILD_IMAGE := $(boot)/uImage.srec
  43. uImage: KBUILD_IMAGE := $(boot)/uImage
  44. quiet_cmd_listing = LST $@
  45. cmd_listing = avr32-linux-objdump $(OBJDUMPFLAGS) -lS $< > $@
  46. quiet_cmd_disasm = DIS $@
  47. cmd_disasm = avr32-linux-objdump $(OBJDUMPFLAGS) -d $< > $@
  48. vmlinux.elf vmlinux.bin uImage.srec uImage vmlinux.cso: vmlinux
  49. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  50. install: vmlinux
  51. $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@
  52. vmlinux.s: vmlinux
  53. $(call if_changed,disasm)
  54. vmlinux.lst: vmlinux
  55. $(call if_changed,listing)
  56. CLEAN_FILES += vmlinux.s vmlinux.lst
  57. archclean:
  58. $(Q)$(MAKE) $(clean)=$(boot)
  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