Makefile 2.4 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
inc := -Iarch/cris/include/$(SARCH)
inc += -Iarch/cris/include/$(SARCH)/arch
L
Linus Torvalds 已提交
28 29
else
SARCH :=
30
inc :=
L
Linus Torvalds 已提交
31 32
endif

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

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

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

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

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

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

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

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

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

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

74
all: zImage
L
Linus Torvalds 已提交
75

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

79
archprepare:
L
Linus Torvalds 已提交
80

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

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

92

93
# MRPROPER_FILES +=
94 95

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