[XForms] Getting rid of auto-generated files...

Angus Leeming angus.leeming at btopenworld.com
Tue Nov 25 17:56:45 EST 2003


On Monday 24 November 2003 7:51 pm, Angus Leeming wrote:
> To subscribers of the xforms list
>
>
> It would be nice if we could get rid of at least some of the .[ch] files
> generated from .fd datasets.
>
> We store .fd files and their associated .[ch] files in the following
> directories: lib/fd, fdesign/fd, fd2ps/test, demos and demos/fd. Of these,
> the .[ch] files in the first two directories would have to remain. (We
> cannot generate the .[ch] files until fdesign has bee created.) However, it
> strikes me that the .[ch] files in the remaining directories could all be
> generated on the fly, just as we do in LyX.
>
> Personally, I think that this would be much more elegant. Thoughts?

Ok, I'm stuck ;-)

Jean-Marc, I wonder if you might help... Attached are the changes I've made to 
demos/Makefile.am. This is proof of concept code and, indeed, works fine. 
However, I have no idea how to turn it into robust code :-(

The problem lies with the block below which generates .[ch] files from  a .fd 
file. Note that I am running this conversion from $build_dir/demos whilst the 
.fd file is to be found in $srcdir/demos/fd. Note the extra '/fd' there. I do 
not want to generate a static library in the fd directory because I want to 
be able to build individual demo files if I so choose.

Here's the troublesome (but working) block:

%.c: %.fd ../fdesign/fdesign
       (cd `dirname $<` && /home/angus/xforms/cvs/build/fdesign/fdesign 
-convert `basename $<`; \
       mv `basename $< .fd`.[ch] /home/angus/xforms/cvs/build/demos/fd/.)

Line 1. All is Ok. The generated .c file depends on the .fd file and on the
existence of the fdesign binary.
%.c: %.fd ../fdesign/fdesign

Lines 2,3. The problems. It appears that fdesign must be run from the 
directory containing the .fd file. That means I lose track of the fdesign 
binary and then must move the generated .[ch] files into the $builddir tree 
(if $srcdir != $builddir).

Any ideas?
Angus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: demos_makefile.am
Type: text/x-diff
Size: 1081 bytes
Desc: not available
Url : attachments/20031125/bd54bf1f/attachment-0010.bin 


More information about the Xforms mailing list