Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 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 |
Haavard Skinnemoen | 0430fb2 | 2006-10-24 10:12:39 +0200 | [diff] [blame] | 10 | all: uImage vmlinux.elf |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 11 | |
| 12 | KBUILD_DEFCONFIG := atstk1002_defconfig |
| 13 | |
Sam Ravnborg | a0f97e0 | 2007-10-14 22:21:35 +0200 | [diff] [blame] | 14 | KBUILD_CFLAGS += -pipe -fno-builtin -mno-pic |
Sam Ravnborg | 222d394 | 2007-10-15 21:59:31 +0200 | [diff] [blame] | 15 | KBUILD_AFLAGS += -mrelax -mno-pic |
Sam Ravnborg | 6588169 | 2010-07-28 17:33:09 +0200 | [diff] [blame^] | 16 | KBUILD_CFLAGS_MODULE += -mno-relax |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 17 | LDFLAGS_vmlinux += --relax |
| 18 | |
Haavard Skinnemoen | 438ff3f | 2007-10-29 15:28:07 +0100 | [diff] [blame] | 19 | cpuflags-$(CONFIG_PLATFORM_AT32AP) += -march=ap |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 20 | |
Sam Ravnborg | a0f97e0 | 2007-10-14 22:21:35 +0200 | [diff] [blame] | 21 | KBUILD_CFLAGS += $(cpuflags-y) |
Sam Ravnborg | 222d394 | 2007-10-15 21:59:31 +0200 | [diff] [blame] | 22 | KBUILD_AFLAGS += $(cpuflags-y) |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 23 | |
Haavard Skinnemoen | 0430fb2 | 2006-10-24 10:12:39 +0200 | [diff] [blame] | 24 | CHECKFLAGS += -D__avr32__ -D__BIG_ENDIAN |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 25 | |
Haavard Skinnemoen | 964d219 | 2008-08-05 13:49:09 +0200 | [diff] [blame] | 26 | machine-$(CONFIG_PLATFORM_AT32AP) := at32ap |
| 27 | machdirs := $(patsubst %,arch/avr32/mach-%/, $(machine-y)) |
| 28 | |
| 29 | KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs)) |
| 30 | |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 31 | head-$(CONFIG_LOADER_U_BOOT) += arch/avr32/boot/u-boot/head.o |
| 32 | head-y += arch/avr32/kernel/head.o |
Haavard Skinnemoen | 964d219 | 2008-08-05 13:49:09 +0200 | [diff] [blame] | 33 | core-y += $(machdirs) |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 34 | core-$(CONFIG_BOARD_ATSTK1000) += arch/avr32/boards/atstk1000/ |
Hans-Christian Egtvedt | 3550b93 | 2009-12-03 14:58:20 +0100 | [diff] [blame] | 35 | core-$(CONFIG_BOARD_ATNGW100_COMMON) += arch/avr32/boards/atngw100/ |
Alex Raimondi | dd5e133 | 2008-12-09 16:17:13 +0100 | [diff] [blame] | 36 | core-$(CONFIG_BOARD_HAMMERHEAD) += arch/avr32/boards/hammerhead/ |
Hans-Christian Egtvedt | 45c349b | 2008-07-29 09:25:37 +0000 | [diff] [blame] | 37 | core-$(CONFIG_BOARD_FAVR_32) += arch/avr32/boards/favr-32/ |
Jonas Larsson | a16fffd | 2009-03-27 10:18:14 +0100 | [diff] [blame] | 38 | core-$(CONFIG_BOARD_MERISC) += arch/avr32/boards/merisc/ |
Mark Jackson | 5b50c16 | 2008-10-13 13:14:50 +0000 | [diff] [blame] | 39 | core-$(CONFIG_BOARD_MIMC200) += arch/avr32/boards/mimc200/ |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 40 | core-$(CONFIG_LOADER_U_BOOT) += arch/avr32/boot/u-boot/ |
| 41 | core-y += arch/avr32/kernel/ |
| 42 | core-y += arch/avr32/mm/ |
Haavard Skinnemoen | 2853ce5 | 2006-01-04 17:26:23 +0100 | [diff] [blame] | 43 | drivers-$(CONFIG_OPROFILE) += arch/avr32/oprofile/ |
Haavard Skinnemoen | 0430fb2 | 2006-10-24 10:12:39 +0200 | [diff] [blame] | 44 | libs-y += arch/avr32/lib/ |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 45 | |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 46 | BOOT_TARGETS := vmlinux.elf vmlinux.bin uImage uImage.srec |
| 47 | |
| 48 | .PHONY: $(BOOT_TARGETS) install |
| 49 | |
| 50 | boot := arch/$(ARCH)/boot/images |
| 51 | |
| 52 | KBUILD_IMAGE := $(boot)/uImage |
| 53 | vmlinux.elf: KBUILD_IMAGE := $(boot)/vmlinux.elf |
| 54 | vmlinux.cso: KBUILD_IMAGE := $(boot)/vmlinux.cso |
| 55 | uImage.srec: KBUILD_IMAGE := $(boot)/uImage.srec |
| 56 | uImage: KBUILD_IMAGE := $(boot)/uImage |
| 57 | |
| 58 | quiet_cmd_listing = LST $@ |
| 59 | cmd_listing = avr32-linux-objdump $(OBJDUMPFLAGS) -lS $< > $@ |
| 60 | quiet_cmd_disasm = DIS $@ |
| 61 | cmd_disasm = avr32-linux-objdump $(OBJDUMPFLAGS) -d $< > $@ |
| 62 | |
| 63 | vmlinux.elf vmlinux.bin uImage.srec uImage vmlinux.cso: vmlinux |
| 64 | $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ |
| 65 | |
| 66 | install: vmlinux |
| 67 | $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@ |
| 68 | |
Haavard Skinnemoen | 0430fb2 | 2006-10-24 10:12:39 +0200 | [diff] [blame] | 69 | vmlinux.s: vmlinux |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 70 | $(call if_changed,disasm) |
| 71 | |
Haavard Skinnemoen | 0430fb2 | 2006-10-24 10:12:39 +0200 | [diff] [blame] | 72 | vmlinux.lst: vmlinux |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 73 | $(call if_changed,listing) |
| 74 | |
Haavard Skinnemoen | 0430fb2 | 2006-10-24 10:12:39 +0200 | [diff] [blame] | 75 | CLEAN_FILES += vmlinux.s vmlinux.lst |
| 76 | |
| 77 | archclean: |
| 78 | $(Q)$(MAKE) $(clean)=$(boot) |
| 79 | |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 80 | define archhelp |
| 81 | @echo '* vmlinux.elf - ELF image with load address 0' |
| 82 | @echo ' vmlinux.cso - PathFinder CSO image' |
Haavard Skinnemoen | 0430fb2 | 2006-10-24 10:12:39 +0200 | [diff] [blame] | 83 | @echo '* uImage - Create a bootable image for U-Boot' |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 84 | endef |