# SPDX-License-Identifier: GPL-2.0-only
# Copyright (C) 1999 - 2023 Intel Corporation

#
# Makefile for the Intel(R) 10GbE PCI Express Linux Network Driver
#

obj-$(CONFIG_IXGBE) += ixgbe.o

define ixgbe-y
	ixgbe_main.o
	ixgbe_api.o
	ixgbe_common.o
	ixgbe_dcb.o
	ixgbe_dcb_82598.o
	ixgbe_dcb_82599.o
	ixgbe_ethtool.o
	ixgbe_lib.o
	ixgbe_mbx.o
	ixgbe_sriov.o
	ixgbe_param.o
	ixgbe_phy.o
	ixgbe_procfs.o
	ixgbe_xsk.o
	ixgbe_82598.o
	ixgbe_82599.o
	ixgbe_x540.o
	ixgbe_x550.o
endef
ixgbe-y := $(strip ${ixgbe-y})

ixgbe-${CONFIG_DCB} += ixgbe_dcb_nl.o

ixgbe-${CONFIG_DEBUG_FS} += ixgbe_debugfs.o

ixgbe-${CONFIG_FCOE:m=y} += ixgbe_fcoe.o

ixgbe-$(CONFIG_PTP_1588_CLOCK:m=y) += ixgbe_ptp.o

ixgbe-${CONFIG_SYSFS} += ixgbe_sysfs.o


ixgbe-y += kcompat.o


######################
# Kernel Build Macro #
######################

# customized kernelbuild function
#
# ${1} is the kernel build target
# ${2} may contain extra rules to pass to kernelbuild macro
#
# We customize the kernelbuild target in order to provide our hack to disable
# CONFIG_PTP_1588_CLOCK support should -DNO_PTP_SUPPORT be defined in the extra
# cflags given on the command line.
devkernelbuild = $(call kernelbuild,$(if $(filter -DNO_PTP_SUPPORT,${EXTRA_CFLAGS}),CONFIG_PTP_1588_CLOCK=n) ${2},${1})
