15f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen#
25f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen# This file is subject to the terms and conditions of the GNU General Public
35f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen# License.  See the file "COPYING" in the main directory of this archive
45f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen# for more details.
55f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen#
65f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen# Copyright (C) 2004-2006 Atmel Corporation.
75f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
85f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen# Default target when executing plain make
95f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen.PHONY: all
100430fb20a2a9f06262cb5ccc98869d54cdaa3963Haavard Skinnemoenall: uImage vmlinux.elf
115f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
125f97f7f9400de47ae837170bb274e90ad3934386Haavard SkinnemoenKBUILD_DEFCONFIG	:= atstk1002_defconfig
135f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
148d80390cfc9434d5aa4fb9e5f9768a66b30cb8a6Chen GangKBUILD_CFLAGS	+= -pipe -fno-builtin -mno-pic -D__linux__
15222d394d30e74bb7a2a65029fcea68107b0d0eb6Sam RavnborgKBUILD_AFLAGS	+= -mrelax -mno-pic
166588169d516560f68672e2928680b71c647b7806Sam RavnborgKBUILD_CFLAGS_MODULE += -mno-relax
175f97f7f9400de47ae837170bb274e90ad3934386Haavard SkinnemoenLDFLAGS_vmlinux	+= --relax
185f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
19438ff3f3cc33833206a48492e9d6674e4e82bed8Haavard Skinnemoencpuflags-$(CONFIG_PLATFORM_AT32AP)	+= -march=ap
205f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
21a0f97e06a43cf524e616f09e6af3398e1e9c1c5bSam RavnborgKBUILD_CFLAGS	+= $(cpuflags-y)
22222d394d30e74bb7a2a65029fcea68107b0d0eb6Sam RavnborgKBUILD_AFLAGS	+= $(cpuflags-y)
235f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
240430fb20a2a9f06262cb5ccc98869d54cdaa3963Haavard SkinnemoenCHECKFLAGS	+= -D__avr32__ -D__BIG_ENDIAN
255f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
26964d219b6a8a79ea4c8d77b6dcdcbbcda403c392Haavard Skinnemoenmachine-$(CONFIG_PLATFORM_AT32AP) := at32ap
27964d219b6a8a79ea4c8d77b6dcdcbbcda403c392Haavard Skinnemoenmachdirs	:= $(patsubst %,arch/avr32/mach-%/, $(machine-y))
28964d219b6a8a79ea4c8d77b6dcdcbbcda403c392Haavard Skinnemoen
29964d219b6a8a79ea4c8d77b6dcdcbbcda403c392Haavard SkinnemoenKBUILD_CPPFLAGS	+= $(patsubst %,-I$(srctree)/%include,$(machdirs))
30964d219b6a8a79ea4c8d77b6dcdcbbcda403c392Haavard Skinnemoen
315f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoenhead-$(CONFIG_LOADER_U_BOOT)		+= arch/avr32/boot/u-boot/head.o
325f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoenhead-y					+= arch/avr32/kernel/head.o
33964d219b6a8a79ea4c8d77b6dcdcbbcda403c392Haavard Skinnemoencore-y					+= $(machdirs)
345f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoencore-$(CONFIG_BOARD_ATSTK1000)		+= arch/avr32/boards/atstk1000/
353550b9313b88d9ae74812eaba22e0ddf9ac9f2aeHans-Christian Egtvedtcore-$(CONFIG_BOARD_ATNGW100_COMMON)	+= arch/avr32/boards/atngw100/
36dd5e1339e528197abdb7827663ff0673797fa088Alex Raimondicore-$(CONFIG_BOARD_HAMMERHEAD)		+= arch/avr32/boards/hammerhead/
3745c349b58c58f3922bfdec917aa30ff8425caa3fHans-Christian Egtvedtcore-$(CONFIG_BOARD_FAVR_32)		+= arch/avr32/boards/favr-32/
38a16fffdd8eb95ebab7dc22414896fe6493951e0eJonas Larssoncore-$(CONFIG_BOARD_MERISC)		+= arch/avr32/boards/merisc/
395b50c166b79ffa0a2e3b0f3785fa5263685a81f2Mark Jacksoncore-$(CONFIG_BOARD_MIMC200)		+= arch/avr32/boards/mimc200/
405f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoencore-$(CONFIG_LOADER_U_BOOT)		+= arch/avr32/boot/u-boot/
415f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoencore-y					+= arch/avr32/kernel/
425f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoencore-y					+= arch/avr32/mm/
432853ce5ecefe9d9ca119f33db0c23a3f075e35d9Haavard Skinnemoendrivers-$(CONFIG_OPROFILE)		+= arch/avr32/oprofile/
440430fb20a2a9f06262cb5ccc98869d54cdaa3963Haavard Skinnemoenlibs-y					+= arch/avr32/lib/
455f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
465f97f7f9400de47ae837170bb274e90ad3934386Haavard SkinnemoenBOOT_TARGETS := vmlinux.elf vmlinux.bin uImage uImage.srec
475f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
485f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen.PHONY: $(BOOT_TARGETS) install
495f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
505f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoenboot := arch/$(ARCH)/boot/images
515f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
525f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen             KBUILD_IMAGE := $(boot)/uImage
535f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoenvmlinux.elf: KBUILD_IMAGE := $(boot)/vmlinux.elf
545f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoenvmlinux.cso: KBUILD_IMAGE := $(boot)/vmlinux.cso
555f97f7f9400de47ae837170bb274e90ad3934386Haavard SkinnemoenuImage.srec: KBUILD_IMAGE := $(boot)/uImage.srec
565f97f7f9400de47ae837170bb274e90ad3934386Haavard SkinnemoenuImage:      KBUILD_IMAGE := $(boot)/uImage
575f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
585f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoenquiet_cmd_listing = LST     $@
595f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen      cmd_listing = avr32-linux-objdump $(OBJDUMPFLAGS) -lS $< > $@
605f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoenquiet_cmd_disasm  = DIS     $@
615f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen      cmd_disasm  = avr32-linux-objdump $(OBJDUMPFLAGS) -d $< > $@
625f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
635f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoenvmlinux.elf vmlinux.bin uImage.srec uImage vmlinux.cso: vmlinux
645f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
655f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
665f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoeninstall: vmlinux
675f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen	$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@
685f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
690430fb20a2a9f06262cb5ccc98869d54cdaa3963Haavard Skinnemoenvmlinux.s: vmlinux
705f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen	$(call if_changed,disasm)
715f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
720430fb20a2a9f06262cb5ccc98869d54cdaa3963Haavard Skinnemoenvmlinux.lst: vmlinux
735f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen	$(call if_changed,listing)
745f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
750430fb20a2a9f06262cb5ccc98869d54cdaa3963Haavard SkinnemoenCLEAN_FILES += vmlinux.s vmlinux.lst
760430fb20a2a9f06262cb5ccc98869d54cdaa3963Haavard Skinnemoen
770430fb20a2a9f06262cb5ccc98869d54cdaa3963Haavard Skinnemoenarchclean:
780430fb20a2a9f06262cb5ccc98869d54cdaa3963Haavard Skinnemoen	$(Q)$(MAKE) $(clean)=$(boot)
790430fb20a2a9f06262cb5ccc98869d54cdaa3963Haavard Skinnemoen
805f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoendefine archhelp
815f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen  @echo '* vmlinux.elf		- ELF image with load address 0'
825f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen  @echo '  vmlinux.cso		- PathFinder CSO image'
830430fb20a2a9f06262cb5ccc98869d54cdaa3963Haavard Skinnemoen  @echo '* uImage		- Create a bootable image for U-Boot'
845f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoenendef
85