1 # $Id: Makefile,v 1.6 2000/06/10 03:03:52 gniibe Exp $
2 #
3 # This file is subject to the terms and conditions of the GNU General Public
4 # License. See the file "COPYING" in the main directory of this archive
5 # for more details.
6 #
7 # Copyright (C) 1999 Kaz Kojima
8 #
9 # This file is included by the global makefile so that you can add your own
10 # architecture-specific flags and dependencies. Remember to do have actions
11 # for "archclean" and "archdep" for cleaning up and making dependencies for
12 # this architecture
13 #
14
15 #
16 # Select the object file format to substitute into the linker script.
17 #
18 tool_prefix = sh-linux-gnu-
19
20 ifdef CONFIG_CPU_LITTLE_ENDIAN
21 CFLAGS += -ml
22 AFLAGS += -ml
23 # LINKFLAGS += -EL
24 LDFLAGS := -EL
25 else
26 CFLAGS += -mb
27 AFLAGS += -mb
28 # LINKFLAGS += -EB
29 LDFLAGS := -EB
30 endif
31
32 # ifdef CONFIG_CROSSCOMPILE
33 CROSS_COMPILE = $(tool_prefix)
34 # endif
35
36 LD =$(CROSS_COMPILE)ld $(LDFLAGS)
37 OBJCOPY=$(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -R .stab -R .stabstr -S
38
39 MODFLAGS +=
40
41 #
42 #
43
44 ifdef CONFIG_CPU_SH3
45 CFLAGS += -m3
46 AFLAGS += -m3
47 endif
48 ifdef CONFIG_CPU_SH4
49 CFLAGS += -m4-nofpu
50 AFLAGS += -m4-nofpu
51 endif
52
53 #
54 # Choosing incompatible machines durings configuration will result in
55 # error messages during linking. Select a default linkscript if
56 # none has been choosen above.
57 #
58 LINKSCRIPT = arch/sh/vmlinux.lds
59 LINKFLAGS += -T $(word 1,$(LINKSCRIPT)) -e _stext
60
61 ifdef LOADADDR
62 LINKFLAGS += -Ttext $(word 1,$(LOADADDR))
63 endif
64
65 #
66 CFLAGS += -pipe
67
68 HEAD := arch/sh/kernel/head.o arch/sh/kernel/init_task.o
69
70 SUBDIRS := $(SUBDIRS) $(addprefix arch/sh/, kernel mm lib)
71 CORE_FILES := arch/sh/kernel/kernel.o arch/sh/mm/mm.o $(CORE_FILES)
72 LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
73 LIBS := $(TOPDIR)/arch/sh/lib/lib.a $(LIBS) $(TOPDIR)/arch/sh/lib/lib.a \
74 $(LIBGCC)
75
76 MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
77
78 vmlinux: arch/sh/vmlinux.lds
79
80 arch/sh/vmlinux.lds: arch/sh/vmlinux.lds.S FORCE
81 $(CPP) -traditional -C -P -I$(HPATH) -Ush arch/sh/vmlinux.lds.S >arch/sh/vmlinux.lds
82
83 FORCE: ;
84
85 zImage: vmlinux
86 @$(MAKEBOOT) zImage
87
88 compressed: zImage
89
90 zdisk: vmlinux
91 @$(MAKEBOOT) zdisk
92
93 archclean:
94 @$(MAKEBOOT) clean
95 $(MAKE) -C arch/$(ARCH)/kernel clean
96 # $(MAKE) -C arch/$(ARCH)/tools clean
97
98 archmrproper:
99 rm -f arch/sh/vmlinux.lds
100
101 archdep:
102 @$(MAKEBOOT) dep
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.