I like to include my subversion version number in my rpm spec file so I can
keep track of the source used to generate the binary.  I've been manually
changing it but since I forget to sometimes, I'd like for make to generate
the spec file for me.  I wrote a small perl program that reads a template
file (.tmpl) and writes out the .spec file after calling subversion . -n.  I
can't figure out how to force make from a Makefile.am to run the perl script
each time it builds.
I thought I could do it with SUFFIXES but when I tried it didn't work.  I
added the following to the top level Makefile.am:

noinst_PROGRAMS = poll.spec
poll_tmpl_SOURCES = poll.tmpl FORCE
.tmpl.spec:
       ./logpoll.pl $<

FORCE:

However make still has rules looking for a poll.c.  I received the
following:

make[2]: Entering directory `/home/jlynch/threaded'
make[2]: *** No rule to make target `poll.c', needed by `poll.o'.  Stop.
make[2]: Leaving directory `/home/jlynch/threaded'
make[1]: *** [all-recursive] Error 1

I also tried bin_PROGRAMS=poll.spec but received the same error.  I don't
really want to install the spec file anywhere, just build it.

Can anyone suggest how I might accomplish what I thought was going to be a
simple task?

Thanks,
Jim.

Reply via email to