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