Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
[linux-2.6] / arch / avr32 / Makefile
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
8 # Default target when executing plain make
9 .PHONY: all
10 all: uImage vmlinux.elf
11
12 KBUILD_DEFCONFIG        := atstk1002_defconfig
13
14 KBUILD_CFLAGS   += -pipe -fno-builtin -mno-pic
15 KBUILD_AFLAGS   += -mrelax -mno-pic
16 CFLAGS_MODULE   += -mno-relax
17 LDFLAGS_vmlinux += --relax
18
19 cpuflags-$(CONFIG_PLATFORM_AT32AP)      += -march=ap
20
21 KBUILD_CFLAGS   += $(cpuflags-y)
22 KBUILD_AFLAGS   += $(cpuflags-y)
23
24 CHECKFLAGS      += -D__avr32__ -D__BIG_ENDIAN
25
26 machine-$(CONFIG_PLATFORM_AT32AP) := at32ap
27 machdirs        := $(patsubst %,arch/avr32/mach-%/, $(machine-y))
28
29 KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs))
30
31 head-$(CONFIG_LOADER_U_BOOT)            += arch/avr32/boot/u-boot/head.o
32 head-y                                  += arch/avr32/kernel/head.o
33 core-y                                  += $(machdirs)
34 core-$(CONFIG_BOARD_ATSTK1000)          += arch/avr32/boards/atstk1000/
35 core-$(CONFIG_BOARD_ATNGW100)           += arch/avr32/boards/atngw100/
36 core-$(CONFIG_BOARD_HAMMERHEAD)         += arch/avr32/boards/hammerhead/
37 core-$(CONFIG_BOARD_FAVR_32)            += arch/avr32/boards/favr-32/
38 core-$(CONFIG_BOARD_MIMC200)            += arch/avr32/boards/mimc200/
39 core-$(CONFIG_LOADER_U_BOOT)            += arch/avr32/boot/u-boot/
40 core-y                                  += arch/avr32/kernel/
41 core-y                                  += arch/avr32/mm/
42 drivers-$(CONFIG_OPROFILE)              += arch/avr32/oprofile/
43 libs-y                                  += arch/avr32/lib/
44
45 CLEAN_FILES += include/asm-avr32/.arch include/asm-avr32/arch
46
47 BOOT_TARGETS := vmlinux.elf vmlinux.bin uImage uImage.srec
48
49 .PHONY: $(BOOT_TARGETS) install
50
51 boot := arch/$(ARCH)/boot/images
52
53              KBUILD_IMAGE := $(boot)/uImage
54 vmlinux.elf: KBUILD_IMAGE := $(boot)/vmlinux.elf
55 vmlinux.cso: KBUILD_IMAGE := $(boot)/vmlinux.cso
56 uImage.srec: KBUILD_IMAGE := $(boot)/uImage.srec
57 uImage:      KBUILD_IMAGE := $(boot)/uImage
58
59 quiet_cmd_listing = LST     $@
60       cmd_listing = avr32-linux-objdump $(OBJDUMPFLAGS) -lS $< > $@
61 quiet_cmd_disasm  = DIS     $@
62       cmd_disasm  = avr32-linux-objdump $(OBJDUMPFLAGS) -d $< > $@
63
64 vmlinux.elf vmlinux.bin uImage.srec uImage vmlinux.cso: vmlinux
65         $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
66
67 install: vmlinux
68         $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@
69
70 vmlinux.s: vmlinux
71         $(call if_changed,disasm)
72
73 vmlinux.lst: vmlinux
74         $(call if_changed,listing)
75
76 CLEAN_FILES += vmlinux.s vmlinux.lst
77
78 archclean:
79         $(Q)$(MAKE) $(clean)=$(boot)
80
81 define archhelp
82   @echo '* vmlinux.elf          - ELF image with load address 0'
83   @echo '  vmlinux.cso          - PathFinder CSO image'
84   @echo '* uImage               - Create a bootable image for U-Boot'
85 endef