All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: linux-pcmcia@lists.infradead.org, David Woodhouse <dwmw2@infradead.org>
Subject: [PATCH 3/5] firmware: enable usage of mkcis
Date: Thu, 23 Sep 2010 19:19:55 +0400	[thread overview]
Message-ID: <1285255197-9262-3-git-send-email-dbaryshkov@gmail.com> (raw)
In-Reply-To: <1285255197-9262-1-git-send-email-dbaryshkov@gmail.com>

Enable usage of mkcis for generation of cis files

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 firmware/Makefile |   44 +++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 43 insertions(+), 1 deletions(-)

diff --git a/firmware/Makefile b/firmware/Makefile
index 9c2d194..04ecf8c 100644
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -156,6 +156,9 @@ quiet_cmd_ihex2fw  = IHEX2FW $@
 quiet_cmd_h16tofw  = H16TOFW $@
       cmd_h16tofw  = $(objtree)/$(obj)/ihex2fw -w $< $@
 
+quiet_cmd_mkcis	= MKCIS   $@
+      cmd_mkcis = $(objtree)/$(obj)/mkcis -o $@ $<
+
 quiet_cmd_fwbin = MK_FW   $@
       cmd_fwbin = FWNAME="$(patsubst firmware/%.gen.S,%,$@)";		     \
 		  FWSTR="$(subst /,_,$(subst .,_,$(subst -,_,$(patsubst	     \
@@ -224,6 +227,11 @@ ihex2fw_dep :=
 else
 ihex2fw_dep := $(obj)/ihex2fw
 endif
+ifeq ($(INSTALL):$(wildcard $(obj)/mkcis),install:$(obj)/mkcis)
+mkcis_dep :=
+else
+mkcis_dep := $(obj)/mkcis
+endif
 
 # .HEX is also Intel HEX, but where the offset and length in each record
 # is actually meaningful, because the firmware has to be loaded in a certain
@@ -236,6 +244,10 @@ $(obj)/%.fw: $(obj)/%.HEX $(ihex2fw_dep) | $(objtree)/$(obj)/$$(dir %)
 $(obj)/%.fw: $(obj)/%.H16 $(ihex2fw_dep) | $(objtree)/$(obj)/$$(dir %)
 	$(call cmd,h16tofw)
 
+# .ct is a text representation of CIS files, as originally developed by pcmcia-cs
+$(obj)/%.cis: $(obj)/%.ct $(mkcis_dep) | $(objtree)/$(obj)/$$(dir %)
+	$(call cmd,mkcis)
+
 $(firmware-dirs):
 	$(call cmd,mkdir)
 
@@ -251,4 +263,34 @@ targets := $(fw-shipped-) $(patsubst $(obj)/%,%, \
 # final vmlinux link will fail.
 obj-n := dummy
 
-hostprogs-y := ihex2fw
+hostprogs-y := ihex2fw mkcis
+
+mkcis-objs := mkcis.o mkcis-lexer.lex.o mkcis-parser.tab.o
+$(obj)/mkcis-parser.tab.o: $(obj)/mkcis-parser.tab.c $(obj)/mkcis-parser.tab.h
+$(obj)/mkcis-lexer.lex.o:  $(obj)/mkcis-lexer.lex.c $(obj)/mkcis-parser.tab.h
+HOSTCFLAGS_mkcis.o += -Iinclude/pcmcia
+HOSTCFLAGS_mkcis-lexer.lex.o += -Iinclude/pcmcia -Ifirmware/
+HOSTCFLAGS_mkcis-parser.tab.o += -Iinclude/pcmcia -Ifirmware/
+HOSTLOADLIBES_mkcis := -lm
+
+# GENERATE_PARSER := 1		# Uncomment to rebuild flex/bison output
+
+ifdef GENERATE_PARSER
+
+BISON = bison
+FLEX = flex
+
+quiet_cmd_bison = BISON   $@
+      cmd_bison = $(BISON) -o$@ -d $<; cp $@ $@_shipped
+quiet_cmd_flex = FLEX    $@
+      cmd_flex = $(FLEX) -o$@ $<; cp $@ $@_shipped
+
+$(obj)/mkcis-parser.tab.c: $(src)/mkcis-parser.y FORCE
+	$(call if_changed,bison)
+
+$(obj)/mkcis-parser.tab.h: $(obj)/mkcis-parser.tab.c
+
+$(obj)/mkcis-lexer.lex.c: $(src)/mkcis-lexer.l FORCE
+	$(call if_changed,flex)
+
+endif
-- 
1.5.6.5


  parent reply	other threads:[~2010-09-23 15:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-23 15:19 [PATCH 1/5] Makefile.fwinst: include Makefile.lib Dmitry Eremin-Solenikov
2010-09-23 15:19 ` [PATCH 2/5] Add mkcis - a program that can create .cis from text description Dmitry Eremin-Solenikov
2010-09-23 15:29   ` David Woodhouse
2010-09-23 15:36     ` Dmitry Eremin-Solenikov
2010-09-23 15:54       ` David Woodhouse
2010-09-23 16:58       ` Wolfram Sang
2010-09-23 16:55     ` Gene Heskett
2010-09-23 15:19 ` Dmitry Eremin-Solenikov [this message]
2010-09-23 15:19 ` [PATCH 4/5] firmware: replace ihex files with text descriptions for CIS files Dmitry Eremin-Solenikov
2010-09-23 15:19 ` [PATCH 5/5] Documentation: add an utility to parse CIS files to readable form Dmitry Eremin-Solenikov
2010-09-23 15:45 ` [PATCH 1/5] Makefile.fwinst: include Makefile.lib Sam Ravnborg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1285255197-9262-3-git-send-email-dbaryshkov@gmail.com \
    --to=dbaryshkov@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pcmcia@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.