From patchwork Sat Jul 29 01:01:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= X-Patchwork-Id: 9869709 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B2E066038C for ; Sat, 29 Jul 2017 01:02:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 90CDA288E2 for ; Sat, 29 Jul 2017 01:02:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 859AD2891E; Sat, 29 Jul 2017 01:02:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACA572890E for ; Sat, 29 Jul 2017 01:02:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753175AbdG2BCA (ORCPT ); Fri, 28 Jul 2017 21:02:00 -0400 Received: from rere.qmqm.pl ([91.227.64.183]:60658 "EHLO rere.qmqm.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753131AbdG2BB7 (ORCPT ); Fri, 28 Jul 2017 21:01:59 -0400 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id A437EA7; Sat, 29 Jul 2017 03:01:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1501290117; bh=sxHbZXGcXRvOXW8PjCiS5vfEEgtCS5b3y59hBBszY/8=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=Go7xL298q9VZAEi/pdiFeGyYz3YjZ0tkX7AKtBcxv1cio9ih+bvwexikD151yGlvq D41VgHuT8I4RSuCmsD5GhG9UJ0/wFLLhIxl2jMZ/vDI9fD4FrkRDhNEyNb3NCMACnm WBHy6szTIUJINV5wm3Xw9Cdnn7BvKHhJ1GjAr8WG0HU98gZaZJyZ6iyjrKS7rul2gR jF9V/0T+To2hpGv3q3oBazO4kvvH0hoF8P4HrgFW36ivVYlHdBFKsv4SAAs4CDB9jk H20CFa0pk4cG2/zvnqIvaEkkm5dZw/Ls762pgdbt9XRDPJINrvnKkBv2/woJSzh1+K QO/94FS325QZA== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.99.2 at rere Date: Sat, 29 Jul 2017 03:01:57 +0200 Message-Id: In-Reply-To: References: From: =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= Subject: [PATCH 2/4] aic7xxx: fix aicasm out-of-tree build MIME-Version: 1.0 To: Hannes Reinecke Cc: linux-scsi@vger.kernel.org, "James E.J. Bottomley" , "Martin K. Petersen" Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix out-of-tree build with CONFIG_PREVENT_FIRMWARE_BUILD=n. [...] make[3]: *** No rule to make target 'drivers/scsi/aic7xxx/aicasm/*.[chyl]', needed by 'drivers/scsi/aic7xxx/aicasm/aicasm'. Stop. /mnt/src/jaja/git/scsi-upstream/Makefile:1682: recipe for target 'drivers/scsi/aic7xxx/' failed make[2]: *** [drivers/scsi/aic7xxx/] Error 2 [...] Signed-off-by: Michał Mirosław --- drivers/scsi/aic7xxx/Makefile | 36 ++++++++++++++++++------------------ drivers/scsi/aic7xxx/aicasm/Makefile | 3 ++- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/drivers/scsi/aic7xxx/Makefile b/drivers/scsi/aic7xxx/Makefile index 741d81861d17..d76cbbba795d 100644 --- a/drivers/scsi/aic7xxx/Makefile +++ b/drivers/scsi/aic7xxx/Makefile @@ -47,39 +47,39 @@ clean-files += aic79xx_seq.h aic79xx_reg.h aic79xx_reg_print.c $(addprefix $(obj)/,$(aic7xxx-y)): $(obj)/aic7xxx_seq.h $(obj)/aic7xxx_reg.h $(addprefix $(obj)/,$(aic79xx-y)): $(obj)/aic79xx_seq.h $(obj)/aic79xx_reg.h -aic7xxx-gen-$(CONFIG_AIC7XXX_BUILD_FIRMWARE) := $(obj)/aic7xxx_reg.h +aicasm-src := $(if $(KBUILD_SRC),$(srctree)/)$(src) + +aic7xxx-gen-$(CONFIG_AIC7XXX_BUILD_FIRMWARE) := $(obj)/aic7xxx_reg.h \ + $(obj)/aic7xxx_seq.h aic7xxx-gen-$(CONFIG_AIC7XXX_REG_PRETTY_PRINT) += $(obj)/aic7xxx_reg_print.c aicasm-7xxx-opts-$(CONFIG_AIC7XXX_REG_PRETTY_PRINT) := \ -p $(obj)/aic7xxx_reg_print.c -i aic7xxx_osm.h ifeq ($(CONFIG_AIC7XXX_BUILD_FIRMWARE),y) -$(obj)/aic7xxx_seq.h: $(src)/aic7xxx.seq $(src)/aic7xxx.reg $(obj)/aicasm/aicasm - $(obj)/aicasm/aicasm -I$(src) -r $(obj)/aic7xxx_reg.h \ +$(aic7xxx-gen-y): $(src)/aic7xxx.seq $(src)/aic7xxx.reg $(obj)/aicasm/aicasm + $(obj)/aicasm/aicasm -I$(aicasm-src) -r $(obj)/aic7xxx_reg.h \ $(aicasm-7xxx-opts-y) -o $(obj)/aic7xxx_seq.h \ - $(src)/aic7xxx.seq - -$(aic7xxx-gen-y): $(obj)/aic7xxx_seq.h -else -$(obj)/aic7xxx_reg_print.c: $(src)/aic7xxx_reg_print.c_shipped + $(aicasm-src)/aic7xxx.seq endif -aic79xx-gen-$(CONFIG_AIC79XX_BUILD_FIRMWARE) := $(obj)/aic79xx_reg.h +aic79xx-gen-$(CONFIG_AIC79XX_BUILD_FIRMWARE) := $(obj)/aic79xx_reg.h \ + $(obj)/aic79xx_seq.h aic79xx-gen-$(CONFIG_AIC79XX_REG_PRETTY_PRINT) += $(obj)/aic79xx_reg_print.c aicasm-79xx-opts-$(CONFIG_AIC79XX_REG_PRETTY_PRINT) := \ -p $(obj)/aic79xx_reg_print.c -i aic79xx_osm.h ifeq ($(CONFIG_AIC79XX_BUILD_FIRMWARE),y) -$(obj)/aic79xx_seq.h: $(src)/aic79xx.seq $(src)/aic79xx.reg $(obj)/aicasm/aicasm - $(obj)/aicasm/aicasm -I$(src) -r $(obj)/aic79xx_reg.h \ +$(aic79xx-gen-y): $(src)/aic79xx.seq $(src)/aic79xx.reg $(obj)/aicasm/aicasm + $(obj)/aicasm/aicasm -I$(aicasm-src) -r $(obj)/aic79xx_reg.h \ $(aicasm-79xx-opts-y) -o $(obj)/aic79xx_seq.h \ - $(src)/aic79xx.seq - -$(aic79xx-gen-y): $(obj)/aic79xx_seq.h -else -$(obj)/aic79xx_reg_print.c: $(src)/aic79xx_reg_print.c_shipped + $(aicasm-src)/aic79xx.seq endif -$(obj)/aicasm/aicasm: $(src)/aicasm/*.[chyl] - $(MAKE) -C $(src)/aicasm +$(obj)/aicasm/aicasm: $(aicasm-src)/aicasm/Makefile $(aicasm-src)/aicasm/*.[chyl] +ifneq ($(KBUILD_SRC),) + mkdir -p $(obj)/aicasm + cp -ax $^ $(obj)/aicasm/ +endif + $(MAKE) -C $(obj)/aicasm KSRC=$(if $(KBUILD_SRC),$(aicasm-src)/aicasm,.) diff --git a/drivers/scsi/aic7xxx/aicasm/Makefile b/drivers/scsi/aic7xxx/aicasm/Makefile index b98c5c1056c3..29ca14d50597 100644 --- a/drivers/scsi/aic7xxx/aicasm/Makefile +++ b/drivers/scsi/aic7xxx/aicasm/Makefile @@ -13,7 +13,7 @@ SRCS= ${CSRCS} ${GENSRCS} LIBS= -ldb clean-files:= ${GENSRCS} ${GENHDRS} $(YSRCS:.y=.output) $(PROG) # Override default kernel CFLAGS. This is a userland app. -AICASM_CFLAGS:= -I/usr/include -I. +AICASM_CFLAGS:= -I/usr/include -I. -I$(KSRC) LEX= flex YACC= bison YFLAGS= -d @@ -50,6 +50,7 @@ aicdb.h: echo "#include " > aicdb.h; \ else \ echo "*** Install db development libraries"; \ + false; \ fi clean: