From patchwork Mon May 23 08:10:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Lacombe X-Patchwork-Id: 807892 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4N8B6oR032713 for ; Mon, 23 May 2011 08:11:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753880Ab1EWILF (ORCPT ); Mon, 23 May 2011 04:11:05 -0400 Received: from mail-iy0-f174.google.com ([209.85.210.174]:45855 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753866Ab1EWILE (ORCPT ); Mon, 23 May 2011 04:11:04 -0400 Received: by iyb14 with SMTP id 14so4457027iyb.19 for ; Mon, 23 May 2011 01:11:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=bfdtisxWB1ZUtKcBdz3AwT+gEZRftF4RATVib8LEpPs=; b=XSDS6ORzRKlvtMcdUROpOVYRFHgdygVX1JiRcvGLgEV6iK4EeSkZzds/quGIHKS+hc WtoSwiTSXeVXXS5XISVJ28neuJpMf/FU32YieI1vs7P1rTKj3iSDkIZgQCxjy9AfVphH WPo+HFLKORD3HLyQRkH1upNaQ/Z3NYofwaT6Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=EUZ8ED84qxV6OgdQRP3ZbmcSo4N+3OuAg87bKK5BFJEGLEpVvaG9wKn2Q9oCnCLpSo PlPa9IUQ4HYoy1dKueBr5Drt7j2oIk6UOdyiaP6BBHKepENbnZgsqk8hB90uHOAVv+cn 6eGq4O4rZ7TcI60qmY1pfc3rxIbiymu8fhaSM= Received: by 10.42.131.196 with SMTP id a4mr9233102ict.345.1306138264439; Mon, 23 May 2011 01:11:04 -0700 (PDT) Received: from localhost.localdomain (76-10-146-236.dsl.teksavvy.com [76.10.146.236]) by mx.google.com with ESMTPS id gy41sm2820660ibb.56.2011.05.23.01.11.03 (version=SSLv3 cipher=OTHER); Mon, 23 May 2011 01:11:04 -0700 (PDT) From: Arnaud Lacombe To: linux-kbuild@vger.kernel.org Cc: Michal Marek , Arnaud Lacombe , David Gibson Subject: [RFCv2 01/13] kbuild: add implicit rules for parser generation Date: Mon, 23 May 2011 04:10:27 -0400 Message-Id: <1306138239-13440-2-git-send-email-lacombar@gmail.com> X-Mailer: git-send-email 1.7.3.4.574.g608b.dirty In-Reply-To: <1306138239-13440-1-git-send-email-lacombar@gmail.com> References: <1306138239-13440-1-git-send-email-lacombar@gmail.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Mon, 23 May 2011 08:11:06 +0000 (UTC) Cc: David Gibson Cc: Michal Marek --- scripts/Makefile.lib | 33 ++++++++++++++++++++++++++++++++- 1 files changed, 32 insertions(+), 1 deletions(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 1c702ca..f05270c 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -160,15 +160,46 @@ ld_flags = $(LDFLAGS) $(ldflags-y) modname-multi = $(sort $(foreach m,$(multi-used),\ $(if $(filter $(subst $(obj)/,,$*.o), $($(m:.o=-objs)) $($(m:.o=-y))),$(m:.o=)))) +ifdef REGENERATE_PARSERS +# GPERF +# --------------------------------------------------------------------------- +quiet_cmd_gperf = GPERF $@ + cmd_gperf = gperf -t --output-file $@ -a -C -E -g -k 1,3,$$ -p -t $< +$(src)/%.hash.c_shipped: $(src)/%.gperf + $(call cmd,gperf) + +# LEX +# --------------------------------------------------------------------------- +quiet_cmd_flex = LEX $@ + cmd_flex = flex -o$@ -L $< +$(src)/%.lex.c_shipped: $(src)/%.l + $(call cmd,flex) + +# YACC +# --------------------------------------------------------------------------- +quiet_cmd_bison = YACC $@ + cmd_bison = bison -o$@ -t -l $< +$(src)/%.tab.c_shipped: $(src)/%.y + $(call cmd,bison) +endif + # Shipped files # =========================================================================== quiet_cmd_shipped = SHIPPED $@ cmd_shipped = cat $< > $@ -$(obj)/%:: $(src)/%_shipped +$(obj)/%.tab.c: $(src)/%.tab.c_shipped + $(call cmd,shipped) + +$(obj)/%.lex.c: $(src)/%.lex.c_shipped $(call cmd,shipped) +$(obj)/%.hash.c: $(src)/%.hash.c_shipped + $(call cmd,shipped) + +$(obj)/%:: $(src)/%_shipped + # Commands useful for building a boot image # =========================================================================== #