nanogui: Pending patches/bug/requests ... list available on the FTP


Previous by date: 1 Jun 2005 16:19:58 +0100 Re: #if FOO vs. #ifdef BAR, Alain Volmat
Next by date: 1 Jun 2005 16:19:58 +0100 Re: Pending patches/bug/requests ... list available on the FTP, Jachym Holecek
Previous in thread: 1 Jun 2005 16:19:58 +0100 Re: Pending patches/bug/requests ... list available on the FTP, Alain Volmat
Next in thread: 1 Jun 2005 16:19:58 +0100 Re: Pending patches/bug/requests ... list available on the FTP, Jachym Holecek

Subject: Re: [nanogui] Pending patches/bug/requests ... list available on the FTP
From: Jachym Holecek ####@####.####
Date: 1 Jun 2005 16:19:58 +0100
Message-Id: <20050601151933.GA19508@merlot.ics.muni.cz>

Hello,

> >   * At compile time, scan all the driver sources for DEFDRIVER() and have
> >     a tiny sed+awk/whatever script construct a .c file with the driver
> >     table.
> 
> I'm a bit worrying about such solution actually. Of course that's only
> my feeling and others should also give their opinion on it.
> The idea of the dynamically generated .c file is a bit frightening to me,
> wouldn't it becomes a bit harder to really see what is being compiled ?

I wasn't precise in the description. What I meant was a make frament
(sorry for the bmake-isms) as follows:

drivertab.c: ${MW_CORE_OBJS}
	cat ${.ALLSRC} | sed -n 's,^DEFDRIVER(\([^) ,]*\)),\1,gp' | \
	    awk gendrivertab.awk > ${.TARGET}.c.tmp
	if ! cmp -s ${.TARGET} ${.TARGET}.tmp ; then 			\
		... update ${.TARGET} ... ; 				\
	else 								\
		... remove ${.TARGET}.tmp ... ;

Note that MW_CORE_OBJS is set by the build infrastructure to only contain
drivers selected in config (we could also do a stricter match with gmake's
equivalent of "${MW_CORE_OBJS:M*/drivers*}" as dependency.)

The gendrivertab.awk script produces a C file that in my project looks
like:

  /* Automatically generated, do not fubar. */
  #include <tap/tap.h>

  /* Declare attachments we've seen. */
  extern tap_attach_t dummy_root_ca;
  extern tap_attach_t pcio_root_ca;
  extern tap_attach_t pclpt_membus_ca;
  extern tap_attach_t jtag_pinbus_ca;
  extern tap_attach_t bscan_jtag_ca;

  /* Table containing all known attachments. */
  tap_attach_t *tap_allattach[] = {
	&dummy_root_ca,
	&pcio_root_ca,
	&pclpt_membus_ca,
	&jtag_pinbus_ca,
	&bscan_jtag_ca,
	NULL
  };

Does this sound better?

	Regards,
		-- Jachym Holecek

Previous by date: 1 Jun 2005 16:19:58 +0100 Re: #if FOO vs. #ifdef BAR, Alain Volmat
Next by date: 1 Jun 2005 16:19:58 +0100 Re: Pending patches/bug/requests ... list available on the FTP, Jachym Holecek
Previous in thread: 1 Jun 2005 16:19:58 +0100 Re: Pending patches/bug/requests ... list available on the FTP, Alain Volmat
Next in thread: 1 Jun 2005 16:19:58 +0100 Re: Pending patches/bug/requests ... list available on the FTP, Jachym Holecek


Powered by ezmlm-browse 0.20.