Back to home page

LXR

 
 

    


0001 #
0002 # This file is subject to the terms and conditions of the GNU General Public
0003 # License.  See the file "COPYING" in the main directory of this archive
0004 # for more details.
0005 #
0006 # Copyright (C) 2004-2006 Atmel Corporation.
0007 
0008 # Default target when executing plain make
0009 .PHONY: all
0010 all: uImage vmlinux.elf
0011 
0012 KBUILD_DEFCONFIG        := atstk1002_defconfig
0013 
0014 KBUILD_CFLAGS   += -pipe -fno-builtin -mno-pic -D__linux__
0015 KBUILD_AFLAGS   += -mrelax -mno-pic
0016 KBUILD_CFLAGS_MODULE += -mno-relax
0017 LDFLAGS_vmlinux += --relax
0018 
0019 cpuflags-$(CONFIG_PLATFORM_AT32AP)      += -march=ap
0020 
0021 KBUILD_CFLAGS   += $(cpuflags-y)
0022 KBUILD_AFLAGS   += $(cpuflags-y)
0023 
0024 CHECKFLAGS      += -D__avr32__ -D__BIG_ENDIAN
0025 
0026 machine-$(CONFIG_PLATFORM_AT32AP) := at32ap
0027 machdirs        := $(patsubst %,arch/avr32/mach-%/, $(machine-y))
0028 
0029 KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs))
0030 
0031 head-$(CONFIG_LOADER_U_BOOT)            += arch/avr32/boot/u-boot/head.o
0032 head-y                                  += arch/avr32/kernel/head.o
0033 core-y                                  += $(machdirs)
0034 core-$(CONFIG_BOARD_ATSTK1000)          += arch/avr32/boards/atstk1000/
0035 core-$(CONFIG_BOARD_ATNGW100_COMMON)    += arch/avr32/boards/atngw100/
0036 core-$(CONFIG_BOARD_HAMMERHEAD)         += arch/avr32/boards/hammerhead/
0037 core-$(CONFIG_BOARD_FAVR_32)            += arch/avr32/boards/favr-32/
0038 core-$(CONFIG_BOARD_MERISC)             += arch/avr32/boards/merisc/
0039 core-$(CONFIG_BOARD_MIMC200)            += arch/avr32/boards/mimc200/
0040 core-$(CONFIG_LOADER_U_BOOT)            += arch/avr32/boot/u-boot/
0041 core-y                                  += arch/avr32/kernel/
0042 core-y                                  += arch/avr32/mm/
0043 drivers-$(CONFIG_OPROFILE)              += arch/avr32/oprofile/
0044 libs-y                                  += arch/avr32/lib/
0045 
0046 BOOT_TARGETS := vmlinux.elf vmlinux.bin uImage uImage.srec
0047 
0048 .PHONY: $(BOOT_TARGETS) install
0049 
0050 boot := arch/$(ARCH)/boot/images
0051 
0052              KBUILD_IMAGE := $(boot)/uImage
0053 vmlinux.elf: KBUILD_IMAGE := $(boot)/vmlinux.elf
0054 vmlinux.cso: KBUILD_IMAGE := $(boot)/vmlinux.cso
0055 uImage.srec: KBUILD_IMAGE := $(boot)/uImage.srec
0056 uImage:      KBUILD_IMAGE := $(boot)/uImage
0057 
0058 quiet_cmd_listing = LST     $@
0059       cmd_listing = avr32-linux-objdump $(OBJDUMPFLAGS) -lS $< > $@
0060 quiet_cmd_disasm  = DIS     $@
0061       cmd_disasm  = avr32-linux-objdump $(OBJDUMPFLAGS) -d $< > $@
0062 
0063 vmlinux.elf vmlinux.bin uImage.srec uImage vmlinux.cso: vmlinux
0064         $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
0065 
0066 install: vmlinux
0067         $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@
0068 
0069 vmlinux.s: vmlinux
0070         $(call if_changed,disasm)
0071 
0072 vmlinux.lst: vmlinux
0073         $(call if_changed,listing)
0074 
0075 CLEAN_FILES += vmlinux.s vmlinux.lst
0076 
0077 archclean:
0078         $(Q)$(MAKE) $(clean)=$(boot)
0079 
0080 define archhelp
0081   @echo '* vmlinux.elf          - ELF image with load address 0'
0082   @echo '  vmlinux.cso          - PathFinder CSO image'
0083   @echo '* uImage               - Create a bootable image for U-Boot'
0084 endef