blob: dc6bc01f232cb3a1b2574ef40e8ff043070ddd7a [file] [log] [blame]
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -07001#
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
8# Default target when executing plain make
9.PHONY: all
Haavard Skinnemoen0430fb22006-10-24 10:12:39 +020010all: uImage vmlinux.elf
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070011
12KBUILD_DEFCONFIG := atstk1002_defconfig
13
14CFLAGS += -pipe -fno-builtin -mno-pic
15AFLAGS += -mrelax -mno-pic
16CFLAGS_MODULE += -mno-relax
17LDFLAGS_vmlinux += --relax
18
Haavard Skinnemoenc19aa752007-04-30 17:15:46 +020019cpuflags-$(CONFIG_CPU_AT32AP7000) += -mcpu=ap7000
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070020
21CFLAGS += $(cpuflags-y)
22AFLAGS += $(cpuflags-y)
23
Haavard Skinnemoen0430fb22006-10-24 10:12:39 +020024CHECKFLAGS += -D__avr32__ -D__BIG_ENDIAN
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070025
26head-$(CONFIG_LOADER_U_BOOT) += arch/avr32/boot/u-boot/head.o
27head-y += arch/avr32/kernel/head.o
28core-$(CONFIG_PLATFORM_AT32AP) += arch/avr32/mach-at32ap/
29core-$(CONFIG_BOARD_ATSTK1000) += arch/avr32/boards/atstk1000/
Haavard Skinnemoen9ca20a82007-04-12 17:26:57 +020030core-$(CONFIG_BOARD_ATNGW100) += arch/avr32/boards/atngw100/
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070031core-$(CONFIG_LOADER_U_BOOT) += arch/avr32/boot/u-boot/
32core-y += arch/avr32/kernel/
33core-y += arch/avr32/mm/
Haavard Skinnemoen0430fb22006-10-24 10:12:39 +020034libs-y += arch/avr32/lib/
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070035
36archincdir-$(CONFIG_PLATFORM_AT32AP) := arch-at32ap
37
38include/asm-avr32/.arch: $(wildcard include/config/platform/*.h) include/config/auto.conf
39 @echo ' SYMLINK include/asm-avr32/arch -> include/asm-avr32/$(archincdir-y)'
40ifneq ($(KBUILD_SRC),)
41 $(Q)mkdir -p include/asm-avr32
42 $(Q)ln -fsn $(srctree)/include/asm-avr32/$(archincdir-y) include/asm-avr32/arch
43else
44 $(Q)ln -fsn $(archincdir-y) include/asm-avr32/arch
45endif
46 @touch $@
47
48archprepare: include/asm-avr32/.arch
49
Haavard Skinnemoen0430fb22006-10-24 10:12:39 +020050CLEAN_FILES += include/asm-avr32/.arch include/asm-avr32/arch
51
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070052BOOT_TARGETS := vmlinux.elf vmlinux.bin uImage uImage.srec
53
54.PHONY: $(BOOT_TARGETS) install
55
56boot := arch/$(ARCH)/boot/images
57
58 KBUILD_IMAGE := $(boot)/uImage
59vmlinux.elf: KBUILD_IMAGE := $(boot)/vmlinux.elf
60vmlinux.cso: KBUILD_IMAGE := $(boot)/vmlinux.cso
61uImage.srec: KBUILD_IMAGE := $(boot)/uImage.srec
62uImage: KBUILD_IMAGE := $(boot)/uImage
63
64quiet_cmd_listing = LST $@
65 cmd_listing = avr32-linux-objdump $(OBJDUMPFLAGS) -lS $< > $@
66quiet_cmd_disasm = DIS $@
67 cmd_disasm = avr32-linux-objdump $(OBJDUMPFLAGS) -d $< > $@
68
69vmlinux.elf vmlinux.bin uImage.srec uImage vmlinux.cso: vmlinux
70 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
71
72install: vmlinux
73 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@
74
Haavard Skinnemoen0430fb22006-10-24 10:12:39 +020075vmlinux.s: vmlinux
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070076 $(call if_changed,disasm)
77
Haavard Skinnemoen0430fb22006-10-24 10:12:39 +020078vmlinux.lst: vmlinux
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070079 $(call if_changed,listing)
80
Haavard Skinnemoen0430fb22006-10-24 10:12:39 +020081CLEAN_FILES += vmlinux.s vmlinux.lst
82
83archclean:
84 $(Q)$(MAKE) $(clean)=$(boot)
85
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070086define archhelp
87 @echo '* vmlinux.elf - ELF image with load address 0'
88 @echo ' vmlinux.cso - PathFinder CSO image'
Haavard Skinnemoen0430fb22006-10-24 10:12:39 +020089 @echo '* uImage - Create a bootable image for U-Boot'
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070090endef