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: Rodrigo R. Galvao <rosattig@linux.vnet.ibm.com> Reviewed-by: Mauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
parent
f8db2007ff
commit
badf436f6f
9 changed files with 29 additions and 27 deletions
|
@ -36,7 +36,7 @@ else
|
|||
KBUILD_DEFCONFIG := ppc64_defconfig
|
||||
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)
|
||||
|
||||
ifeq ($(new_nm),y)
|
||||
|
@ -74,7 +74,7 @@ KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
|
|||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
|
||||
ifdef CONFIG_CPU_LITTLE_ENDIAN
|
||||
KBUILD_CFLAGS += -mlittle-endian
|
||||
LDFLAGS += -EL
|
||||
LDEMULATION := lppc
|
||||
|
@ -117,7 +117,7 @@ LDFLAGS_vmlinux-$(CONFIG_RELOCATABLE) := -pie
|
|||
LDFLAGS_vmlinux := $(LDFLAGS_vmlinux-y)
|
||||
LDFLAGS_vmlinux += $(call ld-option,--orphan-handling=warn)
|
||||
|
||||
ifeq ($(CONFIG_PPC64),y)
|
||||
ifdef CONFIG_PPC64
|
||||
ifeq ($(call cc-option-yn,-mcmodel=medium),y)
|
||||
# -mcmodel=medium breaks modules because it uses 32bit offsets from
|
||||
# the TOC pointer to create pointers where possible. Pointers into the
|
||||
|
@ -134,7 +134,7 @@ endif
|
|||
endif
|
||||
|
||||
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))
|
||||
AFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv2)
|
||||
else
|
||||
|
@ -148,8 +148,8 @@ CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mno-pointers-to-nested-functions)
|
|||
CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 $(MULTIPLEWORD)
|
||||
CFLAGS-$(CONFIG_PPC32) += $(call cc-option,-mno-readonly-in-sdata)
|
||||
|
||||
ifeq ($(CONFIG_PPC_BOOK3S_64),y)
|
||||
ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
|
||||
ifdef CONFIG_PPC_BOOK3S_64
|
||||
ifdef CONFIG_CPU_LITTLE_ENDIAN
|
||||
CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=power8
|
||||
CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=power9,-mtune=power8)
|
||||
else
|
||||
|
@ -173,7 +173,7 @@ CFLAGS-$(CONFIG_POWER9_CPU) += $(call cc-option,-mcpu=power9)
|
|||
CFLAGS-$(CONFIG_PPC_8xx) += $(call cc-option,-mcpu=860)
|
||||
|
||||
# Altivec option not allowed with e500mc64 in GCC.
|
||||
ifeq ($(CONFIG_ALTIVEC),y)
|
||||
ifdef CONFIG_ALTIVEC
|
||||
E5500_CPU := -mcpu=powerpc64
|
||||
else
|
||||
E5500_CPU := $(call cc-option,-mcpu=e500mc64,-mcpu=powerpc64)
|
||||
|
@ -181,8 +181,8 @@ endif
|
|||
CFLAGS-$(CONFIG_E5500_CPU) += $(E5500_CPU)
|
||||
CFLAGS-$(CONFIG_E6500_CPU) += $(call cc-option,-mcpu=e6500,$(E5500_CPU))
|
||||
|
||||
ifeq ($(CONFIG_PPC32),y)
|
||||
ifeq ($(CONFIG_PPC_E500MC),y)
|
||||
ifdef CONFIG_PPC32
|
||||
ifdef CONFIG_PPC_E500MC
|
||||
CFLAGS-y += $(call cc-option,-mcpu=e500mc,-mcpu=powerpc)
|
||||
else
|
||||
CFLAGS-$(CONFIG_E500) += $(call cc-option,-mcpu=8540 -msoft-float,-mcpu=powerpc)
|
||||
|
@ -204,7 +204,7 @@ else
|
|||
CHECKFLAGS += -D__LITTLE_ENDIAN__
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_476FPE_ERR46),y)
|
||||
ifdef CONFIG_476FPE_ERR46
|
||||
KBUILD_LDFLAGS_MODULE += --ppc476-workaround \
|
||||
-T $(srctree)/arch/powerpc/platforms/44x/ppc476_modules.lds
|
||||
endif
|
||||
|
@ -231,12 +231,12 @@ KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm)
|
|||
# often slow when they are implemented at all
|
||||
KBUILD_CFLAGS += $(call cc-option,-mno-string)
|
||||
|
||||
ifeq ($(CONFIG_6xx),y)
|
||||
ifdef CONFIG_6xx
|
||||
KBUILD_CFLAGS += -mcpu=powerpc
|
||||
endif
|
||||
|
||||
# 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
|
||||
endif
|
||||
|
||||
|
@ -395,7 +395,7 @@ install:
|
|||
$(Q)$(MAKE) $(build)=$(boot) install
|
||||
|
||||
vdso_install:
|
||||
ifeq ($(CONFIG_PPC64),y)
|
||||
ifdef CONFIG_PPC64
|
||||
$(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso64 $@
|
||||
endif
|
||||
$(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso32 $@
|
||||
|
|
|
@ -354,7 +354,7 @@ image-$(CONFIG_AMIGAONE) += cuImage.amigaone
|
|||
|
||||
# For 32-bit powermacs, build the COFF and miboot images
|
||||
# as well as the ELF images.
|
||||
ifeq ($(CONFIG_PPC32),y)
|
||||
ifdef CONFIG_PPC32
|
||||
image-$(CONFIG_PPC_PMAC) += zImage.coff zImage.miboot
|
||||
endif
|
||||
|
||||
|
|
|
@ -7,10 +7,10 @@ CFLAGS_ptrace.o += -DUTS_MACHINE='"$(UTS_MACHINE)"'
|
|||
|
||||
subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
|
||||
|
||||
ifeq ($(CONFIG_PPC64),y)
|
||||
ifdef CONFIG_PPC64
|
||||
CFLAGS_prom_init.o += $(NO_MINIMAL_TOC)
|
||||
endif
|
||||
ifeq ($(CONFIG_PPC32),y)
|
||||
ifdef CONFIG_PPC32
|
||||
CFLAGS_prom_init.o += -fPIC
|
||||
CFLAGS_btext.o += -fPIC
|
||||
endif
|
||||
|
@ -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_CRASH_DUMP) += crash_dump.o
|
||||
obj-$(CONFIG_FA_DUMP) += fadump.o
|
||||
ifeq ($(CONFIG_PPC32),y)
|
||||
ifdef CONFIG_PPC32
|
||||
obj-$(CONFIG_E500) += idle_e500.o
|
||||
endif
|
||||
obj-$(CONFIG_6xx) += idle_6xx.o l2cr_6xx.o cpu_setup_6xx.o
|
||||
obj-$(CONFIG_TAU) += tau_6xx.o
|
||||
obj-$(CONFIG_HIBERNATION) += swsusp.o suspend.o
|
||||
ifeq ($(CONFIG_FSL_BOOKE),y)
|
||||
ifdef CONFIG_FSL_BOOKE
|
||||
obj-$(CONFIG_HIBERNATION) += swsusp_booke.o
|
||||
else
|
||||
obj-$(CONFIG_HIBERNATION) += swsusp_$(BITS).o
|
||||
|
@ -110,9 +110,11 @@ obj-$(CONFIG_PCI_MSI) += msi.o
|
|||
obj-$(CONFIG_KEXEC_CORE) += machine_kexec.o crash.o \
|
||||
machine_kexec_$(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
|
||||
endif
|
||||
endif
|
||||
|
||||
obj-$(CONFIG_AUDIT) += audit.o
|
||||
obj64-$(CONFIG_AUDIT) += compat_audit.o
|
||||
|
@ -165,7 +167,7 @@ PHONY += systbl_chk
|
|||
systbl_chk: $(src)/systbl_chk.sh $(obj)/systbl_chk.i
|
||||
$(call cmd,systbl_chk)
|
||||
|
||||
ifeq ($(CONFIG_PPC_OF_BOOT_TRAMPOLINE),y)
|
||||
ifdef CONFIG_PPC_OF_BOOT_TRAMPOLINE
|
||||
$(obj)/built-in.a: prom_init_check
|
||||
|
||||
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
|
|||
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) += 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_64K_PAGES) += hash64_64k.o
|
||||
endif
|
||||
|
@ -31,7 +31,7 @@ obj-$(CONFIG_NEED_MULTIPLE_NODES) += numa.o
|
|||
obj-$(CONFIG_PPC_SPLPAR) += vphn.o
|
||||
obj-$(CONFIG_PPC_MM_SLICES) += slice.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_RADIX_MMU) += hugetlbpage-radix.o
|
||||
obj-$(CONFIG_PPC_BOOK3E_MMU) += hugetlbpage-book3e.o
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# Arch-specific network modules
|
||||
#
|
||||
ifeq ($(CONFIG_PPC64),y)
|
||||
ifdef CONFIG_PPC64
|
||||
obj-$(CONFIG_BPF_JIT) += bpf_jit_comp64.o
|
||||
else
|
||||
obj-$(CONFIG_BPF_JIT) += bpf_jit_asm.o bpf_jit_comp.o
|
||||
|
|
|
@ -11,7 +11,7 @@ obj-$(CONFIG_PPC_LITE5200) += lite5200.o
|
|||
obj-$(CONFIG_PPC_MEDIA5200) += media5200.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
|
||||
endif
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ obj-$(CONFIG_CBE_CPUFREQ_SPU_GOVERNOR) += cpufreq_spudemand.o
|
|||
|
||||
obj-$(CONFIG_PPC_IBM_CELL_POWERBUTTON) += cbe_powerbutton.o
|
||||
|
||||
ifeq ($(CONFIG_SMP),y)
|
||||
ifdef CONFIG_SMP
|
||||
obj-$(CONFIG_PPC_CELL_NATIVE) += smp.o
|
||||
endif
|
||||
|
||||
|
|
|
@ -25,6 +25,6 @@ obj-$(CONFIG_LPARCFG) += lparcfg.o
|
|||
obj-$(CONFIG_IBMVIO) += vio.o
|
||||
obj-$(CONFIG_IBMEBUS) += ibmebus.o
|
||||
|
||||
ifeq ($(CONFIG_PPC_PSERIES),y)
|
||||
ifdef CONFIG_PPC_PSERIES
|
||||
obj-$(CONFIG_SUSPEND) += suspend.o
|
||||
endif
|
||||
|
|
|
@ -48,7 +48,7 @@ obj-$(CONFIG_UCODE_PATCH) += micropatch.o
|
|||
obj-$(CONFIG_PPC_MPC512x) += mpc5xxx_clocks.o
|
||||
obj-$(CONFIG_PPC_MPC52xx) += mpc5xxx_clocks.o
|
||||
|
||||
ifeq ($(CONFIG_SUSPEND),y)
|
||||
ifdef CONFIG_SUSPEND
|
||||
obj-$(CONFIG_6xx) += 6xx-suspend.o
|
||||
endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue