From patchwork Fri Dec 21 08:33:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 154380 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp646803ljp; Fri, 21 Dec 2018 00:33:41 -0800 (PST) X-Google-Smtp-Source: ALg8bN6nj/9w9Nju3/PTyc7/DZcIi4SL+R9yCwgEwCEsb/g+mPpALoMHyTshwtFPQ6HKG6OdDydS X-Received: by 2002:a17:902:a9c4:: with SMTP id b4mr1602326plr.298.1545381221608; Fri, 21 Dec 2018 00:33:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545381221; cv=none; d=google.com; s=arc-20160816; b=AI+yWu43hs/1n4AiVa5RhtTYOQqIqPCMd/PsDmqm0xAG2RzybTqAZJxei4IVlINphQ kgBHnqnB3xLPO14lBXSpsV2sOu6ZozIP3sM9J19txm3Z5wfj7XU6hhRzktuScbsBlTb7 Erz0mVHY2T3PXoF9eZJUHDd6LBL2y5ur4FWBzHhw/qdW0ZHe5d1NBRtMQ1xw4Hi49Z3g x/HkBMwgoyUlGHLoy2KQedUqi+Jop0mZD1b8YvKqobr/sR5ZM449GjjAl+2/kOpkS8f8 50dmLshWsw8G1zF2bUL6oSF5sTMFaSRxpItdK5wgE9IUNznGewuigGASDow3WZY20hS2 EdKg== 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=FWpKupWsXaMmpNholmQkdc+vAkpvhP5jjygfkS3neP4=; b=zleNOvKJpP3t/UIkkY0GOGxSBtGLcfTjqO8s6qtZApUeDbm15Xtx1QSH15wiis9K8+ hkyUvOTX2QuJRzHgoQ9NUtoSQkZi75Rr1jExKlNGWYa4XzDYNQFS6U+GAsiWaaKjf9Gn +8P+sVm7vbIo1qtej1K2VMM7qLrPpIAHMquOL/H2a9WImXr/Ymx6UHz2mf4OoqpXU+Sj 9N5lNboylFcMZ7SwMrP84mayIAjH5Ll4dKCrvUIiBjn0fNweoNvjiwdvCI7Z74Q8yYy3 uDEzzYtkDUBu+4c0ejyjvxuN82xfkeLth8782RBeK6UzU3BQ5IU+S6vVAnfM8r2yul9X syBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=qMiB9sPd; 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 s71si21603650pfk.105.2018.12.21.00.33.41; Fri, 21 Dec 2018 00:33:41 -0800 (PST) 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=qMiB9sPd; 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 S2387973AbeLUIdj (ORCPT + 31 others); Fri, 21 Dec 2018 03:33:39 -0500 Received: from conuserg-12.nifty.com ([210.131.2.79]:38272 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387570AbeLUId3 (ORCPT ); Fri, 21 Dec 2018 03:33:29 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id wBL8XAI7008714; Fri, 21 Dec 2018 17:33:10 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com wBL8XAI7008714 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1545381191; bh=FWpKupWsXaMmpNholmQkdc+vAkpvhP5jjygfkS3neP4=; h=From:To:Cc:Subject:Date:From; b=qMiB9sPdoS8B/VlXQDDpqLN2oZqjHpkE8vKcu6YeJYKDFR2zR/A4gmi45Adw1Sp+i 7rTqXQFuqGNUG19li7jrlDZImqmv8TYdbZWq16mhfs5m+xPtahrqWY7/UVIBqncbU1 VoBn5p7vwArCeKLfv/e8nv1cTpV1ZFTt23lvGka4oAzJVqdygdZs7T878WMvJ4Cfyg Gg4b/l5loCH59wDioPDzrChGU5C7c8Rp1uokhIfL0FHZIDsE3dBy7Razaqx4jnGXLK J6ZyVAY9FdL6TtJOMiPefRZI7QPuLkBTgCQX0DWoMI1vNj26tdAbG3INDDJrmaPwoq oiUxCWAimbiTg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 1/5] kconfig: split some C files out of zconf.y Date: Fri, 21 Dec 2018 17:33:04 +0900 Message-Id: <1545381188-514-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 I want to compile each C file independently instead of including all of them from zconf.y. These 4 files are low hanging fruits. Signed-off-by: Masahiro Yamada --- scripts/kconfig/Makefile | 19 +++++++++---------- scripts/kconfig/confdata.c | 1 + scripts/kconfig/expr.c | 2 ++ scripts/kconfig/lkc.h | 1 + scripts/kconfig/preprocess.c | 2 ++ scripts/kconfig/symbol.c | 2 +- scripts/kconfig/zconf.y | 4 ---- 7 files changed, 16 insertions(+), 15 deletions(-) -- 2.7.4 diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 63b6092..d3bd687 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -142,13 +142,8 @@ help: @echo ' testconfig - Run Kconfig unit tests (requires python3 and pytest)' # =========================================================================== -# Shared Makefile for the various kconfig executables: -# conf: Used for defconfig, oldconfig and related targets # object files used by all kconfig flavours - -conf-objs := conf.o zconf.tab.o - -hostprogs-y := conf +common-objs := confdata.o expr.o symbol.o preprocess.o zconf.tab.o targets += zconf.lex.c @@ -156,9 +151,13 @@ targets += zconf.lex.c HOSTCFLAGS_zconf.lex.o := -I$(src) HOSTCFLAGS_zconf.tab.o := -I$(src) +# conf: Used for defconfig, oldconfig and related targets +hostprogs-y += conf +conf-objs := conf.o $(common-objs) + # nconf: Used for the nconfig target based on ncurses hostprogs-y += nconf -nconf-objs := nconf.o zconf.tab.o nconf.gui.o +nconf-objs := nconf.o nconf.gui.o $(common-objs) HOSTLDLIBS_nconf = $(shell . $(obj)/.nconf-cfg && echo $$libs) HOSTCFLAGS_nconf.o = $(shell . $(obj)/.nconf-cfg && echo $$cflags) @@ -169,7 +168,7 @@ $(obj)/nconf.o $(obj)/nconf.gui.o: $(obj)/.nconf-cfg # mconf: Used for the menuconfig target based on lxdialog hostprogs-y += mconf lxdialog := checklist.o inputbox.o menubox.o textbox.o util.o yesno.o -mconf-objs := mconf.o zconf.tab.o $(addprefix lxdialog/, $(lxdialog)) +mconf-objs := mconf.o $(addprefix lxdialog/, $(lxdialog)) $(common-objs) HOSTLDLIBS_mconf = $(shell . $(obj)/.mconf-cfg && echo $$libs) $(foreach f, mconf.o $(lxdialog), \ @@ -181,7 +180,7 @@ $(addprefix $(obj)/lxdialog/, $(lxdialog)): $(obj)/.mconf-cfg # qconf: Used for the xconfig target based on Qt hostprogs-y += qconf qconf-cxxobjs := qconf.o -qconf-objs := zconf.tab.o +qconf-objs := $(common-objs) HOSTLDLIBS_qconf = $(shell . $(obj)/.qconf-cfg && echo $$libs) HOSTCXXFLAGS_qconf.o = $(shell . $(obj)/.qconf-cfg && echo $$cflags) @@ -196,7 +195,7 @@ $(obj)/%.moc: $(src)/%.h $(obj)/.qconf-cfg # gconf: Used for the gconfig target based on GTK+ hostprogs-y += gconf -gconf-objs := gconf.o zconf.tab.o +gconf-objs := gconf.o $(common-objs) HOSTLDLIBS_gconf = $(shell . $(obj)/.gconf-cfg && echo $$libs) HOSTCFLAGS_gconf.o = $(shell . $(obj)/.gconf-cfg && echo $$cflags) diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index e32ada9..ea88355 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c index ddb9c86..265f2af 100644 --- a/scripts/kconfig/expr.c +++ b/scripts/kconfig/expr.c @@ -3,6 +3,8 @@ * Copyright (C) 2002 Roman Zippel */ +#include +#include #include #include #include diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h index 4ff33cd..160a931 100644 --- a/scripts/kconfig/lkc.h +++ b/scripts/kconfig/lkc.h @@ -108,6 +108,7 @@ const char *str_get(struct gstr *gs); /* symbol.c */ void sym_clear_all_valid(void); struct symbol *sym_choice_default(struct symbol *sym); +struct property *sym_get_range_prop(struct symbol *sym); const char *sym_get_string_default(struct symbol *sym); struct symbol *sym_check_deps(struct symbol *sym); struct property *prop_alloc(enum prop_type type, struct symbol *sym); diff --git a/scripts/kconfig/preprocess.c b/scripts/kconfig/preprocess.c index b028a48..592dfbfa 100644 --- a/scripts/kconfig/preprocess.c +++ b/scripts/kconfig/preprocess.c @@ -2,6 +2,7 @@ // // Copyright (C) 2018 Masahiro Yamada +#include #include #include #include @@ -9,6 +10,7 @@ #include #include "list.h" +#include "lkc.h" #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index 364afa1..860414d 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c @@ -88,7 +88,7 @@ static struct property *sym_get_default_prop(struct symbol *sym) return NULL; } -static struct property *sym_get_range_prop(struct symbol *sym) +struct property *sym_get_range_prop(struct symbol *sym) { struct property *prop; diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index 60ee8e7..32be913 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -730,8 +730,4 @@ void zconfdump(FILE *out) #include "zconf.lex.c" #include "util.c" -#include "confdata.c" -#include "expr.c" -#include "symbol.c" #include "menu.c" -#include "preprocess.c"