4 # This file is included by the global makefile so that you can add your own
5 # architecture-specific flags and dependencies. Remember to do have actions
6 # for "archclean" and "archdep" for cleaning up and making dependencies for
9 # This file is subject to the terms and conditions of the GNU General Public
10 # License. See the file "COPYING" in the main directory of this archive
13 KBUILD_DEFCONFIG := etrax-100lx_v2_defconfig
16 arch-$(CONFIG_ETRAX_ARCH_V10) := v10
17 arch-$(CONFIG_ETRAX_ARCH_V32) := v32
19 # No config available for make clean etc
21 mach-$(CONFIG_CRIS_MACH_ARTPEC3) := a3
22 mach-$(CONFIG_ETRAXFS) := fs
25 SARCH := arch-$(arch-y)
31 MACH := mach-$(mach-y)
36 LD = $(CROSS_COMPILE)ld -mcrislinux
38 OBJCOPYFLAGS := -O binary -R .note -R .comment -S
40 CPPFLAGS_vmlinux.lds = -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE)
42 KBUILD_AFLAGS += -mlinux -march=$(arch-y) -Iinclude/asm/arch/mach -Iinclude/asm/arch
44 KBUILD_CFLAGS += -mlinux -march=$(arch-y) -pipe -Iinclude/asm/arch/mach -Iinclude/asm/arch
46 ifdef CONFIG_FRAME_POINTER
47 KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -g
48 KBUILD_CFLAGS += -fno-omit-frame-pointer
51 head-y := arch/$(ARCH)/$(SARCH)/kernel/head.o
53 LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libgcc.a)
55 core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/
56 core-y += arch/$(ARCH)/$(SARCH)/kernel/ arch/$(ARCH)/$(SARCH)/mm/
57 ifdef CONFIG_ETRAX_ARCH_V32
58 core-y += arch/$(ARCH)/$(SARCH)/$(MACH)/
60 drivers-y += arch/$(ARCH)/$(SARCH)/drivers/
61 libs-y += arch/$(ARCH)/$(SARCH)/lib/ $(LIBGCC)
64 SRC_ARCH = $(srctree)/arch/$(ARCH)
65 # cris object files path
66 OBJ_ARCH = $(objtree)/arch/$(ARCH)
68 boot := arch/$(ARCH)/boot
69 MACHINE := arch/$(ARCH)/$(SARCH)
74 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
76 archprepare: $(SRC_ARCH)/.links $(srctree)/include/asm-$(ARCH)/.arch FORCE
78 # Create some links to make all tools happy
80 @rm -rf $(SRC_ARCH)/drivers
81 @ln -sfn $(SARCH)/drivers $(SRC_ARCH)/drivers
82 @rm -rf $(SRC_ARCH)/boot
83 @ln -sfn $(SARCH)/boot $(SRC_ARCH)/boot
84 @rm -rf $(SRC_ARCH)/lib
85 @ln -sfn $(SARCH)/lib $(SRC_ARCH)/lib
86 @rm -f $(SRC_ARCH)/arch/mach
87 @rm -rf $(SRC_ARCH)/arch
88 @ln -sfn $(SARCH) $(SRC_ARCH)/arch
89 ifdef CONFIG_ETRAX_ARCH_V32
90 @ln -sfn ../$(SARCH)/$(MACH) $(SRC_ARCH)/arch/mach
92 @rm -rf $(SRC_ARCH)/kernel/vmlinux.lds.S
93 @ln -sfn ../$(SARCH)/vmlinux.lds.S $(SRC_ARCH)/kernel/vmlinux.lds.S
94 @rm -rf $(SRC_ARCH)/kernel/asm-offsets.c
95 @ln -sfn ../$(SARCH)/kernel/asm-offsets.c $(SRC_ARCH)/kernel/asm-offsets.c
98 # Create link to sub arch includes
99 $(srctree)/include/asm-$(ARCH)/.arch: $(wildcard include/config/arch/*.h)
100 @echo ' SYMLINK include/asm-$(ARCH)/arch -> include/asm-$(ARCH)/$(SARCH)'
101 @rm -f $(srctree)/include/asm-$(ARCH)/arch/mach
102 @rm -f $(srctree)/include/asm-$(ARCH)/arch
103 @ln -sf $(SARCH) $(srctree)/include/asm-$(ARCH)/arch
104 ifdef CONFIG_ETRAX_ARCH_V32
105 @ln -sf $(MACH) $(srctree)/include/asm-$(ARCH)/arch/mach
110 $(Q)if [ -e arch/$(ARCH)/boot ]; then \
111 $(MAKE) $(clean)=arch/$(ARCH)/boot; \
115 $(MACHINE)/boot/zImage \
116 $(MACHINE)/boot/compressed/decompress.bin \
117 $(MACHINE)/boot/compressed/piggy.gz \
118 $(MACHINE)/boot/rescue/rescue.bin \
120 $(srctree)/include/asm-$(ARCH)/.arch
123 $(SRC_ARCH)/drivers \
127 $(SRC_ARCH)/kernel/vmlinux.lds.S \
128 $(SRC_ARCH)/kernel/asm-offsets.c
131 echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
132 echo '* Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)'