Commit ba4ffd22 authored by Juerg Haefliger's avatar Juerg Haefliger Committed by Kleber Sacilotto de Souza

UBUNTU: SAUCE: bnxt_en_bpo: Drop distro out-of-tree detection logic

BugLink: http://bugs.launchpad.net/bugs/1711056

The provided Makefile is a generic out-of-tree Makefile that tries
to be smart and detect the source code location plus a few other
things based on the current distro. We don't need any of this since
we're adding the driver as an in-tree module, so get rid of it.
Signed-off-by: default avatarJuerg Haefliger <juerg.haefliger@canonical.com>
Acked-by: default avatarStefan Bader <stefan.bader@canonical.com>
Acked-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent a5ed3798
#!/usr/bin/make #!/usr/bin/make
# Makefile for building Linux Broadcom Gigabit ethernet driver as a module. # Makefile for building Linux Broadcom Gigabit ethernet driver as a module.
# $id$ # $id$
KVER=
ifeq ($(KVER),) LINUXSRC := $(srctree)
KVER=$(shell uname -r)
endif
__ARCH=$(shell uname -m)
# PREFIX may be set by the RPM build to set the effective root.
PREFIX=
ifeq ($(shell ls /lib/modules/$(KVER)/build > /dev/null 2>&1 && echo build),)
# SuSE source RPMs
_KVER=$(shell echo $(KVER) | cut -d "-" -f1,2)
_KFLA=$(shell echo $(KVER) | cut -d "-" -f3)
_ARCH=$(shell file -b /lib/modules/$(shell uname -r)/build | cut -d "/" -f5)
ifeq ($(_ARCH),)
_ARCH=$(__ARCH)
endif
ifeq ($(shell ls /usr/src/linux-$(_KVER)-obj > /dev/null 2>&1 && echo linux),)
ifeq ($(shell ls /usr/src/kernels/$(KVER)-$(__ARCH) > /dev/null 2>&1 && echo linux),)
LINUX=
else
LINUX=/usr/src/kernels/$(KVER)-$(__ARCH)
LINUXSRC=$(LINUX)
endif
else
LINUX=/usr/src/linux-$(_KVER)-obj/$(_ARCH)/$(_KFLA)
LINUXSRC=/usr/src/linux-$(_KVER)
endif
else
LINUX=/lib/modules/$(KVER)/build
ifeq ($(shell ls /lib/modules/$(KVER)/source > /dev/null 2>&1 && echo source),)
LINUXSRC=$(LINUX)
else
LINUXSRC=/lib/modules/$(KVER)/source
endif
endif
ifeq ($(shell ls $(LINUXSRC)/include/uapi/linux > /dev/null 2>&1 && echo uapi),) ifeq ($(shell ls $(LINUXSRC)/include/uapi/linux > /dev/null 2>&1 && echo uapi),)
UAPI= UAPI=
...@@ -44,22 +10,6 @@ else ...@@ -44,22 +10,6 @@ else
UAPI=uapi UAPI=uapi
endif endif
ifeq ($(BCMMODDIR),)
ifeq ($(shell ls /lib/modules/$(KVER)/updates > /dev/null 2>&1 && echo 1),1)
BCMMODDIR=/lib/modules/$(KVER)/updates
else
ifeq ($(shell grep -q "search.*[[:space:]]updates" /etc/depmod.conf > /dev/null 2>&1 && echo 1),1)
BCMMODDIR=/lib/modules/$(KVER)/updates
else
ifeq ($(shell grep -q "search.*[[:space:]]updates" /etc/depmod.d/* > /dev/null 2>&1 && echo 1),1)
BCMMODDIR=/lib/modules/$(KVER)/updates
else
BCMMODDIR=/lib/modules/$(KVER)/kernel/drivers/net
endif
endif
endif
endif
ifneq ($(shell grep -o "pci_enable_msix_range" $(LINUXSRC)/include/linux/pci.h),) ifneq ($(shell grep -o "pci_enable_msix_range" $(LINUXSRC)/include/linux/pci.h),)
DISTRO_CFLAG = -DHAVE_MSIX_RANGE DISTRO_CFLAG = -DHAVE_MSIX_RANGE
else else
...@@ -457,41 +407,5 @@ EXTRA_CFLAGS += ${DISTRO_CFLAG} -g -DCHIMP_FW -D__LINUX -DCONFIG_BNXT_SRIOV -DCO ...@@ -457,41 +407,5 @@ EXTRA_CFLAGS += ${DISTRO_CFLAG} -g -DCHIMP_FW -D__LINUX -DCONFIG_BNXT_SRIOV -DCO
cflags-y += $(EXTRA_CFLAGS) cflags-y += $(EXTRA_CFLAGS)
BCM_DRV = bnxt_en.ko
ifneq ($(KERNELRELEASE),)
obj-m += bnxt_en.o obj-m += bnxt_en.o
bnxt_en-y := bnxt.o bnxt_ethtool.o bnxt_sriov.o bnxt_dcb.o bnxt_ulp.o bnxt_xdp.o bnxt_ptp.o #decode_hsi.o bnxt_en-y := bnxt.o bnxt_ethtool.o bnxt_sriov.o bnxt_dcb.o bnxt_ulp.o bnxt_xdp.o bnxt_ptp.o #decode_hsi.o
else
default:
ifeq ($(CROSS_COMPILE),)
make -C $(LINUX) SUBDIRS=$(shell pwd) modules
else ifneq ($(CROSS_COMPILE),)
make -C $(LINUXSRC) SUBDIRS=$(shell pwd) modules CROSS_COMPILE=$(CROSS_COMPILE) ARCH=$(ARCH)
endif
yocto_all:
$(MAKE) -C $(LINUXSRC) M=$(shell pwd)
modules_install:
$(MAKE) -C $(LINUXSRC) M=$(shell pwd) modules_install
endif
install: default
mkdir -p $(PREFIX)/$(BCMMODDIR);
install -m 444 $(BCM_DRV) $(PREFIX)/$(BCMMODDIR);
@if [ "$(PREFIX)" = "" ]; then /sbin/depmod -a ;\
else echo " *** Run '/sbin/depmod -a' to update the module database.";\
fi
.PHONEY: all clean install
clean:
-rm -f bnxt.o bnxt.mod.c bnxt.mod.o .bnxt.*.cmd *.cmd *.markers *.order *.symvers decode_hsi.o .decode_*
-rm -rf .tmp_versions
-rm -rf bnxt_en.o bnxt_en.ko bnxt_en.mod.o bnxt_en.mod.c .bnxt_en.* bnxt_sriov.o .bnxt_sriov.* bnxt_ethtool.o .bnxt_ethtool.* bnxt_dcb.o .bnxt_dcb.* bnxt_ulp.o .bnxt_ulp.* bnxt_xdp.o .bnxt_xdp.*
-rm -f Module.markers Module.symvers modules.order
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