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
6 # Copyright (C) 2004-2006 Atmel Corporation.
8 # Default target when executing plain make
10 all: uImage vmlinux.elf
12 KBUILD_DEFCONFIG
:= atstk1002_defconfig
14 KBUILD_CFLAGS
+= -pipe
-fno-builtin
-mno-pic
-D__linux__
15 KBUILD_AFLAGS
+= -mrelax
-mno-pic
16 KBUILD_CFLAGS_MODULE
+= -mno-relax
17 LDFLAGS_vmlinux
+= --relax
19 cpuflags-
$(CONFIG_PLATFORM_AT32AP
) += -march
=ap
21 KBUILD_CFLAGS
+= $(cpuflags-y
)
22 KBUILD_AFLAGS
+= $(cpuflags-y
)
24 CHECKFLAGS
+= -D__avr32__
-D__BIG_ENDIAN
26 machine-
$(CONFIG_PLATFORM_AT32AP
) := at32ap
27 machdirs
:= $(patsubst %,arch
/avr32
/mach-
%/, $(machine-y
))
29 KBUILD_CPPFLAGS
+= $(patsubst %,-I
$(srctree
)/%include,$(machdirs
))
31 head-
$(CONFIG_LOADER_U_BOOT
) += arch
/avr32
/boot
/u-boot
/head.o
32 head-y
+= arch
/avr32
/kernel
/head.o
34 core-
$(CONFIG_BOARD_ATSTK1000
) += arch
/avr32
/boards
/atstk1000
/
35 core-
$(CONFIG_BOARD_ATNGW100_COMMON
) += 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_MERISC
) += arch
/avr32
/boards
/merisc
/
39 core-
$(CONFIG_BOARD_MIMC200
) += arch
/avr32
/boards
/mimc200
/
40 core-
$(CONFIG_LOADER_U_BOOT
) += arch
/avr32
/boot
/u-boot
/
41 core-y
+= arch
/avr32
/kernel
/
42 core-y
+= arch
/avr32
/mm
/
43 drivers-
$(CONFIG_OPROFILE
) += arch
/avr32
/oprofile
/
44 libs-y
+= arch
/avr32
/lib
/
46 BOOT_TARGETS
:= vmlinux.elf vmlinux.bin uImage uImage.srec
48 .PHONY
: $(BOOT_TARGETS
) install
50 boot
:= arch
/$(ARCH
)/boot
/images
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
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
$< > $@
63 vmlinux.elf vmlinux.bin uImage.srec uImage vmlinux.cso
: vmlinux
64 $(Q
)$(MAKE
) $(build
)=$(boot
) $(boot
)/$@
67 $(Q
)$(MAKE
) $(build
)=$(boot
) BOOTIMAGE
=$(KBUILD_IMAGE
) $@
70 $(call if_changed
,disasm
)
73 $(call if_changed
,listing
)
75 CLEAN_FILES
+= vmlinux.s vmlinux.lst
78 $(Q
)$(MAKE
) $(clean)=$(boot
)
81 @echo
'* vmlinux.elf - ELF image with load address 0'
82 @echo
' vmlinux.cso - PathFinder CSO image'
83 @echo
'* uImage - Create a bootable image for U-Boot'