Makefile 2.5 KB
Newer Older
1
#
L
Linus Torvalds 已提交
2 3 4 5 6 7 8 9 10 11 12
# cris/Makefile
#
# This file is included by the global makefile so that you can add your own
# architecture-specific flags and dependencies. Remember to do have actions
# for "archclean" and "archdep" for cleaning up and making dependencies for
# this architecture
#
# This file is subject to the terms and conditions of the GNU General Public
# License.  See the file "COPYING" in the main directory of this archive
# for more details.

A
Adrian Bunk 已提交
13 14
KBUILD_DEFCONFIG := etrax-100lx_v2_defconfig

L
Linus Torvalds 已提交
15 16
arch-y := v10
arch-$(CONFIG_ETRAX_ARCH_V10) := v10
17
arch-$(CONFIG_ETRAX_ARCH_V32) := v32
L
Linus Torvalds 已提交
18

19 20 21 22 23
# No config available for make clean etc
mach-y := fs
mach-$(CONFIG_CRIS_MACH_ARTPEC3) := a3
mach-$(CONFIG_ETRAXFS) := fs

L
Linus Torvalds 已提交
24 25
ifneq ($(arch-y),)
SARCH := arch-$(arch-y)
26 27 28
inc := -Iarch/cris/include/uapi/$(SARCH)
inc += -Iarch/cris/include/$(SARCH)
inc += -Iarch/cris/include/uapi/$(SARCH)/arch
29
inc += -Iarch/cris/include/$(SARCH)/arch
L
Linus Torvalds 已提交
30 31
else
SARCH :=
32
inc :=
L
Linus Torvalds 已提交
33 34
endif

35 36
ifneq ($(mach-y),)
MACH := mach-$(mach-y)
37 38
inc += -Iarch/cris/include/$(SARCH)/$(MACH)/
inc += -Iarch/cris/include/$(SARCH)/$(MACH)/mach
39 40 41 42
else
MACH :=
endif

L
Linus Torvalds 已提交
43 44 45 46
LD = $(CROSS_COMPILE)ld -mcrislinux

OBJCOPYFLAGS := -O binary -R .note -R .comment -S

47 48 49
KBUILD_AFLAGS += -mlinux -march=$(arch-y) $(inc)
KBUILD_CFLAGS += -mlinux -march=$(arch-y) -pipe $(inc)
KBUILD_CPPFLAGS += $(inc)
L
Linus Torvalds 已提交
50 51

ifdef CONFIG_FRAME_POINTER
52 53
KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -g
KBUILD_CFLAGS += -fno-omit-frame-pointer
L
Linus Torvalds 已提交
54 55
endif

56
head-y := arch/cris/$(SARCH)/kernel/head.o
L
Linus Torvalds 已提交
57

58
LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libgcc.a)
L
Linus Torvalds 已提交
59

60 61
core-y		+= arch/cris/kernel/ arch/cris/mm/
core-y		+= arch/cris/$(SARCH)/kernel/ arch/cris/$(SARCH)/mm/
62
ifdef CONFIG_ETRAX_ARCH_V32
63
core-y		+= arch/cris/$(SARCH)/$(MACH)/
64
endif
65 66
drivers-y	+= arch/cris/$(SARCH)/drivers/
libs-y		+= arch/cris/$(SARCH)/lib/ $(LIBGCC)
L
Linus Torvalds 已提交
67

68
# cris source path
69
SRC_ARCH              = $(srctree)/arch/cris
70
# cris object files path
71
OBJ_ARCH              = $(objtree)/arch/cris
72

73
boot := arch/cris/boot
74
MACHINE := arch/cris/$(SARCH)
L
Linus Torvalds 已提交
75

76
all: zImage
L
Linus Torvalds 已提交
77

78 79
zImage Image: vmlinux
	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
L
Linus Torvalds 已提交
80

81
archprepare:
L
Linus Torvalds 已提交
82

83
archclean:
84 85
	$(Q)if [ -e arch/cris/boot ]; then \
		$(MAKE) $(clean)=arch/cris/boot; \
86 87 88
	fi

CLEAN_FILES += \
89 90 91 92
	$(boot)/zImage \
	$(boot)/compressed/decompress.bin \
	$(boot)/compressed/piggy.gz \
	$(boot)/rescue/rescue.bin
93

94

95
# MRPROPER_FILES +=
96 97

define archhelp
98 99
  echo  '* zImage        - Compressed kernel image (arch/cris/boot/zImage)'
  echo  '* Image         - Uncompressed kernel image (arch/cris/boot/Image)'
100
endef