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 |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 16 | CFLAGS_MODULE += -mno-relax |
| 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/ |
Haavard Skinnemoen | 9ca20a8 | 2007-04-12 17:26:57 +0200 | [diff] [blame] | 35 | core-$(CONFIG_BOARD_ATNGW100) += arch/avr32/boards/atngw100/ |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 36 | core-$(CONFIG_LOADER_U_BOOT) += arch/avr32/boot/u-boot/ |
| 37 | core-y += arch/avr32/kernel/ |
| 38 | core-y += arch/avr32/mm/ |
Haavard Skinnemoen | 2853ce5 | 2006-01-04 17:26:23 +0100 | [diff] [blame] | 39 | drivers-$(CONFIG_OPROFILE) += arch/avr32/oprofile/ |
Haavard Skinnemoen | 0430fb2 | 2006-10-24 10:12:39 +0200 | [diff] [blame] | 40 | libs-y += arch/avr32/lib/ |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 41 | |
| 42 | archincdir-$(CONFIG_PLATFORM_AT32AP) := arch-at32ap |
| 43 | |
| 44 | include/asm-avr32/.arch: $(wildcard include/config/platform/*.h) include/config/auto.conf |
| 45 | @echo ' SYMLINK include/asm-avr32/arch -> include/asm-avr32/$(archincdir-y)' |
| 46 | ifneq ($(KBUILD_SRC),) |
| 47 | $(Q)mkdir -p include/asm-avr32 |
| 48 | $(Q)ln -fsn $(srctree)/include/asm-avr32/$(archincdir-y) include/asm-avr32/arch |
| 49 | else |
| 50 | $(Q)ln -fsn $(archincdir-y) include/asm-avr32/arch |
| 51 | endif |
| 52 | @touch $@ |
| 53 | |
| 54 | archprepare: include/asm-avr32/.arch |
| 55 | |
Haavard Skinnemoen | 0430fb2 | 2006-10-24 10:12:39 +0200 | [diff] [blame] | 56 | CLEAN_FILES += include/asm-avr32/.arch include/asm-avr32/arch |
| 57 | |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 58 | BOOT_TARGETS := vmlinux.elf vmlinux.bin uImage uImage.srec |
| 59 | |
| 60 | .PHONY: $(BOOT_TARGETS) install |
| 61 | |
| 62 | boot := arch/$(ARCH)/boot/images |
| 63 | |
| 64 | KBUILD_IMAGE := $(boot)/uImage |
| 65 | vmlinux.elf: KBUILD_IMAGE := $(boot)/vmlinux.elf |
| 66 | vmlinux.cso: KBUILD_IMAGE := $(boot)/vmlinux.cso |
| 67 | uImage.srec: KBUILD_IMAGE := $(boot)/uImage.srec |
| 68 | uImage: KBUILD_IMAGE := $(boot)/uImage |
| 69 | |
| 70 | quiet_cmd_listing = LST $@ |
| 71 | cmd_listing = avr32-linux-objdump $(OBJDUMPFLAGS) -lS $< > $@ |
| 72 | quiet_cmd_disasm = DIS $@ |
| 73 | cmd_disasm = avr32-linux-objdump $(OBJDUMPFLAGS) -d $< > $@ |
| 74 | |
| 75 | vmlinux.elf vmlinux.bin uImage.srec uImage vmlinux.cso: vmlinux |
| 76 | $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ |
| 77 | |
| 78 | install: vmlinux |
| 79 | $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@ |
| 80 | |
Haavard Skinnemoen | 0430fb2 | 2006-10-24 10:12:39 +0200 | [diff] [blame] | 81 | vmlinux.s: vmlinux |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 82 | $(call if_changed,disasm) |
| 83 | |
Haavard Skinnemoen | 0430fb2 | 2006-10-24 10:12:39 +0200 | [diff] [blame] | 84 | vmlinux.lst: vmlinux |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 85 | $(call if_changed,listing) |
| 86 | |
Haavard Skinnemoen | 0430fb2 | 2006-10-24 10:12:39 +0200 | [diff] [blame] | 87 | CLEAN_FILES += vmlinux.s vmlinux.lst |
| 88 | |
| 89 | archclean: |
| 90 | $(Q)$(MAKE) $(clean)=$(boot) |
| 91 | |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 92 | define archhelp |
| 93 | @echo '* vmlinux.elf - ELF image with load address 0' |
| 94 | @echo ' vmlinux.cso - PathFinder CSO image' |
Haavard Skinnemoen | 0430fb2 | 2006-10-24 10:12:39 +0200 | [diff] [blame] | 95 | @echo '* uImage - Create a bootable image for U-Boot' |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 96 | endef |