• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# cris/Makefile
3#
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
7# this architecture
8#
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
11# for more details.
12
13KBUILD_DEFCONFIG := etrax-100lx_v2_defconfig
14
15arch-y := v10
16arch-$(CONFIG_ETRAX_ARCH_V10) := v10
17arch-$(CONFIG_ETRAX_ARCH_V32) := v32
18
19# No config available for make clean etc
20mach-y := fs
21mach-$(CONFIG_CRIS_MACH_ARTPEC3) := a3
22mach-$(CONFIG_ETRAXFS) := fs
23
24ifneq ($(arch-y),)
25SARCH := arch-$(arch-y)
26inc := -Iarch/cris/include/$(SARCH)
27inc += -Iarch/cris/include/$(SARCH)/arch
28else
29SARCH :=
30inc :=
31endif
32
33ifneq ($(mach-y),)
34MACH := mach-$(mach-y)
35inc += -Iarch/cris/include/$(SARCH)/$(MACH)/
36inc += -Iarch/cris/include/$(SARCH)/$(MACH)/mach
37else
38MACH :=
39endif
40
41LD = $(CROSS_COMPILE)ld -mcrislinux
42
43OBJCOPYFLAGS := -O binary -R .note -R .comment -S
44
45CPPFLAGS_vmlinux.lds = -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE)
46
47KBUILD_AFLAGS += -mlinux -march=$(arch-y) $(inc)
48KBUILD_CFLAGS += -mlinux -march=$(arch-y) -pipe $(inc)
49KBUILD_CPPFLAGS += $(inc)
50
51ifdef CONFIG_FRAME_POINTER
52KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -g
53KBUILD_CFLAGS += -fno-omit-frame-pointer
54endif
55
56head-y := arch/cris/$(SARCH)/kernel/head.o
57
58LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libgcc.a)
59
60core-y		+= arch/cris/kernel/ arch/cris/mm/
61core-y		+= arch/cris/$(SARCH)/kernel/ arch/cris/$(SARCH)/mm/
62ifdef CONFIG_ETRAX_ARCH_V32
63core-y		+= arch/cris/$(SARCH)/$(MACH)/
64endif
65drivers-y	+= arch/cris/$(SARCH)/drivers/
66libs-y		+= arch/cris/$(SARCH)/lib/ $(LIBGCC)
67
68# cris source path
69SRC_ARCH              = $(srctree)/arch/cris
70# cris object files path
71OBJ_ARCH              = $(objtree)/arch/cris
72
73boot := arch/cris/$(SARCH)/boot
74MACHINE := arch/cris/$(SARCH)
75
76all: zImage
77
78zImage Image: vmlinux
79	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
80
81archprepare:
82
83archclean:
84	$(Q)if [ -e arch/cris/$(SARCH)/boot ]; then \
85		$(MAKE) $(clean)=arch/cris/$(SARCH)/boot; \
86	fi
87
88CLEAN_FILES += \
89	$(MACHINE)/boot/zImage \
90	$(MACHINE)/boot/compressed/decompress.bin \
91	$(MACHINE)/boot/compressed/piggy.gz \
92	$(MACHINE)/boot/rescue/rescue.bin
93
94
95# MRPROPER_FILES +=
96
97define archhelp
98  echo  '* zImage        - Compressed kernel image (arch/cris/boot/zImage)'
99  echo  '* Image         - Uncompressed kernel image (arch/cris/boot/Image)'
100endef
101