]>
Commit | Line | Data |
---|---|---|
5f97f7f9 HS |
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 | |
0430fb20 | 10 | all: uImage vmlinux.elf |
5f97f7f9 HS |
11 | |
12 | KBUILD_DEFCONFIG := atstk1002_defconfig | |
13 | ||
a0f97e06 | 14 | KBUILD_CFLAGS += -pipe -fno-builtin -mno-pic |
222d394d | 15 | KBUILD_AFLAGS += -mrelax -mno-pic |
5f97f7f9 HS |
16 | CFLAGS_MODULE += -mno-relax |
17 | LDFLAGS_vmlinux += --relax | |
18 | ||
c19aa754 | 19 | cpuflags-$(CONFIG_CPU_AT32AP7000) += -mcpu=ap7000 |
5f97f7f9 | 20 | |
a0f97e06 | 21 | KBUILD_CFLAGS += $(cpuflags-y) |
222d394d | 22 | KBUILD_AFLAGS += $(cpuflags-y) |
5f97f7f9 | 23 | |
0430fb20 | 24 | CHECKFLAGS += -D__avr32__ -D__BIG_ENDIAN |
5f97f7f9 HS |
25 | |
26 | head-$(CONFIG_LOADER_U_BOOT) += arch/avr32/boot/u-boot/head.o | |
27 | head-y += arch/avr32/kernel/head.o | |
28 | core-$(CONFIG_PLATFORM_AT32AP) += arch/avr32/mach-at32ap/ | |
29 | core-$(CONFIG_BOARD_ATSTK1000) += arch/avr32/boards/atstk1000/ | |
9ca20a83 | 30 | core-$(CONFIG_BOARD_ATNGW100) += arch/avr32/boards/atngw100/ |
5f97f7f9 HS |
31 | core-$(CONFIG_LOADER_U_BOOT) += arch/avr32/boot/u-boot/ |
32 | core-y += arch/avr32/kernel/ | |
33 | core-y += arch/avr32/mm/ | |
0430fb20 | 34 | libs-y += arch/avr32/lib/ |
5f97f7f9 HS |
35 | |
36 | archincdir-$(CONFIG_PLATFORM_AT32AP) := arch-at32ap | |
37 | ||
38 | include/asm-avr32/.arch: $(wildcard include/config/platform/*.h) include/config/auto.conf | |
39 | @echo ' SYMLINK include/asm-avr32/arch -> include/asm-avr32/$(archincdir-y)' | |
40 | ifneq ($(KBUILD_SRC),) | |
41 | $(Q)mkdir -p include/asm-avr32 | |
42 | $(Q)ln -fsn $(srctree)/include/asm-avr32/$(archincdir-y) include/asm-avr32/arch | |
43 | else | |
44 | $(Q)ln -fsn $(archincdir-y) include/asm-avr32/arch | |
45 | endif | |
46 | @touch $@ | |
47 | ||
48 | archprepare: include/asm-avr32/.arch | |
49 | ||
0430fb20 HS |
50 | CLEAN_FILES += include/asm-avr32/.arch include/asm-avr32/arch |
51 | ||
5f97f7f9 HS |
52 | BOOT_TARGETS := vmlinux.elf vmlinux.bin uImage uImage.srec |
53 | ||
54 | .PHONY: $(BOOT_TARGETS) install | |
55 | ||
56 | boot := arch/$(ARCH)/boot/images | |
57 | ||
58 | KBUILD_IMAGE := $(boot)/uImage | |
59 | vmlinux.elf: KBUILD_IMAGE := $(boot)/vmlinux.elf | |
60 | vmlinux.cso: KBUILD_IMAGE := $(boot)/vmlinux.cso | |
61 | uImage.srec: KBUILD_IMAGE := $(boot)/uImage.srec | |
62 | uImage: KBUILD_IMAGE := $(boot)/uImage | |
63 | ||
64 | quiet_cmd_listing = LST $@ | |
65 | cmd_listing = avr32-linux-objdump $(OBJDUMPFLAGS) -lS $< > $@ | |
66 | quiet_cmd_disasm = DIS $@ | |
67 | cmd_disasm = avr32-linux-objdump $(OBJDUMPFLAGS) -d $< > $@ | |
68 | ||
69 | vmlinux.elf vmlinux.bin uImage.srec uImage vmlinux.cso: vmlinux | |
70 | $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ | |
71 | ||
72 | install: vmlinux | |
73 | $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@ | |
74 | ||
0430fb20 | 75 | vmlinux.s: vmlinux |
5f97f7f9 HS |
76 | $(call if_changed,disasm) |
77 | ||
0430fb20 | 78 | vmlinux.lst: vmlinux |
5f97f7f9 HS |
79 | $(call if_changed,listing) |
80 | ||
0430fb20 HS |
81 | CLEAN_FILES += vmlinux.s vmlinux.lst |
82 | ||
83 | archclean: | |
84 | $(Q)$(MAKE) $(clean)=$(boot) | |
85 | ||
5f97f7f9 HS |
86 | define archhelp |
87 | @echo '* vmlinux.elf - ELF image with load address 0' | |
88 | @echo ' vmlinux.cso - PathFinder CSO image' | |
0430fb20 | 89 | @echo '* uImage - Create a bootable image for U-Boot' |
5f97f7f9 | 90 | endef |