automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fwd: How do I get make to run a program during the make operation?]


From: Jim
Subject: [Fwd: How do I get make to run a program during the make operation?]
Date: Fri, 21 Mar 2008 10:08:01 -0400
User-agent: Thunderbird 2.0.0.9 (X11/20071031)

I thought I sent this message but I never saw it show up. If it's a dup, please excuse me.

Jim.
--- Begin Message --- Subject: How do I get make to run a program during the make operation? Date: Thu, 20 Mar 2008 11:01:49 -0400 User-agent: Thunderbird 2.0.0.9 (X11/20071031) 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.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]