From patchwork Thu Aug 17 06:24:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 802354 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical-com.20150623.gappssmtp.com header.i=@canonical-com.20150623.gappssmtp.com header.b="CVcS4ha2"; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3xXx6D3WS0z9t31; Thu, 17 Aug 2017 16:25:24 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1diEF6-00084P-GZ; Thu, 17 Aug 2017 06:25:20 +0000 Received: from mail-wr0-f175.google.com ([209.85.128.175]) by huckleberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1diEF1-000833-2b for kernel-team@lists.ubuntu.com; Thu, 17 Aug 2017 06:25:15 +0000 Received: by mail-wr0-f175.google.com with SMTP id z91so24907170wrc.4 for ; Wed, 16 Aug 2017 23:25:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=z1OLluqa3DzPBbyPAxKx8KD9E0Agyvbye4CuCsU3GrI=; b=CVcS4ha2haGvq/1tL2fT0OthwSYwsTCqX43QkiWSF6n92mNZ7VVomh3O2q59vNt5Ab WXVItZ5Dkh3FYgg3YXgnOKDRQOnIuJFmlR9bZ1F74kpQKgpMSkkbV35WadPPF4eafdGf RGSG9avpyBxiEZakOgx1FAGpyPRQFxBhAuuF/+4+phI0Rtw1MQ6AwtEvZJTT5kCj/KCZ TxvbyqBd76igjGbsEe1soHNpsMXkee9JSS5ieapkGgSL6imxjNAaHnO05y8heMIaqNqK eF3znlo+fjGpvjxvnjMOwRUGC+Pfxhk2qwxAf5ViOQbtOyjrBqEX1LSu/6qQoTB8zAFv Y+Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=z1OLluqa3DzPBbyPAxKx8KD9E0Agyvbye4CuCsU3GrI=; b=sEEXvl7cDYBIZ2ixyemJPauaVSfWvM+l5VAjIEZr/qEvJ0849h1PtJ8n0TNgy6ltFc Uxx6t/D1z+UogRe/X2QXir1QvFR9hzLc/gtpu4Ge72SFJiYVuZO/p0sBhoTBUG6eiEAJ ySwxlAK5a65hbky4gTus/HBIhlsvDURGdIZSwHkiDsUD+zJLZN103LIGJDS9vwNImNdK rIH+5xiKV/07RZEE1j4DQyeJaExgNP1Wkv/jUDgbNm4VCtkoYGAGDd+D7HtVoRYdr5UD 4i8AfKFchhQxQkgLJ7m1VjLgK+mk1m2Ppteg0A7hBWm447a9YJSQjxf/yVyzHZHU8Yk1 FbPQ== X-Gm-Message-State: AHYfb5jBXIe9Pqy2Egbs/St7F0Qc5Aem8S5+FPCo1wFzwBQWrJqLv4V/ rjFyQ3V/AdA53eTzjww= X-Received: by 10.80.161.165 with SMTP id 34mr845631edk.254.1502951114430; Wed, 16 Aug 2017 23:25:14 -0700 (PDT) Received: from localhost.localdomain (adsl-84-227-115-101.adslplus.ch. [84.227.115.101]) by smtp.gmail.com with ESMTPSA id n59sm1440186edc.31.2017.08.16.23.25.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Aug 2017 23:25:14 -0700 (PDT) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [xenial 2/7] UBUNTU: SAUCE: bnxt_en_bpo: Drop distro out-of-tree detection logic Date: Thu, 17 Aug 2017 08:24:52 +0200 Message-Id: <20170817062457.7379-3-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170817062457.7379-1-juerg.haefliger@canonical.com> References: <20170817062457.7379-1-juerg.haefliger@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com 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: Juerg Haefliger --- ubuntu/bnxt/Makefile | 90 ++-------------------------------------------------- 1 file changed, 2 insertions(+), 88 deletions(-) diff --git a/ubuntu/bnxt/Makefile b/ubuntu/bnxt/Makefile index 3531e72ffa15..e295011f99d9 100644 --- a/ubuntu/bnxt/Makefile +++ b/ubuntu/bnxt/Makefile @@ -1,42 +1,8 @@ #!/usr/bin/make # Makefile for building Linux Broadcom Gigabit ethernet driver as a module. # $id$ -KVER= -ifeq ($(KVER),) - 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 + +LINUXSRC := $(srctree) ifeq ($(shell ls $(LINUXSRC)/include/uapi/linux > /dev/null 2>&1 && echo uapi),) UAPI= @@ -44,22 +10,6 @@ else UAPI=uapi 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),) DISTRO_CFLAG = -DHAVE_MSIX_RANGE else @@ -457,41 +407,5 @@ EXTRA_CFLAGS += ${DISTRO_CFLAG} -g -DCHIMP_FW -D__LINUX -DCONFIG_BNXT_SRIOV -DCO cflags-y += $(EXTRA_CFLAGS) -BCM_DRV = bnxt_en.ko -ifneq ($(KERNELRELEASE),) - 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 - -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 -