Makefile 2.8 KB
Newer Older
H
Haavard Skinnemoen 已提交
1 2 3 4 5 6 7 8 9
#
# This file is subject to the terms and conditions of the GNU General Public
# License.  See the file "COPYING" in the main directory of this archive
# for more details.
#
# Copyright (C) 2004-2006 Atmel Corporation.

# Default target when executing plain make
.PHONY: all
10
all: uImage vmlinux.elf
H
Haavard Skinnemoen 已提交
11 12 13

KBUILD_DEFCONFIG	:= atstk1002_defconfig

14
KBUILD_CFLAGS	+= -pipe -fno-builtin -mno-pic
15
KBUILD_AFLAGS	+= -mrelax -mno-pic
H
Haavard Skinnemoen 已提交
16 17 18
CFLAGS_MODULE	+= -mno-relax
LDFLAGS_vmlinux	+= --relax

19
cpuflags-$(CONFIG_PLATFORM_AT32AP)	+= -march=ap
H
Haavard Skinnemoen 已提交
20

21
KBUILD_CFLAGS	+= $(cpuflags-y)
22
KBUILD_AFLAGS	+= $(cpuflags-y)
H
Haavard Skinnemoen 已提交
23

24
CHECKFLAGS	+= -D__avr32__ -D__BIG_ENDIAN
H
Haavard Skinnemoen 已提交
25

26 27 28 29 30
machine-$(CONFIG_PLATFORM_AT32AP) := at32ap
machdirs	:= $(patsubst %,arch/avr32/mach-%/, $(machine-y))

KBUILD_CPPFLAGS	+= $(patsubst %,-I$(srctree)/%include,$(machdirs))

H
Haavard Skinnemoen 已提交
31 32
head-$(CONFIG_LOADER_U_BOOT)		+= arch/avr32/boot/u-boot/head.o
head-y					+= arch/avr32/kernel/head.o
33
core-y					+= $(machdirs)
H
Haavard Skinnemoen 已提交
34
core-$(CONFIG_BOARD_ATSTK1000)		+= arch/avr32/boards/atstk1000/
35
core-$(CONFIG_BOARD_ATNGW100)		+= arch/avr32/boards/atngw100/
H
Haavard Skinnemoen 已提交
36 37 38
core-$(CONFIG_LOADER_U_BOOT)		+= arch/avr32/boot/u-boot/
core-y					+= arch/avr32/kernel/
core-y					+= arch/avr32/mm/
H
Haavard Skinnemoen 已提交
39
drivers-$(CONFIG_OPROFILE)		+= arch/avr32/oprofile/
40
libs-y					+= arch/avr32/lib/
H
Haavard Skinnemoen 已提交
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55

archincdir-$(CONFIG_PLATFORM_AT32AP)	:= arch-at32ap

include/asm-avr32/.arch: $(wildcard include/config/platform/*.h) include/config/auto.conf
	@echo '  SYMLINK include/asm-avr32/arch -> include/asm-avr32/$(archincdir-y)'
ifneq ($(KBUILD_SRC),)
	$(Q)mkdir -p include/asm-avr32
	$(Q)ln -fsn $(srctree)/include/asm-avr32/$(archincdir-y) include/asm-avr32/arch
else
	$(Q)ln -fsn $(archincdir-y) include/asm-avr32/arch
endif
	@touch $@

archprepare: include/asm-avr32/.arch

56 57
CLEAN_FILES += include/asm-avr32/.arch include/asm-avr32/arch

H
Haavard Skinnemoen 已提交
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
BOOT_TARGETS := vmlinux.elf vmlinux.bin uImage uImage.srec

.PHONY: $(BOOT_TARGETS) install

boot := arch/$(ARCH)/boot/images

             KBUILD_IMAGE := $(boot)/uImage
vmlinux.elf: KBUILD_IMAGE := $(boot)/vmlinux.elf
vmlinux.cso: KBUILD_IMAGE := $(boot)/vmlinux.cso
uImage.srec: KBUILD_IMAGE := $(boot)/uImage.srec
uImage:      KBUILD_IMAGE := $(boot)/uImage

quiet_cmd_listing = LST     $@
      cmd_listing = avr32-linux-objdump $(OBJDUMPFLAGS) -lS $< > $@
quiet_cmd_disasm  = DIS     $@
      cmd_disasm  = avr32-linux-objdump $(OBJDUMPFLAGS) -d $< > $@

vmlinux.elf vmlinux.bin uImage.srec uImage vmlinux.cso: vmlinux
	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@

install: vmlinux
	$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@

81
vmlinux.s: vmlinux
H
Haavard Skinnemoen 已提交
82 83
	$(call if_changed,disasm)

84
vmlinux.lst: vmlinux
H
Haavard Skinnemoen 已提交
85 86
	$(call if_changed,listing)

87 88 89 90 91
CLEAN_FILES += vmlinux.s vmlinux.lst

archclean:
	$(Q)$(MAKE) $(clean)=$(boot)

H
Haavard Skinnemoen 已提交
92 93 94
define archhelp
  @echo '* vmlinux.elf		- ELF image with load address 0'
  @echo '  vmlinux.cso		- PathFinder CSO image'
95
  @echo '* uImage		- Create a bootable image for U-Boot'
H
Haavard Skinnemoen 已提交
96
endef