blob: 22fb66590dcd0e6f7339c9723a9128eb078cdb06 [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
Sam Ravnborga0f97e02007-10-14 22:21:35 +020014KBUILD_CFLAGS += -pipe -fno-builtin -mno-pic
Sam Ravnborg222d3942007-10-15 21:59:31 +020015KBUILD_AFLAGS += -mrelax -mno-pic
Sam Ravnborg65881692010-07-28 17:33:09 +020016KBUILD_CFLAGS_MODULE += -mno-relax
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070017LDFLAGS_vmlinux += --relax
18
Haavard Skinnemoen438ff3f2007-10-29 15:28:07 +010019cpuflags-$(CONFIG_PLATFORM_AT32AP) += -march=ap
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070020
Sam Ravnborga0f97e02007-10-14 22:21:35 +020021KBUILD_CFLAGS += $(cpuflags-y)
Sam Ravnborg222d3942007-10-15 21:59:31 +020022KBUILD_AFLAGS += $(cpuflags-y)
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070023
Haavard Skinnemoen0430fb22006-10-24 10:12:39 +020024CHECKFLAGS += -D__avr32__ -D__BIG_ENDIAN
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070025
Haavard Skinnemoen964d2192008-08-05 13:49:09 +020026machine-$(CONFIG_PLATFORM_AT32AP) := at32ap
27machdirs := $(patsubst %,arch/avr32/mach-%/, $(machine-y))
28
29KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs))
30
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070031head-$(CONFIG_LOADER_U_BOOT) += arch/avr32/boot/u-boot/head.o
32head-y += arch/avr32/kernel/head.o
Haavard Skinnemoen964d2192008-08-05 13:49:09 +020033core-y += $(machdirs)
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070034core-$(CONFIG_BOARD_ATSTK1000) += arch/avr32/boards/atstk1000/
Hans-Christian Egtvedt3550b932009-12-03 14:58:20 +010035core-$(CONFIG_BOARD_ATNGW100_COMMON) += arch/avr32/boards/atngw100/
Alex Raimondidd5e1332008-12-09 16:17:13 +010036core-$(CONFIG_BOARD_HAMMERHEAD) += arch/avr32/boards/hammerhead/
Hans-Christian Egtvedt45c349b2008-07-29 09:25:37 +000037core-$(CONFIG_BOARD_FAVR_32) += arch/avr32/boards/favr-32/
Jonas Larssona16fffd2009-03-27 10:18:14 +010038core-$(CONFIG_BOARD_MERISC) += arch/avr32/boards/merisc/
Mark Jackson5b50c162008-10-13 13:14:50 +000039core-$(CONFIG_BOARD_MIMC200) += arch/avr32/boards/mimc200/
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070040core-$(CONFIG_LOADER_U_BOOT) += arch/avr32/boot/u-boot/
41core-y += arch/avr32/kernel/
42core-y += arch/avr32/mm/
Haavard Skinnemoen2853ce52006-01-04 17:26:23 +010043drivers-$(CONFIG_OPROFILE) += arch/avr32/oprofile/
Haavard Skinnemoen0430fb22006-10-24 10:12:39 +020044libs-y += arch/avr32/lib/
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070045
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070046BOOT_TARGETS := vmlinux.elf vmlinux.bin uImage uImage.srec
47
48.PHONY: $(BOOT_TARGETS) install
49
50boot := arch/$(ARCH)/boot/images
51
52 KBUILD_IMAGE := $(boot)/uImage
53vmlinux.elf: KBUILD_IMAGE := $(boot)/vmlinux.elf
54vmlinux.cso: KBUILD_IMAGE := $(boot)/vmlinux.cso
55uImage.srec: KBUILD_IMAGE := $(boot)/uImage.srec
56uImage: KBUILD_IMAGE := $(boot)/uImage
57
58quiet_cmd_listing = LST $@
59 cmd_listing = avr32-linux-objdump $(OBJDUMPFLAGS) -lS $< > $@
60quiet_cmd_disasm = DIS $@
61 cmd_disasm = avr32-linux-objdump $(OBJDUMPFLAGS) -d $< > $@
62
63vmlinux.elf vmlinux.bin uImage.srec uImage vmlinux.cso: vmlinux
64 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
65
66install: vmlinux
67 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@
68
Haavard Skinnemoen0430fb22006-10-24 10:12:39 +020069vmlinux.s: vmlinux
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070070 $(call if_changed,disasm)
71
Haavard Skinnemoen0430fb22006-10-24 10:12:39 +020072vmlinux.lst: vmlinux
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070073 $(call if_changed,listing)
74
Haavard Skinnemoen0430fb22006-10-24 10:12:39 +020075CLEAN_FILES += vmlinux.s vmlinux.lst
76
77archclean:
78 $(Q)$(MAKE) $(clean)=$(boot)
79
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070080define archhelp
81 @echo '* vmlinux.elf - ELF image with load address 0'
82 @echo ' vmlinux.cso - PathFinder CSO image'
Haavard Skinnemoen0430fb22006-10-24 10:12:39 +020083 @echo '* uImage - Create a bootable image for U-Boot'
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070084endef