aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/Makefile')
-rw-r--r--arch/powerpc/Makefile56
1 files changed, 29 insertions, 27 deletions
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 6c1e36c33faa..643839a3f5d8 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -35,11 +35,14 @@ endif
35 35
36export CROSS32CC CROSS32AS CROSS32LD CROSS32AR CROSS32OBJCOPY 36export CROSS32CC CROSS32AS CROSS32LD CROSS32AR CROSS32OBJCOPY
37 37
38ifeq ($(CROSS_COMPILE),)
38KBUILD_DEFCONFIG := $(shell uname -m)_defconfig 39KBUILD_DEFCONFIG := $(shell uname -m)_defconfig
40else
41KBUILD_DEFCONFIG := ppc64_defconfig
42endif
39 43
40ifeq ($(CONFIG_PPC64),y) 44ifeq ($(CONFIG_PPC64),y)
41OLDARCH := ppc64 45OLDARCH := ppc64
42SZ := 64
43 46
44new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi) 47new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi)
45 48
@@ -49,22 +52,26 @@ endif
49 52
50else 53else
51OLDARCH := ppc 54OLDARCH := ppc
52SZ := 32 55endif
56
57# It seems there are times we use this Makefile without
58# including the config file, but this replicates the old behaviour
59ifeq ($(CONFIG_WORD_SIZE),)
60CONFIG_WORD_SIZE := 32
53endif 61endif
54 62
55UTS_MACHINE := $(OLDARCH) 63UTS_MACHINE := $(OLDARCH)
56 64
57ifeq ($(HAS_BIARCH),y) 65ifeq ($(HAS_BIARCH),y)
58override AS += -a$(SZ) 66override AS += -a$(CONFIG_WORD_SIZE)
59override LD += -m elf$(SZ)ppc 67override LD += -m elf$(CONFIG_WORD_SIZE)ppc
60override CC += -m$(SZ) 68override CC += -m$(CONFIG_WORD_SIZE)
61override AR := GNUTARGET=elf$(SZ)-powerpc $(AR) 69override AR := GNUTARGET=elf$(CONFIG_WORD_SIZE)-powerpc $(AR)
62endif 70endif
63 71
64LDFLAGS_vmlinux := -Bstatic 72LDFLAGS_vmlinux := -Bstatic
65 73
66# The -Iarch/$(ARCH)/include is temporary while we are merging 74CPPFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH)
67CPPFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH) -Iarch/$(ARCH)/include
68AFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH) 75AFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH)
69CFLAGS-$(CONFIG_PPC64) := -mminimal-toc -mtraceback=none -mcall-aixdesc 76CFLAGS-$(CONFIG_PPC64) := -mminimal-toc -mtraceback=none -mcall-aixdesc
70CFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH) -ffixed-r2 -mmultiple 77CFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH) -ffixed-r2 -mmultiple
@@ -72,11 +79,8 @@ CPPFLAGS += $(CPPFLAGS-y)
72AFLAGS += $(AFLAGS-y) 79AFLAGS += $(AFLAGS-y)
73CFLAGS += -msoft-float -pipe $(CFLAGS-y) 80CFLAGS += -msoft-float -pipe $(CFLAGS-y)
74CPP = $(CC) -E $(CFLAGS) 81CPP = $(CC) -E $(CFLAGS)
75# Temporary hack until we have migrated to asm-powerpc
76LINUXINCLUDE-$(CONFIG_PPC32) := -Iarch/$(ARCH)/include
77LINUXINCLUDE += $(LINUXINCLUDE-y)
78 82
79CHECKFLAGS += -m$(SZ) -D__powerpc__ -D__powerpc$(SZ)__ 83CHECKFLAGS += -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)__
80 84
81ifeq ($(CONFIG_PPC64),y) 85ifeq ($(CONFIG_PPC64),y)
82GCC_BROKEN_VEC := $(shell if [ $(call cc-version) -lt 0400 ] ; then echo "y"; fi) 86GCC_BROKEN_VEC := $(shell if [ $(call cc-version) -lt 0400 ] ; then echo "y"; fi)
@@ -96,6 +100,10 @@ else
96endif 100endif
97endif 101endif
98 102
103ifeq ($(CONFIG_TUNE_CELL),y)
104 CFLAGS += $(call cc-option,-mtune=cell)
105endif
106
99# No AltiVec instruction when building kernel 107# No AltiVec instruction when building kernel
100CFLAGS += $(call cc-option,-mno-altivec) 108CFLAGS += $(call cc-option,-mno-altivec)
101 109
@@ -120,10 +128,9 @@ cpu-as-$(CONFIG_E200) += -Wa,-me200
120AFLAGS += $(cpu-as-y) 128AFLAGS += $(cpu-as-y)
121CFLAGS += $(cpu-as-y) 129CFLAGS += $(cpu-as-y)
122 130
123head-y := arch/powerpc/kernel/head_32.o 131head-y := arch/powerpc/kernel/head_$(CONFIG_WORD_SIZE).o
124head-$(CONFIG_PPC64) := arch/powerpc/kernel/head_64.o
125head-$(CONFIG_8xx) := arch/powerpc/kernel/head_8xx.o 132head-$(CONFIG_8xx) := arch/powerpc/kernel/head_8xx.o
126head-$(CONFIG_4xx) := arch/powerpc/kernel/head_4xx.o 133head-$(CONFIG_40x) := arch/powerpc/kernel/head_40x.o
127head-$(CONFIG_44x) := arch/powerpc/kernel/head_44x.o 134head-$(CONFIG_44x) := arch/powerpc/kernel/head_44x.o
128head-$(CONFIG_FSL_BOOKE) := arch/powerpc/kernel/head_fsl_booke.o 135head-$(CONFIG_FSL_BOOKE) := arch/powerpc/kernel/head_fsl_booke.o
129 136
@@ -166,25 +173,20 @@ define archhelp
166 @echo ' *_defconfig - Select default config from arch/$(ARCH)/configs' 173 @echo ' *_defconfig - Select default config from arch/$(ARCH)/configs'
167endef 174endef
168 175
169install: 176install: vdso_install
170 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install 177 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install
171 178
179vdso_install:
180ifeq ($(CONFIG_PPC64),y)
181 $(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso64 $@
182endif
183 $(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso32 $@
184
172archclean: 185archclean:
173 $(Q)$(MAKE) $(clean)=$(boot) 186 $(Q)$(MAKE) $(clean)=$(boot)
174 187
175archmrproper:
176 $(Q)rm -rf arch/$(ARCH)/include
177
178archprepare: checkbin 188archprepare: checkbin
179 189
180ifeq ($(CONFIG_PPC32),y)
181# Temporary hack until we have migrated to asm-powerpc
182include/asm: arch/$(ARCH)/include/asm
183arch/$(ARCH)/include/asm: FORCE
184 $(Q)if [ ! -d arch/$(ARCH)/include ]; then mkdir -p arch/$(ARCH)/include; fi
185 $(Q)ln -fsn $(srctree)/include/asm-$(OLDARCH) arch/$(ARCH)/include/asm
186endif
187
188# Use the file '.tmp_gas_check' for binutils tests, as gas won't output 190# Use the file '.tmp_gas_check' for binutils tests, as gas won't output
189# to stdout and these checks are run even on install targets. 191# to stdout and these checks are run even on install targets.
190TOUT := .tmp_gas_check 192TOUT := .tmp_gas_check