Makefile 2.72 KB
Newer Older
Linus Torvalds's avatar
Linus Torvalds committed
1
# This file is included by the global makefile so that you can add your own
2
# architecture-specific flags and dependencies.
Linus Torvalds's avatar
Linus Torvalds committed
3 4 5 6 7 8 9 10 11 12
#
# 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.
#
# Copyright (C) 1994 by Linus Torvalds
# Changes for PPC by Gary Thomas
# Rewritten by Cort Dougan and Paul Mackerras
#

13
# This must match PAGE_OFFSET in include/asm-ppc/page.h.
14
KERNELLOAD	:= $(CONFIG_KERNEL_START)
Linus Torvalds's avatar
Linus Torvalds committed
15

16
LDFLAGS_vmlinux	:= -Ttext $(KERNELLOAD) -Bstatic
17 18 19
CPPFLAGS	+= -Iarch/$(ARCH)
AFLAGS		+= -Iarch/$(ARCH)
cflags-y	+= -Iarch/$(ARCH) -msoft-float -pipe \
20
		-ffixed-r2 -Wno-uninitialized -mmultiple -mstring
Linus Torvalds's avatar
Linus Torvalds committed
21 22
CPP		= $(CC) -E $(CFLAGS)

23 24
cflags-$(CONFIG_4xx)		+= -Wa,-m405
cflags-$(CONFIG_PPC64BRIDGE)	+= -Wa,-mppc64bridge
Linus Torvalds's avatar
Linus Torvalds committed
25

26
CFLAGS += $(cflags-y)
Linus Torvalds's avatar
Linus Torvalds committed
27

28

29 30 31
head-y				:= arch/ppc/kernel/head.o
head-$(CONFIG_8xx)		:= arch/ppc/kernel/head_8xx.o
head-$(CONFIG_4xx)		:= arch/ppc/kernel/head_4xx.o
32
head-$(CONFIG_44x)		:= arch/ppc/kernel/head_44x.o
33

34
head-$(CONFIG_6xx)		+= arch/ppc/kernel/idle_6xx.o
Linus Torvalds's avatar
Linus Torvalds committed
35

36
core-y				+= arch/ppc/kernel/ arch/ppc/platforms/ \
37
				   arch/ppc/mm/ arch/ppc/lib/ arch/ppc/syslib/
38
core-$(CONFIG_4xx)		+= arch/ppc/platforms/4xx/
39 40 41 42 43 44
core-$(CONFIG_MATH_EMULATION)	+= arch/ppc/math-emu/
core-$(CONFIG_XMON)		+= arch/ppc/xmon/
core-$(CONFIG_APUS)		+= arch/ppc/amiga/
drivers-$(CONFIG_8xx)		+= arch/ppc/8xx_io/
drivers-$(CONFIG_4xx)		+= arch/ppc/4xx_io/
drivers-$(CONFIG_8260)		+= arch/ppc/8260_io/
45
drivers-$(CONFIG_OCP)		+= arch/ppc/ocp/
Linus Torvalds's avatar
Linus Torvalds committed
46

47
BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd pImage vmlinux.sm
Linus Torvalds's avatar
Linus Torvalds committed
48

49
.PHONY: $(BOOT_TARGETS)
50

51 52
all: zImage

53 54
AFLAGS_vmlinux.lds.o	:= -Upowerpc

Linus Torvalds's avatar
Linus Torvalds committed
55 56 57
# All the instructions talk about "make bzImage".
bzImage: zImage

58
$(BOOT_TARGETS): vmlinux
59
	$(Q)$(MAKE) $(build)=arch/ppc/boot $@
Linus Torvalds's avatar
Linus Torvalds committed
60

Linus Torvalds's avatar
Linus Torvalds committed
61
%_config: arch/ppc/configs/%_defconfig
Linus Torvalds's avatar
Linus Torvalds committed
62
	rm -f .config arch/ppc/defconfig
63
	cp -f arch/ppc/configs/$(@:config=defconfig) .config
Linus Torvalds's avatar
Linus Torvalds committed
64 65

archclean:
66
	$(Q)$(MAKE) $(clean)=arch/ppc/boot
Linus Torvalds's avatar
Linus Torvalds committed
67

68 69 70 71 72
prepare: include/asm-$(ARCH)/offsets.h checkbin

arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
				   include/config/MARKER

73 74
include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s 
	$(call filechk,gen-asm-offsets)
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93

ifdef CONFIG_6xx
# Ensure this is binutils 2.12.1 (or 2.12.90.0.7) or later
NEW_AS	:= $(shell echo dssall | $(AS) -o /dev/null >/dev/null 2>&1 ; echo $$?)
GOODVER	:= 2.12.1
else
NEW_AS	:= 0
endif

ifneq ($(NEW_AS),0)
checkbin:
	@echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build'
	@echo 'correctly with old versions of binutils.'
	@echo '*** Please upgrade your binutils to ${GOODVER} or newer'
	@false
else
checkbin:
	@true
endif
94

95
CLEAN_FILES +=	include/asm-$(ARCH)/offsets.h \
96
		arch/$(ARCH)/kernel/asm-offsets.s