From patchwork Sat Apr 27 03:33:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 162984 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1470488jan; Fri, 26 Apr 2019 20:33:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqyVdCiChTiOUGqk3NfVuAGosHfquHy2hyaSQqUfWkMDRLtjjKsupZvIGAUIBMRJNoz2IRPV X-Received: by 2002:a63:c10e:: with SMTP id w14mr27532663pgf.206.1556336034903; Fri, 26 Apr 2019 20:33:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556336034; cv=none; d=google.com; s=arc-20160816; b=fnkizQmkynIz64O9dYhA6/WZh7meeAapQv2kO/vWH7jv4ksZt6Op51rGn/ORjbs+Wa MdHP9XgDIDe32Riih6X3K6Teuq5ApQOn8ZEPi2IKqwgG5tqyOltcUPD3LlPD2rc+onpk do8vLqTXvI1K/G9NLyeWDTo7tUW0k2jSQSdXdJd3XTc2fWOOpkSJy6qy/IEGx9R/orGA ITdgd10Gzgg1j7X69WT6FnVHPykfHV6rK3Bh1YQHO+dYoLazaJsRUXkVwZH/WPnjKzdb mMNi8/kOoBzqLkWggbzXvDM41J9EAKeAEE5rEK++b8dTkE9Wq21QCceRNCF5z7Rup0/Z bq9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=MTquuhRSUQKNTK42Xx9Gwp06/bDDMv+mmeZs+svCSU0=; b=KBxo5/rNI+pgjWpwEgGKbpzNTDo+HvE04hqPCKKB1x5HYOpgwxd2MQDGPvknbzoeCF 2GsD0VKaVU0LM2c2IFH7ptPzND+4An+e5QzLp3/0aWOl58V9w01OEqgoPxRM2CJFWR3p G28YS/CCcnQymxQ4ZrqrrhaWGFZl5Qef0O31y0PPBvP/39z4B4vu5IuhSM5LWdXT1WaD xtR3iuMpsIwRdKDSLIQTe3tOZy1ALuWMQ6l2+C1NLL561vocJ869/pZ9WI+kf5fZ2ASM 3Nd0QQ6syT7p7T1iDkq4S0cgm+glnohT1A82tdd5WJTibiLlkeQsuJGyQh8mBME5KHL9 1B1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=rshherKe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e3si25763627pgs.37.2019.04.26.20.33.54; Fri, 26 Apr 2019 20:33:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=rshherKe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727421AbfD0Ddw (ORCPT + 30 others); Fri, 26 Apr 2019 23:33:52 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:17157 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726345AbfD0Ddv (ORCPT ); Fri, 26 Apr 2019 23:33:51 -0400 Received: from grover.flets-west.jp (softbank126125154137.bbtec.net [126.125.154.137]) (authenticated) by conuserg-10.nifty.com with ESMTP id x3R3Xie7029345; Sat, 27 Apr 2019 12:33:44 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com x3R3Xie7029345 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1556336024; bh=MTquuhRSUQKNTK42Xx9Gwp06/bDDMv+mmeZs+svCSU0=; h=From:To:Cc:Subject:Date:From; b=rshherKe8BwpbhuKrRWJ7n0lxdM4MPPVJe+ndSFXieNNeh+JQ5cLp6wigzeI5D/qw Crgknety+1vJjoxQQMAQFsXqI2Ng7ZxA/BOaO9/yV4AlidRtYsZdQJk4/xMzbNbF+R zAB3Y2iHeexYWbwAxudzsIo9j9TttFA8cWKvB2Rzi4PvSgDL9t6nW3ISi0ArXYLUZr Cynaz/5nbrnaZAFXEibPz7lV50FUqw9PbRfSRhBNPtXzCbaeSn42kDAqoFm7Nrhdjc 0QMN3co11WT+WDDDuudiA4p16pV/FZ1k4cWI80xD5G+FsI9NlqaNIgVjzePdL/gnwn UJmnl3Q+95k6Q== X-Nifty-SrcIP: [126.125.154.137] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 1/5] kbuild: move samples/ to KBUILD_VMLINUX_OBJS Date: Sat, 27 Apr 2019 12:33:36 +0900 Message-Id: <1556336020-15634-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Handle samples/ like the other top-level directories to simplify the Makefile. Include include/config/auto.conf earlier to evaluate drivers-$(CONFIG_SAMPLES). Signed-off-by: Masahiro Yamada --- Makefile | 18 ++++++++---------- samples/Makefile | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) -- 2.7.4 diff --git a/Makefile b/Makefile index 15e17b4..251ded5 100644 --- a/Makefile +++ b/Makefile @@ -598,20 +598,21 @@ endif export KBUILD_MODULES KBUILD_BUILTIN +ifeq ($(dot-config),1) +include include/config/auto.conf +endif + ifeq ($(KBUILD_EXTMOD),) # Objects we will link into vmlinux / subdirs we need to visit init-y := init/ drivers-y := drivers/ sound/ +drivers-$(CONFIG_SAMPLES) += samples/ net-y := net/ libs-y := lib/ core-y := usr/ virt-y := virt/ endif # KBUILD_EXTMOD -ifeq ($(dot-config),1) -include include/config/auto.conf -endif - # The all: target is the default when no target is given on the # command line. # This allow a user to issue only 'make' to build a kernel including modules @@ -1005,7 +1006,7 @@ export KBUILD_VMLINUX_LIBS := $(libs-y1) export KBUILD_LDS := arch/$(SRCARCH)/kernel/vmlinux.lds export LDFLAGS_vmlinux # used by scripts/package/Makefile -export KBUILD_ALLDIRS := $(sort $(filter-out arch/%,$(vmlinux-alldirs)) arch Documentation include samples scripts tools) +export KBUILD_ALLDIRS := $(sort $(filter-out arch/%,$(vmlinux-alldirs)) arch Documentation include scripts tools) vmlinux-deps := $(KBUILD_LDS) $(KBUILD_VMLINUX_OBJS) $(KBUILD_VMLINUX_LIBS) @@ -1042,11 +1043,8 @@ vmlinux: scripts/link-vmlinux.sh autoksyms_recursive $(vmlinux-deps) FORCE targets := vmlinux -# Build samples along the rest of the kernel. This needs headers_install. -ifdef CONFIG_SAMPLES -vmlinux-dirs += samples +# Some samples need headers_install. samples: headers_install -endif # The actual objects are generated when descending, # make sure no implicit rule kicks in @@ -1362,7 +1360,7 @@ MRPROPER_FILES += .config .config.old .version \ # clean: rm-dirs := $(CLEAN_DIRS) clean: rm-files := $(CLEAN_FILES) -clean-dirs := $(addprefix _clean_, . $(vmlinux-alldirs) Documentation samples) +clean-dirs := $(addprefix _clean_, . $(vmlinux-alldirs) Documentation) PHONY += $(clean-dirs) clean archclean vmlinuxclean $(clean-dirs): diff --git a/samples/Makefile b/samples/Makefile index b1142a9..50f8586 100644 --- a/samples/Makefile +++ b/samples/Makefile @@ -1,6 +1,6 @@ # Makefile for Linux samples code -obj-$(CONFIG_SAMPLES) += kobject/ kprobes/ trace_events/ livepatch/ \ +obj-y += kobject/ kprobes/ trace_events/ livepatch/ \ hw_breakpoint/ kfifo/ kdb/ hidraw/ rpmsg/ seccomp/ \ configfs/ connector/ v4l/ trace_printk/ \ vfio-mdev/ statx/ qmi/ binderfs/