Loading...
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
45KBUILD_AFLAGS += -mlinux -march=$(arch-y) $(inc)
46KBUILD_CFLAGS += -mlinux -march=$(arch-y) -pipe $(inc)
47KBUILD_CPPFLAGS += $(inc)
48
49ifdef CONFIG_FRAME_POINTER
50KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -g
51KBUILD_CFLAGS += -fno-omit-frame-pointer
52endif
53
54head-y := arch/cris/$(SARCH)/kernel/head.o
55
56LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libgcc.a)
57
58core-y += arch/cris/kernel arch/cris/mm/
59core-y += arch/cris/$(SARCH)/kernel/ arch/cris/$(SARCH)/mm/
60ifdef CONFIG_ETRAX_ARCH_V32
61core-y += arch/cris/$(SARCH)/$(MACH)/
62endif
63drivers-y += arch/cris/$(SARCH)/drivers/
64libs-y += arch/cris/$(SARCH)/lib/ $(LIBGCC)
65
66# cris source path
67SRC_ARCH = $(srctree)/arch/cris
68# cris object files path
69OBJ_ARCH = $(objtree)/arch/cris
70
71boot := arch/cris/boot
72MACHINE := arch/cris/$(SARCH)
73
74all: zImage
75
76zImage Image: vmlinux
77 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
78
79archprepare:
80
81archclean:
82 $(Q)if [ -e arch/cris/boot ]; then \
83 $(MAKE) $(clean)=arch/cris/boot; \
84 fi
85
86CLEAN_FILES += \
87 $(boot)/zImage \
88 $(boot)/compressed/decompress.bin \
89 $(boot)/compressed/piggy.gz \
90 $(boot)/rescue/rescue.bin
91
92
93# MRPROPER_FILES +=
94
95define archhelp
96 echo '* zImage - Compressed kernel image (arch/cris/boot/zImage)'
97 echo '* Image - Uncompressed kernel image (arch/cris/boot/Image)'
98endef
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/uapi/$(SARCH)
27inc += -Iarch/cris/include/$(SARCH)
28inc += -Iarch/cris/include/uapi/$(SARCH)/arch
29inc += -Iarch/cris/include/$(SARCH)/arch
30else
31SARCH :=
32inc :=
33endif
34
35ifneq ($(mach-y),)
36MACH := mach-$(mach-y)
37inc += -Iarch/cris/include/$(SARCH)/$(MACH)/
38inc += -Iarch/cris/include/$(SARCH)/$(MACH)/mach
39else
40MACH :=
41endif
42
43ifneq ($(CONFIG_BUILTIN_DTB),"")
44core-$(CONFIG_OF) += arch/cris/boot/dts
45endif
46
47LD = $(CROSS_COMPILE)ld -mcrislinux
48
49OBJCOPYFLAGS := -O binary -R .note -R .comment -S
50
51KBUILD_AFLAGS += -mlinux -march=$(arch-y) $(inc)
52KBUILD_CFLAGS += -mlinux -march=$(arch-y) -pipe $(inc)
53KBUILD_CPPFLAGS += $(inc)
54
55ifdef CONFIG_FRAME_POINTER
56KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -g
57KBUILD_CFLAGS += -fno-omit-frame-pointer
58endif
59
60head-y := arch/cris/$(SARCH)/kernel/head.o
61
62LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libgcc.a)
63
64core-y += arch/cris/kernel/ arch/cris/mm/
65core-y += arch/cris/$(SARCH)/kernel/ arch/cris/$(SARCH)/mm/
66ifdef CONFIG_ETRAX_ARCH_V32
67core-y += arch/cris/$(SARCH)/$(MACH)/
68endif
69drivers-y += arch/cris/$(SARCH)/drivers/
70libs-y += arch/cris/$(SARCH)/lib/ $(LIBGCC)
71
72# cris source path
73SRC_ARCH = $(srctree)/arch/cris
74# cris object files path
75OBJ_ARCH = $(objtree)/arch/cris
76
77boot := arch/cris/boot
78MACHINE := arch/cris/$(SARCH)
79
80all: zImage
81
82zImage Image: vmlinux
83 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
84
85archprepare:
86
87archclean:
88 $(Q)if [ -e arch/cris/boot ]; then \
89 $(MAKE) $(clean)=arch/cris/boot; \
90 fi
91
92CLEAN_FILES += \
93 $(boot)/zImage \
94 $(boot)/compressed/decompress.bin \
95 $(boot)/compressed/piggy.gz \
96 $(boot)/rescue/rescue.bin
97
98
99# MRPROPER_FILES +=
100
101define archhelp
102 echo '* zImage - Compressed kernel image (arch/cris/boot/zImage)'
103 echo '* Image - Uncompressed kernel image (arch/cris/boot/Image)'
104endef