Commit badf436f authored by Rodrigo R. Galvao's avatar Rodrigo R. Galvao Committed by Michael Ellerman

powerpc/Makefiles: Convert ifeq to ifdef where possible

In Makefiles if we're testing a CONFIG_FOO symbol for equality with 'y'
we can instead just use ifdef. The latter reads easily, so convert to
it where possible.
Signed-off-by: default avatarRodrigo R. Galvao <rosattig@linux.vnet.ibm.com>
Reviewed-by: default avatarMauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent f8db2007
...@@ -36,7 +36,7 @@ else ...@@ -36,7 +36,7 @@ else
KBUILD_DEFCONFIG := ppc64_defconfig KBUILD_DEFCONFIG := ppc64_defconfig
endif endif
ifeq ($(CONFIG_PPC64),y) ifdef CONFIG_PPC64
new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi) new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi)
ifeq ($(new_nm),y) ifeq ($(new_nm),y)
...@@ -74,7 +74,7 @@ KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o ...@@ -74,7 +74,7 @@ KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
endif endif
endif endif
ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y) ifdef CONFIG_CPU_LITTLE_ENDIAN
KBUILD_CFLAGS += -mlittle-endian KBUILD_CFLAGS += -mlittle-endian
LDFLAGS += -EL LDFLAGS += -EL
LDEMULATION := lppc LDEMULATION := lppc
...@@ -117,7 +117,7 @@ LDFLAGS_vmlinux-$(CONFIG_RELOCATABLE) := -pie ...@@ -117,7 +117,7 @@ LDFLAGS_vmlinux-$(CONFIG_RELOCATABLE) := -pie
LDFLAGS_vmlinux := $(LDFLAGS_vmlinux-y) LDFLAGS_vmlinux := $(LDFLAGS_vmlinux-y)
LDFLAGS_vmlinux += $(call ld-option,--orphan-handling=warn) LDFLAGS_vmlinux += $(call ld-option,--orphan-handling=warn)
ifeq ($(CONFIG_PPC64),y) ifdef CONFIG_PPC64
ifeq ($(call cc-option-yn,-mcmodel=medium),y) ifeq ($(call cc-option-yn,-mcmodel=medium),y)
# -mcmodel=medium breaks modules because it uses 32bit offsets from # -mcmodel=medium breaks modules because it uses 32bit offsets from
# the TOC pointer to create pointers where possible. Pointers into the # the TOC pointer to create pointers where possible. Pointers into the
...@@ -134,7 +134,7 @@ endif ...@@ -134,7 +134,7 @@ endif
endif endif
CFLAGS-$(CONFIG_PPC64) := $(call cc-option,-mtraceback=no) CFLAGS-$(CONFIG_PPC64) := $(call cc-option,-mtraceback=no)
ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y) ifdef CONFIG_CPU_LITTLE_ENDIAN
CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv2,$(call cc-option,-mcall-aixdesc)) CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv2,$(call cc-option,-mcall-aixdesc))
AFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv2) AFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv2)
else else
...@@ -148,8 +148,8 @@ CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mno-pointers-to-nested-functions) ...@@ -148,8 +148,8 @@ CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mno-pointers-to-nested-functions)
CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 $(MULTIPLEWORD) CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 $(MULTIPLEWORD)
CFLAGS-$(CONFIG_PPC32) += $(call cc-option,-mno-readonly-in-sdata) CFLAGS-$(CONFIG_PPC32) += $(call cc-option,-mno-readonly-in-sdata)
ifeq ($(CONFIG_PPC_BOOK3S_64),y) ifdef CONFIG_PPC_BOOK3S_64
ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y) ifdef CONFIG_CPU_LITTLE_ENDIAN
CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=power8 CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=power8
CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=power9,-mtune=power8) CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=power9,-mtune=power8)
else else
...@@ -173,7 +173,7 @@ CFLAGS-$(CONFIG_POWER9_CPU) += $(call cc-option,-mcpu=power9) ...@@ -173,7 +173,7 @@ CFLAGS-$(CONFIG_POWER9_CPU) += $(call cc-option,-mcpu=power9)
CFLAGS-$(CONFIG_PPC_8xx) += $(call cc-option,-mcpu=860) CFLAGS-$(CONFIG_PPC_8xx) += $(call cc-option,-mcpu=860)
# Altivec option not allowed with e500mc64 in GCC. # Altivec option not allowed with e500mc64 in GCC.
ifeq ($(CONFIG_ALTIVEC),y) ifdef CONFIG_ALTIVEC
E5500_CPU := -mcpu=powerpc64 E5500_CPU := -mcpu=powerpc64
else else
E5500_CPU := $(call cc-option,-mcpu=e500mc64,-mcpu=powerpc64) E5500_CPU := $(call cc-option,-mcpu=e500mc64,-mcpu=powerpc64)
...@@ -181,8 +181,8 @@ endif ...@@ -181,8 +181,8 @@ endif
CFLAGS-$(CONFIG_E5500_CPU) += $(E5500_CPU) CFLAGS-$(CONFIG_E5500_CPU) += $(E5500_CPU)
CFLAGS-$(CONFIG_E6500_CPU) += $(call cc-option,-mcpu=e6500,$(E5500_CPU)) CFLAGS-$(CONFIG_E6500_CPU) += $(call cc-option,-mcpu=e6500,$(E5500_CPU))
ifeq ($(CONFIG_PPC32),y) ifdef CONFIG_PPC32
ifeq ($(CONFIG_PPC_E500MC),y) ifdef CONFIG_PPC_E500MC
CFLAGS-y += $(call cc-option,-mcpu=e500mc,-mcpu=powerpc) CFLAGS-y += $(call cc-option,-mcpu=e500mc,-mcpu=powerpc)
else else
CFLAGS-$(CONFIG_E500) += $(call cc-option,-mcpu=8540 -msoft-float,-mcpu=powerpc) CFLAGS-$(CONFIG_E500) += $(call cc-option,-mcpu=8540 -msoft-float,-mcpu=powerpc)
...@@ -204,7 +204,7 @@ else ...@@ -204,7 +204,7 @@ else
CHECKFLAGS += -D__LITTLE_ENDIAN__ CHECKFLAGS += -D__LITTLE_ENDIAN__
endif endif
ifeq ($(CONFIG_476FPE_ERR46),y) ifdef CONFIG_476FPE_ERR46
KBUILD_LDFLAGS_MODULE += --ppc476-workaround \ KBUILD_LDFLAGS_MODULE += --ppc476-workaround \
-T $(srctree)/arch/powerpc/platforms/44x/ppc476_modules.lds -T $(srctree)/arch/powerpc/platforms/44x/ppc476_modules.lds
endif endif
...@@ -231,12 +231,12 @@ KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm) ...@@ -231,12 +231,12 @@ KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm)
# often slow when they are implemented at all # often slow when they are implemented at all
KBUILD_CFLAGS += $(call cc-option,-mno-string) KBUILD_CFLAGS += $(call cc-option,-mno-string)
ifeq ($(CONFIG_6xx),y) ifdef CONFIG_6xx
KBUILD_CFLAGS += -mcpu=powerpc KBUILD_CFLAGS += -mcpu=powerpc
endif endif
# Work around a gcc code-gen bug with -fno-omit-frame-pointer. # Work around a gcc code-gen bug with -fno-omit-frame-pointer.
ifeq ($(CONFIG_FUNCTION_TRACER),y) ifdef CONFIG_FUNCTION_TRACER
KBUILD_CFLAGS += -mno-sched-epilog KBUILD_CFLAGS += -mno-sched-epilog
endif endif
...@@ -395,7 +395,7 @@ install: ...@@ -395,7 +395,7 @@ install:
$(Q)$(MAKE) $(build)=$(boot) install $(Q)$(MAKE) $(build)=$(boot) install
vdso_install: vdso_install:
ifeq ($(CONFIG_PPC64),y) ifdef CONFIG_PPC64
$(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso64 $@ $(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso64 $@
endif endif
$(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso32 $@ $(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso32 $@
......
...@@ -354,7 +354,7 @@ image-$(CONFIG_AMIGAONE) += cuImage.amigaone ...@@ -354,7 +354,7 @@ image-$(CONFIG_AMIGAONE) += cuImage.amigaone
# For 32-bit powermacs, build the COFF and miboot images # For 32-bit powermacs, build the COFF and miboot images
# as well as the ELF images. # as well as the ELF images.
ifeq ($(CONFIG_PPC32),y) ifdef CONFIG_PPC32
image-$(CONFIG_PPC_PMAC) += zImage.coff zImage.miboot image-$(CONFIG_PPC_PMAC) += zImage.coff zImage.miboot
endif endif
......
...@@ -7,10 +7,10 @@ CFLAGS_ptrace.o += -DUTS_MACHINE='"$(UTS_MACHINE)"' ...@@ -7,10 +7,10 @@ CFLAGS_ptrace.o += -DUTS_MACHINE='"$(UTS_MACHINE)"'
subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
ifeq ($(CONFIG_PPC64),y) ifdef CONFIG_PPC64
CFLAGS_prom_init.o += $(NO_MINIMAL_TOC) CFLAGS_prom_init.o += $(NO_MINIMAL_TOC)
endif endif
ifeq ($(CONFIG_PPC32),y) ifdef CONFIG_PPC32
CFLAGS_prom_init.o += -fPIC CFLAGS_prom_init.o += -fPIC
CFLAGS_btext.o += -fPIC CFLAGS_btext.o += -fPIC
endif endif
...@@ -63,13 +63,13 @@ obj-$(CONFIG_EEH) += eeh.o eeh_pe.o eeh_dev.o eeh_cache.o \ ...@@ -63,13 +63,13 @@ obj-$(CONFIG_EEH) += eeh.o eeh_pe.o eeh_dev.o eeh_cache.o \
obj-$(CONFIG_GENERIC_TBSYNC) += smp-tbsync.o obj-$(CONFIG_GENERIC_TBSYNC) += smp-tbsync.o
obj-$(CONFIG_CRASH_DUMP) += crash_dump.o obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
obj-$(CONFIG_FA_DUMP) += fadump.o obj-$(CONFIG_FA_DUMP) += fadump.o
ifeq ($(CONFIG_PPC32),y) ifdef CONFIG_PPC32
obj-$(CONFIG_E500) += idle_e500.o obj-$(CONFIG_E500) += idle_e500.o
endif endif
obj-$(CONFIG_6xx) += idle_6xx.o l2cr_6xx.o cpu_setup_6xx.o obj-$(CONFIG_6xx) += idle_6xx.o l2cr_6xx.o cpu_setup_6xx.o
obj-$(CONFIG_TAU) += tau_6xx.o obj-$(CONFIG_TAU) += tau_6xx.o
obj-$(CONFIG_HIBERNATION) += swsusp.o suspend.o obj-$(CONFIG_HIBERNATION) += swsusp.o suspend.o
ifeq ($(CONFIG_FSL_BOOKE),y) ifdef CONFIG_FSL_BOOKE
obj-$(CONFIG_HIBERNATION) += swsusp_booke.o obj-$(CONFIG_HIBERNATION) += swsusp_booke.o
else else
obj-$(CONFIG_HIBERNATION) += swsusp_$(BITS).o obj-$(CONFIG_HIBERNATION) += swsusp_$(BITS).o
...@@ -110,9 +110,11 @@ obj-$(CONFIG_PCI_MSI) += msi.o ...@@ -110,9 +110,11 @@ obj-$(CONFIG_PCI_MSI) += msi.o
obj-$(CONFIG_KEXEC_CORE) += machine_kexec.o crash.o \ obj-$(CONFIG_KEXEC_CORE) += machine_kexec.o crash.o \
machine_kexec_$(BITS).o machine_kexec_$(BITS).o
obj-$(CONFIG_KEXEC_FILE) += machine_kexec_file_$(BITS).o kexec_elf_$(BITS).o obj-$(CONFIG_KEXEC_FILE) += machine_kexec_file_$(BITS).o kexec_elf_$(BITS).o
ifeq ($(CONFIG_HAVE_IMA_KEXEC)$(CONFIG_IMA),yy) ifdef CONFIG_HAVE_IMA_KEXEC
ifdef CONFIG_IMA
obj-y += ima_kexec.o obj-y += ima_kexec.o
endif endif
endif
obj-$(CONFIG_AUDIT) += audit.o obj-$(CONFIG_AUDIT) += audit.o
obj64-$(CONFIG_AUDIT) += compat_audit.o obj64-$(CONFIG_AUDIT) += compat_audit.o
...@@ -165,7 +167,7 @@ PHONY += systbl_chk ...@@ -165,7 +167,7 @@ PHONY += systbl_chk
systbl_chk: $(src)/systbl_chk.sh $(obj)/systbl_chk.i systbl_chk: $(src)/systbl_chk.sh $(obj)/systbl_chk.i
$(call cmd,systbl_chk) $(call cmd,systbl_chk)
ifeq ($(CONFIG_PPC_OF_BOOT_TRAMPOLINE),y) ifdef CONFIG_PPC_OF_BOOT_TRAMPOLINE
$(obj)/built-in.a: prom_init_check $(obj)/built-in.a: prom_init_check
quiet_cmd_prom_init_check = CALL $< quiet_cmd_prom_init_check = CALL $<
......
...@@ -19,7 +19,7 @@ obj-$(CONFIG_PPC_BOOK3S_64) += pgtable-hash64.o hash_utils_64.o slb_low.o slb.o ...@@ -19,7 +19,7 @@ obj-$(CONFIG_PPC_BOOK3S_64) += pgtable-hash64.o hash_utils_64.o slb_low.o slb.o
obj-$(CONFIG_PPC_RADIX_MMU) += pgtable-radix.o tlb-radix.o obj-$(CONFIG_PPC_RADIX_MMU) += pgtable-radix.o tlb-radix.o
obj-$(CONFIG_PPC_STD_MMU_32) += ppc_mmu_32.o hash_low_32.o mmu_context_hash32.o obj-$(CONFIG_PPC_STD_MMU_32) += ppc_mmu_32.o hash_low_32.o mmu_context_hash32.o
obj-$(CONFIG_PPC_STD_MMU) += tlb_hash$(BITS).o obj-$(CONFIG_PPC_STD_MMU) += tlb_hash$(BITS).o
ifeq ($(CONFIG_PPC_BOOK3S_64),y) ifdef CONFIG_PPC_BOOK3S_64
obj-$(CONFIG_PPC_4K_PAGES) += hash64_4k.o obj-$(CONFIG_PPC_4K_PAGES) += hash64_4k.o
obj-$(CONFIG_PPC_64K_PAGES) += hash64_64k.o obj-$(CONFIG_PPC_64K_PAGES) += hash64_64k.o
endif endif
...@@ -31,7 +31,7 @@ obj-$(CONFIG_NEED_MULTIPLE_NODES) += numa.o ...@@ -31,7 +31,7 @@ obj-$(CONFIG_NEED_MULTIPLE_NODES) += numa.o
obj-$(CONFIG_PPC_SPLPAR) += vphn.o obj-$(CONFIG_PPC_SPLPAR) += vphn.o
obj-$(CONFIG_PPC_MM_SLICES) += slice.o obj-$(CONFIG_PPC_MM_SLICES) += slice.o
obj-y += hugetlbpage.o obj-y += hugetlbpage.o
ifeq ($(CONFIG_HUGETLB_PAGE),y) ifdef CONFIG_HUGETLB_PAGE
obj-$(CONFIG_PPC_BOOK3S_64) += hugetlbpage-hash64.o obj-$(CONFIG_PPC_BOOK3S_64) += hugetlbpage-hash64.o
obj-$(CONFIG_PPC_RADIX_MMU) += hugetlbpage-radix.o obj-$(CONFIG_PPC_RADIX_MMU) += hugetlbpage-radix.o
obj-$(CONFIG_PPC_BOOK3E_MMU) += hugetlbpage-book3e.o obj-$(CONFIG_PPC_BOOK3E_MMU) += hugetlbpage-book3e.o
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# #
# Arch-specific network modules # Arch-specific network modules
# #
ifeq ($(CONFIG_PPC64),y) ifdef CONFIG_PPC64
obj-$(CONFIG_BPF_JIT) += bpf_jit_comp64.o obj-$(CONFIG_BPF_JIT) += bpf_jit_comp64.o
else else
obj-$(CONFIG_BPF_JIT) += bpf_jit_asm.o bpf_jit_comp.o obj-$(CONFIG_BPF_JIT) += bpf_jit_asm.o bpf_jit_comp.o
......
...@@ -11,7 +11,7 @@ obj-$(CONFIG_PPC_LITE5200) += lite5200.o ...@@ -11,7 +11,7 @@ obj-$(CONFIG_PPC_LITE5200) += lite5200.o
obj-$(CONFIG_PPC_MEDIA5200) += media5200.o obj-$(CONFIG_PPC_MEDIA5200) += media5200.o
obj-$(CONFIG_PM) += mpc52xx_sleep.o mpc52xx_pm.o obj-$(CONFIG_PM) += mpc52xx_sleep.o mpc52xx_pm.o
ifeq ($(CONFIG_PPC_LITE5200),y) ifdef CONFIG_PPC_LITE5200
obj-$(CONFIG_PM) += lite5200_sleep.o lite5200_pm.o obj-$(CONFIG_PM) += lite5200_sleep.o lite5200_pm.o
endif endif
......
...@@ -10,7 +10,7 @@ obj-$(CONFIG_CBE_CPUFREQ_SPU_GOVERNOR) += cpufreq_spudemand.o ...@@ -10,7 +10,7 @@ obj-$(CONFIG_CBE_CPUFREQ_SPU_GOVERNOR) += cpufreq_spudemand.o
obj-$(CONFIG_PPC_IBM_CELL_POWERBUTTON) += cbe_powerbutton.o obj-$(CONFIG_PPC_IBM_CELL_POWERBUTTON) += cbe_powerbutton.o
ifeq ($(CONFIG_SMP),y) ifdef CONFIG_SMP
obj-$(CONFIG_PPC_CELL_NATIVE) += smp.o obj-$(CONFIG_PPC_CELL_NATIVE) += smp.o
endif endif
......
...@@ -25,6 +25,6 @@ obj-$(CONFIG_LPARCFG) += lparcfg.o ...@@ -25,6 +25,6 @@ obj-$(CONFIG_LPARCFG) += lparcfg.o
obj-$(CONFIG_IBMVIO) += vio.o obj-$(CONFIG_IBMVIO) += vio.o
obj-$(CONFIG_IBMEBUS) += ibmebus.o obj-$(CONFIG_IBMEBUS) += ibmebus.o
ifeq ($(CONFIG_PPC_PSERIES),y) ifdef CONFIG_PPC_PSERIES
obj-$(CONFIG_SUSPEND) += suspend.o obj-$(CONFIG_SUSPEND) += suspend.o
endif endif
...@@ -48,7 +48,7 @@ obj-$(CONFIG_UCODE_PATCH) += micropatch.o ...@@ -48,7 +48,7 @@ obj-$(CONFIG_UCODE_PATCH) += micropatch.o
obj-$(CONFIG_PPC_MPC512x) += mpc5xxx_clocks.o obj-$(CONFIG_PPC_MPC512x) += mpc5xxx_clocks.o
obj-$(CONFIG_PPC_MPC52xx) += mpc5xxx_clocks.o obj-$(CONFIG_PPC_MPC52xx) += mpc5xxx_clocks.o
ifeq ($(CONFIG_SUSPEND),y) ifdef CONFIG_SUSPEND
obj-$(CONFIG_6xx) += 6xx-suspend.o obj-$(CONFIG_6xx) += 6xx-suspend.o
endif endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment