From: Valentine Fatiev <valentinef@nvidia.com>
Subject: [PATCH] BACKPORT: drivers/net/ethernet/mellanox/mlx5/core/Makefile

Change-Id: I2f8b48afd05192e82a824cc45018b7dedde10750
---
 drivers/net/ethernet/mellanox/mlx5/core/Makefile | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

--- a/drivers/net/ethernet/mellanox/mlx5/core/Makefile
+++ b/drivers/net/ethernet/mellanox/mlx5/core/Makefile
@@ -21,6 +21,8 @@ mlx5_core-y :=	main.o cmd.o debugfs.o fw
 		sriov_sysfs.o crdump.o diag/diag_cnt.o fw_exp.o \
 		eswitch_devlink_compat.o ecpf.o wc.o
 
+mlx5_core-y += compat.o
+
 #
 # Netdev basic
 #
@@ -84,8 +86,12 @@ mlx5_core-$(CONFIG_MLX5_BRIDGE)    += es
 
 mlx5_core-$(CONFIG_HWMON)          += hwmon.o
 mlx5_core-$(CONFIG_MLX5_MPFS)      += lib/mpfs.o
-mlx5_core-$(CONFIG_VXLAN)          += lib/vxlan.o
-mlx5_core-$(CONFIG_PTP_1588_CLOCK) += lib/clock.o
+ifneq ($(CONFIG_VXLAN),)
+	mlx5_core-y		+= lib/vxlan.o
+endif
+ifneq ($(CONFIG_PTP_1588_CLOCK),)
+	mlx5_core-y		+= lib/clock.o
+endif
 mlx5_core-$(CONFIG_PCI_HYPERV_INTERFACE) += lib/hv.o lib/hv_vhca.o
 mlx5_core-$(CONFIG_MLXDEVM) += mlx5_devm.o esw/devm_port.o
 
