Makefile revision 222d394d30e74bb7a2a65029fcea68107b0d0eb6
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
14a0f97e06a43cf524e616f09e6af3398e1e9c1c5bSam RavnborgKBUILD_CFLAGS	+= -pipe -fno-builtin -mno-pic
15222d394d30e74bb7a2a65029fcea68107b0d0eb6Sam RavnborgKBUILD_AFLAGS	+= -mrelax -mno-pic
165f97f7f9400de47ae837170bb274e90ad3934386Haavard SkinnemoenCFLAGS_MODULE	+= -mno-relax
175f97f7f9400de47ae837170bb274e90ad3934386Haavard SkinnemoenLDFLAGS_vmlinux	+= --relax
185f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
19c19aa754f32ff1dd7cb8e96454f5eba95c20585eHaavard Skinnemoencpuflags-$(CONFIG_CPU_AT32AP7000)	+= -mcpu=ap7000
205f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
21a0f97e06a43cf524e616f09e6af3398e1e9c1c5bSam RavnborgKBUILD_CFLAGS	+= $(cpuflags-y)
22222d394d30e74bb7a2a65029fcea68107b0d0eb6Sam RavnborgKBUILD_AFLAGS	+= $(cpuflags-y)
235f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
240430fb20a2a9f06262cb5ccc98869d54cdaa3963Haavard SkinnemoenCHECKFLAGS	+= -D__avr32__ -D__BIG_ENDIAN
255f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
265f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoenhead-$(CONFIG_LOADER_U_BOOT)		+= arch/avr32/boot/u-boot/head.o
275f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoenhead-y					+= arch/avr32/kernel/head.o
285f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoencore-$(CONFIG_PLATFORM_AT32AP)		+= arch/avr32/mach-at32ap/
295f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoencore-$(CONFIG_BOARD_ATSTK1000)		+= arch/avr32/boards/atstk1000/
309ca20a8366462c553c27216161c735937f9de108Haavard Skinnemoencore-$(CONFIG_BOARD_ATNGW100)		+= arch/avr32/boards/atngw100/
315f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoencore-$(CONFIG_LOADER_U_BOOT)		+= arch/avr32/boot/u-boot/
325f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoencore-y					+= arch/avr32/kernel/
335f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoencore-y					+= arch/avr32/mm/
340430fb20a2a9f06262cb5ccc98869d54cdaa3963Haavard Skinnemoenlibs-y					+= arch/avr32/lib/
355f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
365f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoenarchincdir-$(CONFIG_PLATFORM_AT32AP)	:= arch-at32ap
375f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
385f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoeninclude/asm-avr32/.arch: $(wildcard include/config/platform/*.h) include/config/auto.conf
395f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen	@echo '  SYMLINK include/asm-avr32/arch -> include/asm-avr32/$(archincdir-y)'
405f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoenifneq ($(KBUILD_SRC),)
415f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen	$(Q)mkdir -p include/asm-avr32
425f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen	$(Q)ln -fsn $(srctree)/include/asm-avr32/$(archincdir-y) include/asm-avr32/arch
435f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoenelse
445f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen	$(Q)ln -fsn $(archincdir-y) include/asm-avr32/arch
455f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoenendif
465f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen	@touch $@
475f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
485f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoenarchprepare: include/asm-avr32/.arch
495f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
500430fb20a2a9f06262cb5ccc98869d54cdaa3963Haavard SkinnemoenCLEAN_FILES += include/asm-avr32/.arch include/asm-avr32/arch
510430fb20a2a9f06262cb5ccc98869d54cdaa3963Haavard Skinnemoen
525f97f7f9400de47ae837170bb274e90ad3934386Haavard SkinnemoenBOOT_TARGETS := vmlinux.elf vmlinux.bin uImage uImage.srec
535f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
545f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen.PHONY: $(BOOT_TARGETS) install
555f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
565f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoenboot := arch/$(ARCH)/boot/images
575f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
585f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen             KBUILD_IMAGE := $(boot)/uImage
595f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoenvmlinux.elf: KBUILD_IMAGE := $(boot)/vmlinux.elf
605f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoenvmlinux.cso: KBUILD_IMAGE := $(boot)/vmlinux.cso
615f97f7f9400de47ae837170bb274e90ad3934386Haavard SkinnemoenuImage.srec: KBUILD_IMAGE := $(boot)/uImage.srec
625f97f7f9400de47ae837170bb274e90ad3934386Haavard SkinnemoenuImage:      KBUILD_IMAGE := $(boot)/uImage
635f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
645f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoenquiet_cmd_listing = LST     $@
655f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen      cmd_listing = avr32-linux-objdump $(OBJDUMPFLAGS) -lS $< > $@
665f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoenquiet_cmd_disasm  = DIS     $@
675f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen      cmd_disasm  = avr32-linux-objdump $(OBJDUMPFLAGS) -d $< > $@
685f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
695f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoenvmlinux.elf vmlinux.bin uImage.srec uImage vmlinux.cso: vmlinux
705f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
715f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
725f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoeninstall: vmlinux
735f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen	$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@
745f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
750430fb20a2a9f06262cb5ccc98869d54cdaa3963Haavard Skinnemoenvmlinux.s: vmlinux
765f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen	$(call if_changed,disasm)
775f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
780430fb20a2a9f06262cb5ccc98869d54cdaa3963Haavard Skinnemoenvmlinux.lst: vmlinux
795f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen	$(call if_changed,listing)
805f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen
810430fb20a2a9f06262cb5ccc98869d54cdaa3963Haavard SkinnemoenCLEAN_FILES += vmlinux.s vmlinux.lst
820430fb20a2a9f06262cb5ccc98869d54cdaa3963Haavard Skinnemoen
830430fb20a2a9f06262cb5ccc98869d54cdaa3963Haavard Skinnemoenarchclean:
840430fb20a2a9f06262cb5ccc98869d54cdaa3963Haavard Skinnemoen	$(Q)$(MAKE) $(clean)=$(boot)
850430fb20a2a9f06262cb5ccc98869d54cdaa3963Haavard Skinnemoen
865f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoendefine archhelp
875f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen  @echo '* vmlinux.elf		- ELF image with load address 0'
885f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoen  @echo '  vmlinux.cso		- PathFinder CSO image'
890430fb20a2a9f06262cb5ccc98869d54cdaa3963Haavard Skinnemoen  @echo '* uImage		- Create a bootable image for U-Boot'
905f97f7f9400de47ae837170bb274e90ad3934386Haavard Skinnemoenendef
91