blob: 76a8beec7d03e454d49e9da70a6c6dbc734566ef [file] [log] [blame]
GuanXuetao790edb62011-02-26 18:24:56 +08001#
2# arch/unicore32/Makefile
3#
4# This file is included by the global makefile so that you can add your own
5# architecture-specific flags and dependencies.
6#
7# This file is subject to the terms and conditions of the GNU General Public
8# License. See the file "COPYING" in the main directory of this archive
9# for more details.
10#
11# Copyright (C) 2002~2010 by Guan Xue-tao
12#
13ifneq ($(SUBARCH),$(ARCH))
14 ifeq ($(CROSS_COMPILE),)
15 CROSS_COMPILE := $(call cc-cross-prefix, unicore32-linux-)
16 endif
17endif
18
19LDFLAGS_vmlinux := -p --no-undefined -X
20
21OBJCOPYFLAGS := -O binary -R .note -R .note.gnu.build-id -R .comment -S
22
23# Never generate .eh_frame
24KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm)
25
26# Never use hard float in kernel
27KBUILD_CFLAGS += -msoft-float
28
29ifeq ($(CONFIG_FRAME_POINTER),y)
30KBUILD_CFLAGS += -mno-sched-prolog
31endif
32
33CHECKFLAGS += -D__unicore32__
34
35head-y := arch/unicore32/kernel/head.o
36head-y += arch/unicore32/kernel/init_task.o
37
38core-y += arch/unicore32/kernel/
39core-y += arch/unicore32/mm/
40
41libs-y += arch/unicore32/lib/
42
43ASM_GENERATED_DIR := $(srctree)/arch/unicore32/include/generated
44LINUXINCLUDE += -I$(ASM_GENERATED_DIR)
45
46ASM_GENERIC_HEADERS := atomic.h auxvec.h
47ASM_GENERIC_HEADERS += bitsperlong.h bug.h bugs.h
48ASM_GENERIC_HEADERS += cputime.h current.h
49ASM_GENERIC_HEADERS += device.h div64.h
50ASM_GENERIC_HEADERS += emergency-restart.h errno.h
Guan Xuetao0bfdc8e2011-03-29 22:17:42 +080051ASM_GENERIC_HEADERS += fb.h fcntl.h ftrace.h futex.h
GuanXuetao790edb62011-02-26 18:24:56 +080052ASM_GENERIC_HEADERS += hardirq.h hw_irq.h
53ASM_GENERIC_HEADERS += ioctl.h ioctls.h ipcbuf.h irq_regs.h
54ASM_GENERIC_HEADERS += kdebug.h kmap_types.h
55ASM_GENERIC_HEADERS += local.h
56ASM_GENERIC_HEADERS += mman.h module.h msgbuf.h
57ASM_GENERIC_HEADERS += param.h parport.h percpu.h poll.h posix_types.h
58ASM_GENERIC_HEADERS += resource.h
59ASM_GENERIC_HEADERS += scatterlist.h sections.h segment.h sembuf.h serial.h
60ASM_GENERIC_HEADERS += setup.h shmbuf.h shmparam.h
61ASM_GENERIC_HEADERS += siginfo.h signal.h sizes.h
62ASM_GENERIC_HEADERS += socket.h sockios.h stat.h statfs.h swab.h syscalls.h
63ASM_GENERIC_HEADERS += termbits.h termios.h topology.h types.h
64ASM_GENERIC_HEADERS += ucontext.h unaligned.h user.h
65ASM_GENERIC_HEADERS += vga.h
66ASM_GENERIC_HEADERS += xor.h
67
68archprepare:
69ifneq ($(ASM_GENERATED_DIR), $(wildcard $(ASM_GENERATED_DIR)))
70 $(Q)mkdir -p $(ASM_GENERATED_DIR)/asm
71 $(Q)$(foreach a, $(ASM_GENERIC_HEADERS), \
72 echo '#include <asm-generic/$a>' \
73 > $(ASM_GENERATED_DIR)/asm/$a; )
74endif
75
76boot := arch/unicore32/boot
77
78# Default target when executing plain make
79KBUILD_IMAGE := zImage
80
81all: $(KBUILD_IMAGE)
82
83zImage Image uImage: vmlinux
84 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
85
86MRPROPER_DIRS += $(ASM_GENERATED_DIR)
87
88archclean:
89 $(Q)$(MAKE) $(clean)=$(boot)
90
91define archhelp
92 echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
93 echo ' Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)'
94 echo ' uImage - U-Boot wrapped zImage'
95endef