2 # This file is subject to the terms and conditions of the GNU General Public
3 # License. See the file "COPYING" in the main directory of this archive
6 # Copyright (C) 2000, 2001 Paolo Alberelli
7 # Copyright (C) 2003 Paul Mundt
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
14 # Note that top level Makefile automagically builds dependencies for SUBDIRS
15 # but does not automagically clean SUBDIRS. Therefore "archclean" should clean
16 # up all, "archdep" does nothing on added SUBDIRS.
20 cpu-$(CONFIG_LITTLE_ENDIAN) := -ml
22 cpu-$(CONFIG_CPU_SH5) += -m5-32media-nofpu
24 ifdef CONFIG_LITTLE_ENDIAN
25 LDFLAGS += -EL -mshlelf32_linux
27 LDFLAGS += -EB -mshelf32_linux
30 # No requirements for endianess support from AFLAGS, 'as' always run through gcc
31 AFLAGS += -m5 -isa=sh64 -traditional
34 ENTRY_POINT = --defsym phys_stext=_stext-0x$(CONFIG_CACHED_MEMORY_OFFSET) \
36 OBJCOPY = $(CROSS_COMPILE)objcopy -O binary -R .note -R .comment \
37 -R .stab -R .stabstr -S
38 LD = $(CROSS_COMPILE)ld $(LDFLAGS)
40 LINKFLAGS += -T arch/$(ARCH)/vmlinux.lds $(ENTRY_POINT)
43 LINKFLAGS += -Ttext $(word 1,$(LOADADDR))
46 machine-$(CONFIG_SH_CAYMAN) := cayman
47 machine-$(CONFIG_SH_SIMULATOR) := sim
48 machine-$(CONFIG_SH_HARP) := harp
50 HEAD := arch/$(ARCH)/kernel/head.o arch/$(ARCH)/kernel/init_task.o
53 SUBDIRS += $(addprefix arch/$(ARCH)/, kernel mm lib mach-$(machine-y))
54 CORE_FILES := arch/$(ARCH)/kernel/kernel.o arch/$(ARCH)/mm/mm.o \
55 arch/$(ARCH)/mach-$(machine-y)/$(machine-y).o \
58 LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
59 LIBS := $(TOPDIR)/arch/$(ARCH)/lib/lib.a $(LIBS) $(LIBGCC)
61 MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
64 # override the assembly rules
67 # $(CC) $(CFLAGS) $(AFLAGS) -c $< -o $*.o
69 vmlinux: arch/$(ARCH)/vmlinux.lds
71 arch/$(ARCH)/vmlinux.lds: arch/$(ARCH)/vmlinux.lds.S FORCE
72 $(CPP) $(TOOLCHAIN) $(AFLAGS) -C -P -I$(HPATH) -U$(ARCH) arch/$(ARCH)/vmlinux.lds.S >arch/$(ARCH)/vmlinux.lds
88 rm -f arch/$(ARCH)/vmlinux.lds